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
This commit is contained in:
Michael Chan
2009-03-30 09:40:42 -07:00
committed by The Android Open Source Project
parent fc26ed791e
commit 1739bfb333

View File

@@ -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) {