VrListenerSettings.java revision 6507613ebcd22e4691c2af92a5c161bd327db336
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 */
16package com.android.settings.applications;
17
18import android.provider.Settings;
19import android.service.vr.VrListenerService;
20
21import com.android.internal.logging.MetricsProto.MetricsEvent;
22import com.android.settings.R;
23import com.android.settings.utils.ManagedServiceSettings;
24
25public class VrListenerSettings extends ManagedServiceSettings {
26    private static final String TAG = VrListenerSettings.class.getSimpleName();
27    private static final Config CONFIG = getVrListenerConfig();
28
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
43    protected Config getConfig() {
44        return CONFIG;
45    }
46
47    @Override
48    public int getMetricsCategory() {
49        return MetricsEvent.VR_MANAGE_LISTENERS;
50    }
51}
52