commit | 6d62cc71630311a07053cfc0043ab3871963ec9a | [log] [tgz] |
---|---|---|
author | Tim Peng <timhypeng@google.com> | Thu Mar 18 14:46:46 2021 +0800 |
committer | tim peng <timhypeng@google.com> | Fri Mar 19 01:18:05 2021 +0000 |
tree | 18b90e3feaf69c590758f53f782abae0ff0a4af6 | |
parent | b8506650b852e73a82b712e7b797b4b6feee2979 [diff] |
Incorrect summary for the carkit device -"Problem connecting. Turn the device off & back on" message shows in the BT setting when DUT pair with carkit and SAP connection is established. -HFP and SAP can not be connected at the same time. Bug: 182740717 Test: make -j50 RunSettingsLibRoboTests ROBOTEST_FILTER=CachedBluetoothDeviceTest Change-Id: Ieadbe137c3098c25d527e0db4b7df9267bfde9f7
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 5e2d21b..9c7aac1 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1006,7 +1006,7 @@ private boolean isProfileConnectedFail() { return mIsA2dpProfileConnectedFail || mIsHearingAidProfileConnectedFail - || mIsHeadsetProfileConnectedFail; + || (!isConnectedSapDevice() && mIsHeadsetProfileConnectedFail); } /** @@ -1149,6 +1149,12 @@ BluetoothProfile.STATE_CONNECTED; } + private boolean isConnectedSapDevice() { + SapProfile sapProfile = mProfileManager.getSapProfile(); + return sapProfile != null && sapProfile.getConnectionStatus(mDevice) + == BluetoothProfile.STATE_CONNECTED; + } + public CachedBluetoothDevice getSubDevice() { return mSubDevice; }
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java index 34fdc1e..63cb381 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java
@@ -441,6 +441,10 @@ return mHearingAidProfile; } + SapProfile getSapProfile() { + return mSapProfile; + } + @VisibleForTesting HidProfile getHidProfile() { return mHidProfile;