AI 143628: am: CL 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.
  Original author: chanm
  Merged from: //branches/donutburger/...

Automated import of CL 143628
This commit is contained in:
Michael Chan
2009-03-31 13:55:18 -07:00
committed by The Android Open Source Project
parent d21d6e8762
commit 7ddcb36b52

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