Add Developer menu entry to disable Bluetooth absolute volume
NOTE: Original CL updated: Developer-related settings in res/values/strings.xml are now in SettingsLib . Bug: 27078729 Change-Id: I8a029baeb25b449446ae9bcc8cb220d5ec8e44a9
This commit is contained in:
committed by
Pavlin Radoslavov
parent
017bdceeb4
commit
591c6c4f5a
@@ -179,6 +179,10 @@
|
|||||||
android:entries="@array/usb_configuration_titles"
|
android:entries="@array/usb_configuration_titles"
|
||||||
android:entryValues="@array/usb_configuration_values" />
|
android:entryValues="@array/usb_configuration_values" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="bluetooth_disable_absolute_volume"
|
||||||
|
android:title="@string/bluetooth_disable_absolute_volume"
|
||||||
|
android:summary="@string/bluetooth_disable_absolute_volume_summary"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:key="debug_input_category"
|
<PreferenceCategory android:key="debug_input_category"
|
||||||
|
@@ -181,6 +181,11 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private static final String ENABLE_FREEFORM_SUPPORT_KEY = "enable_freeform_support";
|
private static final String ENABLE_FREEFORM_SUPPORT_KEY = "enable_freeform_support";
|
||||||
private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
|
private static final String COLOR_TEMPERATURE_KEY = "color_temperature";
|
||||||
|
|
||||||
|
private static final String BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY =
|
||||||
|
"bluetooth_disable_absolute_volume";
|
||||||
|
private static final String BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_PROPERTY =
|
||||||
|
"persist.bluetooth.disableabsvol";
|
||||||
|
|
||||||
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
private static final String INACTIVE_APPS_KEY = "inactive_apps";
|
||||||
|
|
||||||
private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";
|
private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";
|
||||||
@@ -246,6 +251,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
private SwitchPreference mWifiAggressiveHandover;
|
private SwitchPreference mWifiAggressiveHandover;
|
||||||
private SwitchPreference mLegacyDhcpClient;
|
private SwitchPreference mLegacyDhcpClient;
|
||||||
private SwitchPreference mMobileDataAlwaysOn;
|
private SwitchPreference mMobileDataAlwaysOn;
|
||||||
|
private SwitchPreference mBluetoothDisableAbsVolume;
|
||||||
|
|
||||||
private SwitchPreference mWifiAllowScansWithTraffic;
|
private SwitchPreference mWifiAllowScansWithTraffic;
|
||||||
private SwitchPreference mStrictMode;
|
private SwitchPreference mStrictMode;
|
||||||
@@ -412,6 +418,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
|
mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY);
|
||||||
mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY);
|
mUsbConfiguration = addListPreference(USB_CONFIGURATION_KEY);
|
||||||
mWebViewProvider = addListPreference(WEBVIEW_PROVIDER_KEY);
|
mWebViewProvider = addListPreference(WEBVIEW_PROVIDER_KEY);
|
||||||
|
mBluetoothDisableAbsVolume = findAndInitSwitchPref(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY);
|
||||||
|
|
||||||
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
|
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
|
||||||
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
|
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
|
||||||
@@ -709,6 +716,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
if (mColorTemperaturePreference != null) {
|
if (mColorTemperaturePreference != null) {
|
||||||
updateColorTemperature();
|
updateColorTemperature();
|
||||||
}
|
}
|
||||||
|
updateBluetoothDisableAbsVolumeOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetDangerousOptions() {
|
private void resetDangerousOptions() {
|
||||||
@@ -1397,6 +1405,16 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
mLegacyDhcpClient.isChecked() ? 1 : 0);
|
mLegacyDhcpClient.isChecked() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateBluetoothDisableAbsVolumeOptions() {
|
||||||
|
updateSwitchPreference(mBluetoothDisableAbsVolume,
|
||||||
|
SystemProperties.getBoolean(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_PROPERTY, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeBluetoothDisableAbsVolumeOptions() {
|
||||||
|
SystemProperties.set(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_PROPERTY,
|
||||||
|
mBluetoothDisableAbsVolume.isChecked() ? "true" : "false");
|
||||||
|
}
|
||||||
|
|
||||||
private void updateMobileDataAlwaysOnOptions() {
|
private void updateMobileDataAlwaysOnOptions() {
|
||||||
updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
|
updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
|
||||||
getActivity().getContentResolver(),
|
getActivity().getContentResolver(),
|
||||||
@@ -1884,6 +1902,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
startInactiveAppsFragment();
|
startInactiveAppsFragment();
|
||||||
} else if (BACKGROUND_CHECK_KEY.equals(preference.getKey())) {
|
} else if (BACKGROUND_CHECK_KEY.equals(preference.getKey())) {
|
||||||
startBackgroundCheckFragment();
|
startBackgroundCheckFragment();
|
||||||
|
} else if (preference == mBluetoothDisableAbsVolume) {
|
||||||
|
writeBluetoothDisableAbsVolumeOptions();
|
||||||
} else {
|
} else {
|
||||||
return super.onPreferenceTreeClick(preference);
|
return super.onPreferenceTreeClick(preference);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user