summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author tim peng <timhypeng@google.com> 2021-03-19 08:02:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-03-19 08:02:28 +0000
commit53241f61449b52c33f4278c69a720b0f1a53db4f (patch)
treec1a41f5fa4426ead29fff01bc8398ef9d7b6826a
parentb2e08e976adad5f2e2e4c40a6e964afce0d75388 (diff)
parent6d62cc71630311a07053cfc0043ab3871963ec9a (diff)
Merge "Incorrect summary for the carkit device" into sc-dev
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java8
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java4
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;