summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/development/BugReportPreferenceController.java
diff options
context:
space:
mode:
authorjeffreyhuang <jeffreyhuang@google.com>2017-11-22 16:44:51 -0800
committerjeffreyhuang <jeffreyhuang@google.com>2017-11-22 16:51:15 -0800
commite89dc361496aa728f336bf1945553c2f16cb5ba8 (patch)
tree3660e523e255f2940558b809cdc640947875d2c2 /src/com/android/settings/development/BugReportPreferenceController.java
parenteeffbf62256aabbaeab204401009c2c545c50e99 (diff)
downloadpackages_apps_Settings-e89dc361496aa728f336bf1945553c2f16cb5ba8.tar.gz
packages_apps_Settings-e89dc361496aa728f336bf1945553c2f16cb5ba8.tar.bz2
packages_apps_Settings-e89dc361496aa728f336bf1945553c2f16cb5ba8.zip
rename v2 controllers
- Remove v2 postfix on controllers now that v1 dev options have been removed Bug: 34203528 Test: compiles and tests still pass Change-Id: I7a937e914293233801dbd1d9536b7b47ee70d591
Diffstat (limited to 'src/com/android/settings/development/BugReportPreferenceController.java')
-rw-r--r--src/com/android/settings/development/BugReportPreferenceController.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/com/android/settings/development/BugReportPreferenceController.java b/src/com/android/settings/development/BugReportPreferenceController.java
new file mode 100644
index 0000000000..ac2ae0d9ca
--- /dev/null
+++ b/src/com/android/settings/development/BugReportPreferenceController.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.development;
+
+import android.content.Context;
+import android.os.UserManager;
+
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.development.DeveloperOptionsPreferenceController;
+
+public class BugReportPreferenceController extends DeveloperOptionsPreferenceController implements
+ PreferenceControllerMixin {
+
+ private static final String KEY_BUGREPORT = "bugreport";
+
+ private final UserManager mUserManager;
+
+ public BugReportPreferenceController(Context context) {
+ super(context);
+
+ mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
+ }
+
+ @Override
+ public boolean isAvailable() {
+ return !mUserManager.hasUserRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES);
+ }
+
+ @Override
+ public String getPreferenceKey() {
+ return KEY_BUGREPORT;
+ }
+}