Merge "Bluetooth: Use "Disable" in-band ringing instead of "Enable"" am: 80c0656ca6

am: e34375b88c

Change-Id: Ie9a167aa6310643465238510831eee8cfab34965
This commit is contained in:
Jack He
2018-01-08 20:20:47 +00:00
committed by android-build-merger
3 changed files with 26 additions and 25 deletions

View File

@@ -1601,6 +1601,11 @@
<!-- Bluetooth settings. Dock Setting Dialog - Remember setting and don't ask user again --> <!-- Bluetooth settings. Dock Setting Dialog - Remember setting and don't ask user again -->
<string name="bluetooth_dock_settings_remember">Remember settings</string> <string name="bluetooth_dock_settings_remember">Remember settings</string>
<!-- Setting Checkbox title for disabling Bluetooth inband ringing in Development Settings -->
<string name="bluetooth_disable_inband_ringing">Disable in-band ringing</string>
<!-- Summary of checkbox for disabling Bluetooth inband ringing in Development Settings -->
<string name="bluetooth_disable_inband_ringing_summary">Dont play custom phone ringtones on Bluetooth headsets</string>
<!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] --> <!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] -->
<string name="wifi_display_settings_title">Cast</string> <string name="wifi_display_settings_title">Cast</string>
<!-- Wifi Display settings. The title of a menu item to enable wireless display [CHAR LIMIT=40] --> <!-- Wifi Display settings. The title of a menu item to enable wireless display [CHAR LIMIT=40] -->

View File

@@ -220,9 +220,9 @@
android:summary="@string/bluetooth_disable_absolute_volume_summary"/> android:summary="@string/bluetooth_disable_absolute_volume_summary"/>
<SwitchPreference <SwitchPreference
android:key="bluetooth_enable_inband_ringing" android:key="bluetooth_disable_inband_ringing"
android:title="@string/bluetooth_enable_inband_ringing" android:title="@string/bluetooth_disable_inband_ringing"
android:summary="@string/bluetooth_enable_inband_ringing_summary"/> android:summary="@string/bluetooth_disable_inband_ringing_summary"/>
<ListPreference <ListPreference
android:key="bluetooth_select_avrcp_version" android:key="bluetooth_select_avrcp_version"

View File

@@ -210,12 +210,12 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
"persist.bluetooth.disableabsvol"; "persist.bluetooth.disableabsvol";
private static final String BLUETOOTH_AVRCP_VERSION_PROPERTY = private static final String BLUETOOTH_AVRCP_VERSION_PROPERTY =
"persist.bluetooth.avrcpversion"; "persist.bluetooth.avrcpversion";
private static final String BLUETOOTH_ENABLE_INBAND_RINGING_PROPERTY = private static final String BLUETOOTH_DISABLE_INBAND_RINGING_PROPERTY =
"persist.bluetooth.enableinbandringing"; "persist.bluetooth.disableinbandringing";
private static final String BLUETOOTH_BTSNOOP_ENABLE_PROPERTY = private static final String BLUETOOTH_BTSNOOP_ENABLE_PROPERTY =
"persist.bluetooth.btsnoopenable"; "persist.bluetooth.btsnoopenable";
private static final String BLUETOOTH_ENABLE_INBAND_RINGING_KEY = "bluetooth_enable_inband_ringing"; private static final String BLUETOOTH_DISABLE_INBAND_RINGING_KEY = "bluetooth_disable_inband_ringing";
private static final String BLUETOOTH_SELECT_AVRCP_VERSION_KEY = "bluetooth_select_avrcp_version"; private static final String BLUETOOTH_SELECT_AVRCP_VERSION_KEY = "bluetooth_select_avrcp_version";
private static final String BLUETOOTH_SELECT_A2DP_CODEC_KEY = "bluetooth_select_a2dp_codec"; private static final String BLUETOOTH_SELECT_A2DP_CODEC_KEY = "bluetooth_select_a2dp_codec";
private static final String BLUETOOTH_SELECT_A2DP_SAMPLE_RATE_KEY = "bluetooth_select_a2dp_sample_rate"; private static final String BLUETOOTH_SELECT_A2DP_SAMPLE_RATE_KEY = "bluetooth_select_a2dp_sample_rate";
@@ -291,7 +291,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private SwitchPreference mTetheringHardwareOffload; private SwitchPreference mTetheringHardwareOffload;
private SwitchPreference mBluetoothShowDevicesWithoutNames; private SwitchPreference mBluetoothShowDevicesWithoutNames;
private SwitchPreference mBluetoothDisableAbsVolume; private SwitchPreference mBluetoothDisableAbsVolume;
private SwitchPreference mBluetoothEnableInbandRinging; private SwitchPreference mBluetoothDisableInbandRinging;
private BluetoothA2dp mBluetoothA2dp; private BluetoothA2dp mBluetoothA2dp;
private final Object mBluetoothA2dpLock = new Object(); private final Object mBluetoothA2dpLock = new Object();
@@ -510,10 +510,10 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mBluetoothShowDevicesWithoutNames = mBluetoothShowDevicesWithoutNames =
findAndInitSwitchPref(BLUETOOTH_SHOW_DEVICES_WITHOUT_NAMES_KEY); findAndInitSwitchPref(BLUETOOTH_SHOW_DEVICES_WITHOUT_NAMES_KEY);
mBluetoothDisableAbsVolume = findAndInitSwitchPref(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY); mBluetoothDisableAbsVolume = findAndInitSwitchPref(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY);
mBluetoothEnableInbandRinging = findAndInitSwitchPref(BLUETOOTH_ENABLE_INBAND_RINGING_KEY); mBluetoothDisableInbandRinging = findAndInitSwitchPref(BLUETOOTH_DISABLE_INBAND_RINGING_KEY);
if (!BluetoothHeadset.isInbandRingingSupported(getContext())) { if (!BluetoothHeadset.isInbandRingingSupported(getContext())) {
removePreference(mBluetoothEnableInbandRinging); removePreference(mBluetoothDisableInbandRinging);
mBluetoothEnableInbandRinging = null; mBluetoothDisableInbandRinging = null;
} }
mBluetoothSelectAvrcpVersion = addListPreference(BLUETOOTH_SELECT_AVRCP_VERSION_KEY); mBluetoothSelectAvrcpVersion = addListPreference(BLUETOOTH_SELECT_AVRCP_VERSION_KEY);
@@ -853,7 +853,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
} }
updateBluetoothShowDevicesWithoutUserFriendlyNameOptions(); updateBluetoothShowDevicesWithoutUserFriendlyNameOptions();
updateBluetoothDisableAbsVolumeOptions(); updateBluetoothDisableAbsVolumeOptions();
updateBluetoothEnableInbandRingingOptions(); updateBluetoothDisableInbandRingingOptions();
updateBluetoothA2dpConfigurationValues(); updateBluetoothA2dpConfigurationValues();
updatePrivateDnsSummary(); updatePrivateDnsSummary();
} }
@@ -867,10 +867,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
onPreferenceTreeClick(cb); onPreferenceTreeClick(cb);
} }
} }
if (mBluetoothEnableInbandRinging != null) {
mBluetoothEnableInbandRinging.setChecked(true);
onPreferenceTreeClick(mBluetoothEnableInbandRinging);
}
mBugReportInPowerController.resetPreference(); mBugReportInPowerController.resetPreference();
mEnableAdbController.resetPreference(); mEnableAdbController.resetPreference();
resetDebuggerOptions(); resetDebuggerOptions();
@@ -1518,17 +1514,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mBluetoothDisableAbsVolume.isChecked() ? "true" : "false"); mBluetoothDisableAbsVolume.isChecked() ? "true" : "false");
} }
private void updateBluetoothEnableInbandRingingOptions() { private void updateBluetoothDisableInbandRingingOptions() {
if (mBluetoothEnableInbandRinging != null) { if (mBluetoothDisableInbandRinging != null) {
updateSwitchPreference(mBluetoothEnableInbandRinging, updateSwitchPreference(mBluetoothDisableInbandRinging,
SystemProperties.getBoolean(BLUETOOTH_ENABLE_INBAND_RINGING_PROPERTY, true)); SystemProperties.getBoolean(BLUETOOTH_DISABLE_INBAND_RINGING_PROPERTY, false));
} }
} }
private void writeBluetoothEnableInbandRingingOptions() { private void writeBluetoothDisableInbandRingingOptions() {
if (mBluetoothEnableInbandRinging != null) { if (mBluetoothDisableInbandRinging != null) {
SystemProperties.set(BLUETOOTH_ENABLE_INBAND_RINGING_PROPERTY, SystemProperties.set(BLUETOOTH_DISABLE_INBAND_RINGING_PROPERTY,
mBluetoothEnableInbandRinging.isChecked() ? "true" : "false"); mBluetoothDisableInbandRinging.isChecked() ? "true" : "false");
} }
} }
@@ -2583,8 +2579,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
writeBluetoothShowDevicesWithoutUserFriendlyNameOptions(); writeBluetoothShowDevicesWithoutUserFriendlyNameOptions();
} else if (preference == mBluetoothDisableAbsVolume) { } else if (preference == mBluetoothDisableAbsVolume) {
writeBluetoothDisableAbsVolumeOptions(); writeBluetoothDisableAbsVolumeOptions();
} else if (preference == mBluetoothEnableInbandRinging) { } else if (preference == mBluetoothDisableInbandRinging) {
writeBluetoothEnableInbandRingingOptions(); writeBluetoothDisableInbandRingingOptions();
} else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) { } else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) {
resetShortcutManagerThrottling(); resetShortcutManagerThrottling();
} else { } else {