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
This commit is contained in:
Tim Peng
2021-03-18 14:46:46 +08:00
committed by tim peng
parent b8506650b8
commit 6d62cc7163
2 changed files with 11 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -441,6 +441,10 @@ public class LocalBluetoothProfileManager {
return mHearingAidProfile;
}
SapProfile getSapProfile() {
return mSapProfile;
}
@VisibleForTesting
HidProfile getHidProfile() {
return mHidProfile;