Merge "CachedBluetoothDevice: Simplify ProfleConnectionState check"

This commit is contained in:
Treehugger Robot
2017-09-08 19:26:37 +00:00
committed by Gerrit Code Review

View File

@@ -332,8 +332,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
} }
public int getProfileConnectionState(LocalBluetoothProfile profile) { public int getProfileConnectionState(LocalBluetoothProfile profile) {
if (mProfileConnectionState == null || if (mProfileConnectionState.get(profile) == null) {
mProfileConnectionState.get(profile) == null) {
// If cache is empty make the binder call to get the state // If cache is empty make the binder call to get the state
int state = profile.getConnectionStatus(mDevice); int state = profile.getConnectionStatus(mDevice);
mProfileConnectionState.put(profile, state); mProfileConnectionState.put(profile, state);