CachedBluetoothDevice: Simplify ProfleConnectionState check
Check whether ProfileConnectionState is empty instead of checking whether it is null. BUG: N/A Change-Id: I553e7b8b0c1b3ae967dcc0ecd482b7ff19f3c1f6 Signed-off-by: xutianguo <xutianguo@xiaomi.com>
This commit is contained in:
@@ -332,8 +332,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
|
||||
}
|
||||
|
||||
public int getProfileConnectionState(LocalBluetoothProfile profile) {
|
||||
if (mProfileConnectionState == null ||
|
||||
mProfileConnectionState.get(profile) == null) {
|
||||
if (mProfileConnectionState.get(profile) == null) {
|
||||
// If cache is empty make the binder call to get the state
|
||||
int state = profile.getConnectionStatus(mDevice);
|
||||
mProfileConnectionState.put(profile, state);
|
||||
|
||||
Reference in New Issue
Block a user