diff options
2 files changed, 11 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 5e2d21b2e188..9c7aac135571 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 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> private boolean isProfileConnectedFail() { return mIsA2dpProfileConnectedFail || mIsHearingAidProfileConnectedFail - || mIsHeadsetProfileConnectedFail; + || (!isConnectedSapDevice() && mIsHeadsetProfileConnectedFail); } /** @@ -1149,6 +1149,12 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> 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 34fdc1e45567..63cb38153d8d 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 @@ public class LocalBluetoothProfileManager { return mHearingAidProfile; } + SapProfile getSapProfile() { + return mSapProfile; + } + @VisibleForTesting HidProfile getHidProfile() { return mHidProfile; |