diff options
author | Jason Monk <jmonk@google.com> | 2015-05-11 16:58:34 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-05-12 11:01:17 -0400 |
commit | 49851ac32a2ec771ca9eb248c3819dbe33555c77 (patch) | |
tree | f4178cac4b0809a8b6d53dded57bb26ce75b7f6d /src/com/android/settings/DevelopmentSettings.java | |
parent | 370e44d72d7ff6d5ed36bbfe4fd1272c74bf5f52 (diff) | |
download | packages_apps_Settings-49851ac32a2ec771ca9eb248c3819dbe33555c77.zip packages_apps_Settings-49851ac32a2ec771ca9eb248c3819dbe33555c77.tar.gz packages_apps_Settings-49851ac32a2ec771ca9eb248c3819dbe33555c77.tar.bz2 |
Add SystemUI Tuner Control
Change-Id: I321c3263612c752409beb46f4c96826954b96e26
Diffstat (limited to 'src/com/android/settings/DevelopmentSettings.java')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 3c964c9..4d89bf5 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -97,6 +97,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment */ public static final String PREF_SHOW = "show"; + private static final ComponentName SYSUI_TWEAK = new ComponentName("com.android.systemui", + "com.android.systemui.tuner.TunerActivity"); + private static final String ENABLE_ADB = "enable_adb"; private static final String CLEAR_ADB_KEYS = "clear_adb_keys"; private static final String ENABLE_TERMINAL = "enable_terminal"; @@ -112,6 +115,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private static final String BUGREPORT = "bugreport"; private static final String BUGREPORT_IN_POWER_KEY = "bugreport_in_power"; private static final String OPENGL_TRACES_PROPERTY = "debug.egl.trace"; + private static final String TWEAK_UI_KEY = "tweak_ui"; private static final String DEBUG_APP_KEY = "debug_app"; private static final String WAIT_FOR_DEBUGGER_KEY = "wait_for_debugger"; @@ -260,6 +264,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private Dialog mAdbKeysDialog; private boolean mUnavailable; + private SwitchPreference mTweakUiPref; + @Override protected int getMetricsCategory() { return MetricsLogger.DEVELOPMENT; @@ -392,6 +398,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mAllPrefs.add(mShowAllANRs); mResetSwitchPrefs.add(mShowAllANRs); + mTweakUiPref = findAndInitSwitchPref(TWEAK_UI_KEY); + Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY); if (hdcpChecking != null) { mAllPrefs.add(hdcpChecking); @@ -593,6 +601,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateSimulateColorSpace(); updateUseNuplayerOptions(); updateUSBAudioOptions(); + updateTweakUi(); } private void resetDangerousOptions() { @@ -1069,6 +1078,21 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } } + private void updateTweakUi() { + updateSwitchPreference(mTweakUiPref, getActivity().getPackageManager() + .getComponentEnabledSetting(SYSUI_TWEAK) + == PackageManager.COMPONENT_ENABLED_STATE_ENABLED); + mTweakUiPref.setOnPreferenceChangeListener(this); + } + + private void writeTweakUi(Object newValue) { + Boolean enabled = (Boolean) newValue; + getActivity().getPackageManager().setComponentEnabledSetting(SYSUI_TWEAK, + enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED + : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, + PackageManager.DONT_KILL_APP); + } + private void updateUseNuplayerOptions() { updateSwitchPreference( mUseAwesomePlayer, SystemProperties.getBoolean(USE_AWESOMEPLAYER_PROPERTY, false)); @@ -1669,6 +1693,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } else if (preference == mSimulateColorSpace) { writeSimulateColorSpace(newValue); return true; + } else if (preference == mTweakUiPref) { + writeTweakUi(newValue); + return true; } return false; } |