diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2022-03-31 01:30:16 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2022-03-31 01:30:16 -0700 |
commit | 26e181f986bb8256062e0f091b754db3c06c57e7 (patch) | |
tree | 5cda28c65899147ad519ed34af13d4ba600c7fc6 | |
parent | 9a7b5a5c31a5c47b51bd6e45dea11ddc6c282bd0 (diff) | |
parent | 316755203d84776ae76490f04982c679a9e39218 (diff) |
Merge 316755203d84776ae76490f04982c679a9e39218 on remote branch
Change-Id: I7d3df8a3847ff1226743037646630efb05d7b20d
4 files changed, 41 insertions, 39 deletions
diff --git a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java index 3acdddfa9..b2593cdd8 100644 --- a/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java +++ b/src/com/android/bluetooth/a2dp/A2dpCodecConfig.java @@ -206,39 +206,6 @@ class A2dpCodecConfig { mA2dpSourceCodecPriorityAptx = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; } } - - try { - value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd); - } catch (NotFoundException e) { - value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; - } - if (mAdapterService.isSplitA2DPSourceAPTXHD()) { - if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value - < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) { - mA2dpSourceCodecPriorityAptxHd = value; - if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() && - !a2dp_offload_cap.contains("aptxhd")) { - mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; - } - } - } - - try { - value = resources.getInteger(R.integer.a2dp_source_codec_priority_ldac); - } catch (NotFoundException e) { - value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; - } - if(mAdapterService.isSplitA2DPSourceLDAC()) { - if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value - < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) { - mA2dpSourceCodecPriorityLdac = value; - if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() && - !a2dp_offload_cap.contains("ldac")) { - mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; - } - } - } - if(mAdapterService.isSplitA2DPSourceAPTXADAPTIVE()) { try { value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_adaptive); @@ -268,6 +235,42 @@ class A2dpCodecConfig { mA2dpSourceCodecPriorityAptxAdaptive = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; } + if(mAdapterService.isSplitA2DPSourceAPTXHD()) { + try { + value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_hd); + } catch (NotFoundException e) { + value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; + } + if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value + < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) { + mA2dpSourceCodecPriorityAptxHd = value; + if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() && + !a2dp_offload_cap.contains("aptxhd")) { + mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; + } + } + } else { + mA2dpSourceCodecPriorityAptxHd = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; + } + + + if(mAdapterService.isSplitA2DPSourceLDAC()) { + try { + value = resources.getInteger(R.integer.a2dp_source_codec_priority_ldac); + } catch (NotFoundException e) { + value = BluetoothCodecConfig.CODEC_PRIORITY_DEFAULT; + } + if ((value >= BluetoothCodecConfig.CODEC_PRIORITY_DISABLED) && (value + < BluetoothCodecConfig.CODEC_PRIORITY_HIGHEST)) { + mA2dpSourceCodecPriorityLdac = value; + if (a2dp_offload_cap != null && !a2dp_offload_cap.isEmpty() && + !a2dp_offload_cap.contains("ldac")) { + mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; + } + } + } else { + mA2dpSourceCodecPriorityLdac = BluetoothCodecConfig.CODEC_PRIORITY_DISABLED; + } if (mAdapterService.isVendorIntfEnabled()) { try { value = resources.getInteger(R.integer.a2dp_source_codec_priority_aptx_tws); diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java index 3b094d197..56f8f6536 100644 --- a/src/com/android/bluetooth/a2dp/A2dpService.java +++ b/src/com/android/bluetooth/a2dp/A2dpService.java @@ -1547,7 +1547,7 @@ public class A2dpService extends ProfileService { } long cs4 = codecConfig.getCodecSpecific4(); - GattService mGattService = GattService.getGattService(); + GattService mGattService = GattService.getGattService(); if(cs4 > 0 && mGattService != null) { switch((int)(cs4 & APTX_MODE_MASK)) { @@ -1556,7 +1556,6 @@ public class A2dpService extends ProfileService { break; case APTX_LL: - case APTX_ULL: if((cs4 & APTX_SCAN_FILTER_MASK) == APTX_SCAN_FILTER_MASK) { mGattService.setAptXLowLatencyMode(true); } else { @@ -1600,7 +1599,6 @@ public class A2dpService extends ProfileService { mGattService.setAptXLowLatencyMode(false); break; case APTX_LL: - case APTX_ULL: if((cs4 & APTX_SCAN_FILTER_MASK) == APTX_SCAN_FILTER_MASK) { mGattService.setAptXLowLatencyMode(true); } else { diff --git a/src/com/android/bluetooth/btservice/AdapterState.java b/src/com/android/bluetooth/btservice/AdapterState.java index 69fc369cf..031d90530 100644 --- a/src/com/android/bluetooth/btservice/AdapterState.java +++ b/src/com/android/bluetooth/btservice/AdapterState.java @@ -91,8 +91,8 @@ final class AdapterState extends StateMachine { static final int BLE_START_XMEM_TIMEOUT_DELAY = 23000; static final int BLE_STOP_TIMEOUT_DELAY = 1000; - static final int BREDR_START_TIMEOUT_DELAY = 4000; - static final int BREDR_STOP_TIMEOUT_DELAY = 4000; + static final int BREDR_START_TIMEOUT_DELAY = 8000; + static final int BREDR_STOP_TIMEOUT_DELAY = 8000; static final int BREDR_CLEANUP_TIMEOUT_DELAY = 2000; static final int STACK_DISABLE_TIMEOUT_DELAY = 8000; static final int BT_FORCEKILL_TIMEOUT_DELAY = 100; diff --git a/src/com/android/bluetooth/hfp/HeadsetService.java b/src/com/android/bluetooth/hfp/HeadsetService.java index 9f71b9069..621c11562 100644 --- a/src/com/android/bluetooth/hfp/HeadsetService.java +++ b/src/com/android/bluetooth/hfp/HeadsetService.java @@ -2514,7 +2514,8 @@ public class HeadsetService extends ProfileService { doForEachConnectedConnectingStateMachine( stateMachine -> stateMachine.sendMessage(HeadsetStateMachine.CALL_STATE_CHANGED, new HeadsetCallState(numActive, numHeld, callState, number, type, name))); - if (!(mSystemInterface.isInCall() || mSystemInterface.isRinging())) { + if (!(mSystemInterface.isInCall() || mSystemInterface.isRinging() + || isAudioOn())) { Log.i(TAG, "no call, sending resume A2DP message to state machines"); for (BluetoothDevice device : availableDevices) { HeadsetStateMachine stateMachine = mStateMachines.get(device); |