Merge "Add ACL state listener for bt devices"

This commit is contained in:
Lei Yu
2018-10-31 06:12:46 +00:00
committed by Android (Google) Code Review
4 changed files with 17 additions and 8 deletions

View File

@@ -170,6 +170,15 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
update(cachedDevice);
}
@Override
public void onAclConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {
if (DBG) {
Log.d(TAG, "onAclConnectionStateChanged() device: " + cachedDevice.getName()
+ ", state: " + state);
}
update(cachedDevice);
}
@Override
public void onServiceConnected() {
// When bluetooth service connected update the UI
@@ -282,6 +291,6 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
", is connected : " + device.isConnected() + " , is profile connected : "
+ cachedDevice.isConnected());
}
return device.getBondState() == BluetoothDevice.BOND_BONDED && cachedDevice.isConnected();
return device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected();
}
}

View File

@@ -46,7 +46,7 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater
", is connected : " + device.isConnected() + ", is profile connected : "
+ cachedDevice.isConnected());
}
return device.getBondState() == BluetoothDevice.BOND_BONDED && !cachedDevice.isConnected();
return device.getBondState() == BluetoothDevice.BOND_BONDED && !device.isConnected();
}
@Override