Enable color temperature developer setting am: ab5da2d2fe
am: 979a32e6e3
* commit '979a32e6e30d7fc12fb64ba842f66aee97cdac91':
Enable color temperature developer setting
This commit is contained in:
@@ -38,4 +38,7 @@
|
|||||||
<!-- The duration (in milliseconds) of activity transitions -->
|
<!-- The duration (in milliseconds) of activity transitions -->
|
||||||
<integer name="setup_wizard_transition_duration">300</integer>
|
<integer name="setup_wizard_transition_duration">300</integer>
|
||||||
|
|
||||||
|
<!-- When true enable color temperature setting. -->
|
||||||
|
<bool name="config_enableColorTemperature">false</bool>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -66,6 +66,12 @@
|
|||||||
android:summary="@string/picture_color_mode_desc"
|
android:summary="@string/picture_color_mode_desc"
|
||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="color_temperature"
|
||||||
|
android:title="@string/color_temperature"
|
||||||
|
android:summary="@string/color_temperature_desc"
|
||||||
|
android:persistent="false" />
|
||||||
|
|
||||||
<PreferenceCategory android:key="debug_debugging_category"
|
<PreferenceCategory android:key="debug_debugging_category"
|
||||||
android:title="@string/debug_debugging_category">
|
android:title="@string/debug_debugging_category">
|
||||||
|
|
||||||
|
@@ -116,6 +116,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private static final String BUGREPORT_IN_POWER_KEY = "bugreport_in_power";
|
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 OPENGL_TRACES_PROPERTY = "debug.egl.trace";
|
||||||
private static final String TUNER_UI_KEY = "tuner_ui";
|
private static final String TUNER_UI_KEY = "tuner_ui";
|
||||||
|
private static final String COLOR_TEMPERATURE_PROPERTY = "persist.sys.debug.color_temp";
|
||||||
|
|
||||||
private static final String DEBUG_APP_KEY = "debug_app";
|
private static final String DEBUG_APP_KEY = "debug_app";
|
||||||
private static final String WAIT_FOR_DEBUGGER_KEY = "wait_for_debugger";
|
private static final String WAIT_FOR_DEBUGGER_KEY = "wait_for_debugger";
|
||||||
@@ -167,6 +168,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
private static final String WIFI_LEGACY_DHCP_CLIENT_KEY = "legacy_dhcp_client";
|
||||||
private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
|
private static final String MOBILE_DATA_ALWAYS_ON = "mobile_data_always_on";
|
||||||
private static final String KEY_COLOR_MODE = "color_mode";
|
private static final String KEY_COLOR_MODE = "color_mode";
|
||||||
|
private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
|
||||||
|
|
||||||
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
||||||
|
|
||||||
@@ -264,6 +266,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
private ColorModePreference mColorModePreference;
|
private ColorModePreference mColorModePreference;
|
||||||
|
|
||||||
|
private SwitchPreference mColorTemperaturePreference;
|
||||||
|
|
||||||
private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>();
|
private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>();
|
||||||
|
|
||||||
private final ArrayList<SwitchPreference> mResetSwitchPrefs
|
private final ArrayList<SwitchPreference> mResetSwitchPrefs
|
||||||
@@ -429,6 +433,15 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
removePreference(KEY_COLOR_MODE);
|
removePreference(KEY_COLOR_MODE);
|
||||||
mColorModePreference = null;
|
mColorModePreference = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mColorTemperaturePreference = (SwitchPreference) findPreference(COLOR_TEMPERATURE_KEY);
|
||||||
|
if (getResources().getBoolean(R.bool.config_enableColorTemperature)) {
|
||||||
|
mAllPrefs.add(mColorTemperaturePreference);
|
||||||
|
mResetSwitchPrefs.add(mColorTemperaturePreference);
|
||||||
|
} else {
|
||||||
|
removePreference(COLOR_TEMPERATURE_KEY);
|
||||||
|
mColorTemperaturePreference = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ListPreference addListPreference(String prefKey) {
|
private ListPreference addListPreference(String prefKey) {
|
||||||
@@ -636,6 +649,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
updateMobileDataAlwaysOnOptions();
|
updateMobileDataAlwaysOnOptions();
|
||||||
updateSimulateColorSpace();
|
updateSimulateColorSpace();
|
||||||
updateUSBAudioOptions();
|
updateUSBAudioOptions();
|
||||||
|
if (mColorTemperaturePreference != null) {
|
||||||
|
updateColorTemperature();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetDangerousOptions() {
|
private void resetDangerousOptions() {
|
||||||
@@ -1180,6 +1196,17 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateColorTemperature() {
|
||||||
|
updateSwitchPreference(mColorTemperaturePreference,
|
||||||
|
SystemProperties.getBoolean(COLOR_TEMPERATURE_PROPERTY, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeColorTemperature() {
|
||||||
|
SystemProperties.set(COLOR_TEMPERATURE_PROPERTY,
|
||||||
|
mColorTemperaturePreference.isChecked() ? "1" : "0");
|
||||||
|
pokeSystemProperties();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateUSBAudioOptions() {
|
private void updateUSBAudioOptions() {
|
||||||
updateSwitchPreference(mUSBAudio, Settings.Secure.getInt(getContentResolver(),
|
updateSwitchPreference(mUSBAudio, Settings.Secure.getInt(getContentResolver(),
|
||||||
Settings.Secure.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0) != 0);
|
Settings.Secure.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, 0) != 0);
|
||||||
@@ -1750,6 +1777,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
writeLegacyDhcpClientOptions();
|
writeLegacyDhcpClientOptions();
|
||||||
} else if (preference == mMobileDataAlwaysOn) {
|
} else if (preference == mMobileDataAlwaysOn) {
|
||||||
writeMobileDataAlwaysOnOptions();
|
writeMobileDataAlwaysOnOptions();
|
||||||
|
} else if (preference == mColorTemperaturePreference) {
|
||||||
|
writeColorTemperature();
|
||||||
} else if (preference == mUSBAudio) {
|
} else if (preference == mUSBAudio) {
|
||||||
writeUSBAudioOptions();
|
writeUSBAudioOptions();
|
||||||
} else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
|
} else if (INACTIVE_APPS_KEY.equals(preference.getKey())) {
|
||||||
|
Reference in New Issue
Block a user