1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.settings.applications;
17 
18 import android.provider.Settings;
19 import android.service.vr.VrListenerService;
20 
21 import com.android.internal.logging.MetricsProto.MetricsEvent;
22 import com.android.settings.R;
23 import com.android.settings.utils.ManagedServiceSettings;
24 
25 public class VrListenerSettings extends ManagedServiceSettings {
26     private static final String TAG = VrListenerSettings.class.getSimpleName();
27     private static final Config CONFIG = getVrListenerConfig();
28 
getVrListenerConfig()29     private static final Config getVrListenerConfig() {
30         final Config c = new Config();
31         c.tag = TAG;
32         c.setting = Settings.Secure.ENABLED_VR_LISTENERS;
33         c.intentAction = VrListenerService.SERVICE_INTERFACE;
34         c.permission = android.Manifest.permission.BIND_VR_LISTENER_SERVICE;
35         c.noun = "vr listener";
36         c.warningDialogTitle = R.string.vr_listener_security_warning_title;
37         c.warningDialogSummary = R.string.vr_listener_security_warning_summary;
38         c.emptyText = R.string.no_vr_listeners;
39         return c;
40     }
41 
42     @Override
getConfig()43     protected Config getConfig() {
44         return CONFIG;
45     }
46 
47     @Override
getMetricsCategory()48     protected int getMetricsCategory() {
49         return MetricsEvent.VR_MANAGE_LISTENERS;
50     }
51 }
52