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