diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-06 03:01:52 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-06 03:01:52 +0000 |
| commit | 3d1281cef08aedf06a4865c1ad7e59deb31ab77c (patch) | |
| tree | 141c050f54124ebcb09d4cb746bed2ce08e37c4b | |
| parent | 8e151eb0789d9001301b9b72f56c0a70af23ffe8 (diff) | |
| parent | 39b5b839bddc216ba8102d36c1f955190b2ec100 (diff) | |
| download | platform_packages_apps_Test_connectivity-android11-gsi.tar.gz platform_packages_apps_Test_connectivity-android11-gsi.tar.bz2 platform_packages_apps_Test_connectivity-android11-gsi.zip | |
Snap for 6269144 from 39b5b839bddc216ba8102d36c1f955190b2ec100 to rvc-releaseandroid-vts-11.0_r1android-cts-11.0_r1android-11.0.0_r3android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-releaseandroid11-gsi
Change-Id: I307b1e38c255ad8992ebbb1ed3450de20a61e4a3
| -rw-r--r-- | PMC/src/com/android/pmc/A2dpReceiver.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/PMC/src/com/android/pmc/A2dpReceiver.java b/PMC/src/com/android/pmc/A2dpReceiver.java index 843f7ae..162d864 100644 --- a/PMC/src/com/android/pmc/A2dpReceiver.java +++ b/PMC/src/com/android/pmc/A2dpReceiver.java @@ -403,7 +403,12 @@ public class A2dpReceiver extends BroadcastReceiver { BluetoothCodecConfig[] codecsSelectableCapabilities = null; if (mBluetoothA2dp != null) { - codecStatus = mBluetoothA2dp.getCodecStatus(null); // Use current active device + BluetoothDevice activeDevice = mBluetoothA2dp.getActiveDevice(); + if (activeDevice == null) { + Log.e(TAG, "getCodecValue: Active device is null"); + return null; + } + codecStatus = mBluetoothA2dp.getCodecStatus(activeDevice); if (codecStatus != null) { codecConfig = codecStatus.getCodecConfig(); codecsLocalCapabilities = codecStatus.getCodecsLocalCapabilities(); @@ -465,8 +470,13 @@ public class A2dpReceiver extends BroadcastReceiver { } if (mBluetoothA2dp != null) { + BluetoothDevice activeDevice = mBluetoothA2dp.getActiveDevice(); + if (activeDevice == null) { + Log.e(TAG, "setCodecValue: Active device is null. Codec is not set."); + return false; + } Log.d(TAG, "setCodecConfigPreference()"); - mBluetoothA2dp.setCodecConfigPreference(null, codecConfig); // Use current active device + mBluetoothA2dp.setCodecConfigPreference(mBluetoothA2dp.getActiveDevice(), codecConfig); } else { Log.e(TAG, "mBluetoothA2dp is null. Codec is not set"); return false; |
