commit | 22bbb819f2b0b073e0ec1ca5fe52ed0ba3559dda | [log] [tgz] |
---|---|---|
author | xutianguo <xutianguo@xiaomi.com> | Wed Jun 22 11:32:00 2016 +0800 |
committer | Tianguo Xu <xutianguo@xiaomi.com> | Fri Sep 08 05:58:36 2017 +0000 |
tree | bf590e13c5252f48faf11901221d4f6302ec7e4a | |
parent | 6c7c55206dcca24880ac873fdf34c6f099dc0759 [diff] [blame] |
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>
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index e279a09..5f302c6 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -332,8 +332,7 @@ } 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);