Skip to content
Snippets Groups Projects
Commit 9c053702 authored by tim peng's avatar tim peng Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE: HA still appears in Media device list even though it has...

Merge "DO NOT MERGE: HA still appears in Media device list even though it has been unpaired." into sc-v2-dev
parents 8264da57 68dac6c4
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
private boolean mIsA2dpProfileConnectedFail = false;
private boolean mIsHeadsetProfileConnectedFail = false;
private boolean mIsHearingAidProfileConnectedFail = false;
private boolean mUnpairing = false;
// Group second device for Hearing Aid
private CachedBluetoothDevice mSubDevice;
@VisibleForTesting
......@@ -402,6 +403,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
if (state != BluetoothDevice.BOND_NONE) {
final BluetoothDevice dev = mDevice;
if (dev != null) {
mUnpairing = true;
final boolean successful = dev.removeBond();
if (successful) {
releaseLruCache();
......@@ -1243,4 +1245,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
void releaseLruCache() {
mDrawableCache.evictAll();
}
boolean getUnpairing() {
return mUnpairing;
}
}
......@@ -180,6 +180,9 @@ public class HearingAidDeviceManager {
break;
case BluetoothProfile.STATE_DISCONNECTED:
mainDevice = findMainDevice(cachedDevice);
if (cachedDevice.getUnpairing()) {
return true;
}
if (mainDevice != null) {
// When main device exists, receiving sub device disconnection
// To update main device UI
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment