Update airplane mode checkbox when toggled from system bar.

Bug: 3148095

Also fix an NPE crash I saw when exiting Settings immediately after toggling
the airplane mode.

Change-Id: I83eb2d90e203fd56b09269cf9fa8f74a4354834f
This commit is contained in:
Amith Yamasani
2011-01-26 09:56:44 -08:00
parent f6ac42968f
commit b98c00e710
2 changed files with 20 additions and 6 deletions

View File

@@ -111,8 +111,10 @@ class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
" newProfileState " + newProfileState);
}
int newState = LocalBluetoothProfileManager.getProfileManager(mLocalManager,
profile).convertState(newProfileState);
final LocalBluetoothProfileManager pm =
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
if (pm == null) return;
int newState = pm.convertState(newProfileState);
if (newState == SettingsBtStatus.CONNECTION_STATUS_CONNECTED) {
if (!mProfiles.contains(profile)) {