Merge "Add developer menu entry to enable Bluetooth inband ringing" am: 3d08bedba2
am: 9e1e430f06
Change-Id: I8fe93eebafb60a237bfbe1009652672e17411a3d
This commit is contained in:
@@ -197,6 +197,11 @@
|
|||||||
android:title="@string/bluetooth_disable_absolute_volume"
|
android:title="@string/bluetooth_disable_absolute_volume"
|
||||||
android:summary="@string/bluetooth_disable_absolute_volume_summary"/>
|
android:summary="@string/bluetooth_disable_absolute_volume_summary"/>
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="bluetooth_enable_inband_ringing"
|
||||||
|
android:title="@string/bluetooth_enable_inband_ringing"
|
||||||
|
android:summary="@string/bluetooth_enable_inband_ringing_summary"/>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="bluetooth_select_avrcp_version"
|
android:key="bluetooth_select_avrcp_version"
|
||||||
android:title="@string/bluetooth_select_avrcp_version_string"
|
android:title="@string/bluetooth_select_avrcp_version_string"
|
||||||
|
@@ -29,6 +29,7 @@ import android.bluetooth.BluetoothA2dp;
|
|||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothCodecConfig;
|
import android.bluetooth.BluetoothCodecConfig;
|
||||||
import android.bluetooth.BluetoothCodecStatus;
|
import android.bluetooth.BluetoothCodecStatus;
|
||||||
|
import android.bluetooth.BluetoothHeadset;
|
||||||
import android.bluetooth.BluetoothProfile;
|
import android.bluetooth.BluetoothProfile;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -201,7 +202,10 @@ 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 =
|
||||||
|
"persist.bluetooth.enableinbandringing";
|
||||||
|
|
||||||
|
private static final String BLUETOOTH_ENABLE_INBAND_RINGING_KEY = "bluetooth_enable_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";
|
||||||
@@ -278,6 +282,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private SwitchPreference mWifiAggressiveHandover;
|
private SwitchPreference mWifiAggressiveHandover;
|
||||||
private SwitchPreference mMobileDataAlwaysOn;
|
private SwitchPreference mMobileDataAlwaysOn;
|
||||||
private SwitchPreference mBluetoothDisableAbsVolume;
|
private SwitchPreference mBluetoothDisableAbsVolume;
|
||||||
|
private SwitchPreference mBluetoothEnableInbandRinging;
|
||||||
|
|
||||||
private BluetoothA2dp mBluetoothA2dp;
|
private BluetoothA2dp mBluetoothA2dp;
|
||||||
private final Object mBluetoothA2dpLock = new Object();
|
private final Object mBluetoothA2dpLock = new Object();
|
||||||
@@ -474,6 +479,11 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mWebViewProvider = addListPreference(WEBVIEW_PROVIDER_KEY);
|
mWebViewProvider = addListPreference(WEBVIEW_PROVIDER_KEY);
|
||||||
mWebViewMultiprocess = findAndInitSwitchPref(WEBVIEW_MULTIPROCESS_KEY);
|
mWebViewMultiprocess = findAndInitSwitchPref(WEBVIEW_MULTIPROCESS_KEY);
|
||||||
mBluetoothDisableAbsVolume = findAndInitSwitchPref(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY);
|
mBluetoothDisableAbsVolume = findAndInitSwitchPref(BLUETOOTH_DISABLE_ABSOLUTE_VOLUME_KEY);
|
||||||
|
mBluetoothEnableInbandRinging = findAndInitSwitchPref(BLUETOOTH_ENABLE_INBAND_RINGING_KEY);
|
||||||
|
if (!BluetoothHeadset.isInbandRingingSupported(getContext())) {
|
||||||
|
removePreference(mBluetoothEnableInbandRinging);
|
||||||
|
mBluetoothEnableInbandRinging = null;
|
||||||
|
}
|
||||||
|
|
||||||
mBluetoothSelectAvrcpVersion = addListPreference(BLUETOOTH_SELECT_AVRCP_VERSION_KEY);
|
mBluetoothSelectAvrcpVersion = addListPreference(BLUETOOTH_SELECT_AVRCP_VERSION_KEY);
|
||||||
mBluetoothSelectA2dpCodec = addListPreference(BLUETOOTH_SELECT_A2DP_CODEC_KEY);
|
mBluetoothSelectA2dpCodec = addListPreference(BLUETOOTH_SELECT_A2DP_CODEC_KEY);
|
||||||
@@ -776,6 +786,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateColorTemperature();
|
updateColorTemperature();
|
||||||
}
|
}
|
||||||
updateBluetoothDisableAbsVolumeOptions();
|
updateBluetoothDisableAbsVolumeOptions();
|
||||||
|
updateBluetoothEnableInbandRingingOptions();
|
||||||
updateBluetoothA2dpConfigurationValues();
|
updateBluetoothA2dpConfigurationValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1500,6 +1511,20 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mBluetoothDisableAbsVolume.isChecked() ? "true" : "false");
|
mBluetoothDisableAbsVolume.isChecked() ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateBluetoothEnableInbandRingingOptions() {
|
||||||
|
if (mBluetoothEnableInbandRinging != null) {
|
||||||
|
updateSwitchPreference(mBluetoothEnableInbandRinging,
|
||||||
|
SystemProperties.getBoolean(BLUETOOTH_ENABLE_INBAND_RINGING_PROPERTY, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeBluetoothEnableInbandRingingOptions() {
|
||||||
|
if (mBluetoothEnableInbandRinging != null) {
|
||||||
|
SystemProperties.set(BLUETOOTH_ENABLE_INBAND_RINGING_PROPERTY,
|
||||||
|
mBluetoothEnableInbandRinging.isChecked() ? "true" : "false");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateMobileDataAlwaysOnOptions() {
|
private void updateMobileDataAlwaysOnOptions() {
|
||||||
updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
|
updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
|
||||||
getActivity().getContentResolver(),
|
getActivity().getContentResolver(),
|
||||||
@@ -2513,6 +2538,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
startBackgroundCheckFragment();
|
startBackgroundCheckFragment();
|
||||||
} else if (preference == mBluetoothDisableAbsVolume) {
|
} else if (preference == mBluetoothDisableAbsVolume) {
|
||||||
writeBluetoothDisableAbsVolumeOptions();
|
writeBluetoothDisableAbsVolumeOptions();
|
||||||
|
} else if (preference == mBluetoothEnableInbandRinging) {
|
||||||
|
writeBluetoothEnableInbandRingingOptions();
|
||||||
} else if (preference == mWebViewMultiprocess) {
|
} else if (preference == mWebViewMultiprocess) {
|
||||||
writeWebViewMultiprocessOptions();
|
writeWebViewMultiprocessOptions();
|
||||||
} else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) {
|
} else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) {
|
||||||
|
Reference in New Issue
Block a user