diff options
author | Michael Chan <> | 2009-03-30 09:40:42 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-30 09:40:42 -0700 |
commit | 1739bfb3336b64e645e8ed06d201e65fffccf9eb (patch) | |
tree | 6de71dcae3b6bf7e7099f0fdf6adc17f108bf2c9 /src/com/android/settings/bluetooth | |
parent | fc26ed791efb3bf9c7df2bfb4e9d555951912612 (diff) | |
download | packages_apps_settings-1739bfb3336b64e645e8ed06d201e65fffccf9eb.zip packages_apps_settings-1739bfb3336b64e645e8ed06d201e65fffccf9eb.tar.gz packages_apps_settings-1739bfb3336b64e645e8ed06d201e65fffccf9eb.tar.bz2 |
AI 143480: Fixed the problem where Settings would crash if you enable airplane mode, go
Home, go back to Wireless Settings. This only happens in emulator. Bluetooth
isn't supported in emulator but the crash was fixed so users can
enable/disable Airplane Mode.
BUG=1741119
Automated import of CL 143480
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r-- | src/com/android/settings/bluetooth/LocalBluetoothManager.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/settings/bluetooth/LocalBluetoothManager.java b/src/com/android/settings/bluetooth/LocalBluetoothManager.java index 1a848b2..273f797 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothManager.java @@ -199,9 +199,17 @@ public class LocalBluetoothManager { } private void syncBluetoothState() { - setBluetoothStateInt(mManager.isEnabled() - ? BluetoothDevice.BLUETOOTH_STATE_ON - : BluetoothDevice.BLUETOOTH_STATE_OFF); + int bluetoothState; + + if (mManager != null) { + bluetoothState = mManager.isEnabled() + ? BluetoothDevice.BLUETOOTH_STATE_ON + : BluetoothDevice.BLUETOOTH_STATE_OFF; + } else { + bluetoothState = BluetoothError.ERROR; + } + + setBluetoothStateInt(bluetoothState); } public void setBluetoothEnabled(boolean enabled) { |