The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.settings; |
| 18 | |
Fan Zhang | 31b2100 | 2019-01-16 13:49:47 -0800 | [diff] [blame] | 19 | import android.app.settings.SettingsEnums; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 20 | import android.os.Bundle; |
Xiaohui Chen | 44879a3 | 2015-07-22 13:53:22 -0700 | [diff] [blame] | 21 | import android.os.UserManager; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 22 | |
Fan Zhang | c7162cd | 2018-06-18 15:21:41 -0700 | [diff] [blame] | 23 | import androidx.preference.PreferenceScreen; |
| 24 | |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 25 | public class TestingSettings extends SettingsPreferenceFragment { |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 26 | |
| 27 | @Override |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 28 | public void onCreate(Bundle savedInstanceState) { |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 29 | super.onCreate(savedInstanceState); |
| 30 | |
| 31 | addPreferencesFromResource(R.xml.testing_settings); |
Raju Yadav | 05fb069 | 2015-04-29 11:04:49 +0200 | [diff] [blame] | 32 | |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 33 | final UserManager um = UserManager.get(getContext()); |
Xiaohui Chen | 44879a3 | 2015-07-22 13:53:22 -0700 | [diff] [blame] | 34 | if (!um.isAdminUser()) { |
Raju Yadav | 05fb069 | 2015-04-29 11:04:49 +0200 | [diff] [blame] | 35 | PreferenceScreen preferenceScreen = (PreferenceScreen) |
| 36 | findPreference("radio_info_settings"); |
| 37 | getPreferenceScreen().removePreference(preferenceScreen); |
| 38 | } |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 39 | } |
Fabrice Di Meglio | 7682013 | 2014-02-10 16:22:28 -0800 | [diff] [blame] | 40 | |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 41 | @Override |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 42 | public int getMetricsCategory() { |
Fan Zhang | 31b2100 | 2019-01-16 13:49:47 -0800 | [diff] [blame] | 43 | return SettingsEnums.TESTING; |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 44 | } |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 45 | } |