blob: acfe89fff066190d309194bc844fdb1ccc371691 [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
2 * Copyright (C) 2008 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
17package com.android.settings;
18
19import android.os.Bundle;
Xiaohui Chen44879a32015-07-22 13:53:22 -070020import android.os.UserManager;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080021
Tamas Berghammer265d3c22016-06-22 15:34:45 +010022import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
Jason Monkb7e43802016-06-06 16:01:58 -040023
Fan Zhangc7162cd2018-06-18 15:21:41 -070024import androidx.preference.PreferenceScreen;
25
Jason Monkb7e43802016-06-06 16:01:58 -040026public class TestingSettings extends SettingsPreferenceFragment {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080027
28 @Override
Jason Monkb7e43802016-06-06 16:01:58 -040029 public void onCreate(Bundle savedInstanceState) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080030 super.onCreate(savedInstanceState);
31
32 addPreferencesFromResource(R.xml.testing_settings);
Raju Yadav05fb0692015-04-29 11:04:49 +020033
Jason Monkb7e43802016-06-06 16:01:58 -040034 final UserManager um = UserManager.get(getContext());
Xiaohui Chen44879a32015-07-22 13:53:22 -070035 if (!um.isAdminUser()) {
Raju Yadav05fb0692015-04-29 11:04:49 +020036 PreferenceScreen preferenceScreen = (PreferenceScreen)
37 findPreference("radio_info_settings");
38 getPreferenceScreen().removePreference(preferenceScreen);
39 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080040 }
Fabrice Di Meglio76820132014-02-10 16:22:28 -080041
Jason Monkb7e43802016-06-06 16:01:58 -040042 @Override
Fan Zhang65076132016-08-08 10:25:13 -070043 public int getMetricsCategory() {
Jason Monkb7e43802016-06-06 16:01:58 -040044 return MetricsEvent.TESTING;
45 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080046}