Merge "Fixed a Setting Bluetooth Airplane mode bug." into lmp-dev
diff --git a/src/com/android/settings/bluetooth/BluetoothEnabler.java b/src/com/android/settings/bluetooth/BluetoothEnabler.java
index 45f3d06..b006c65 100644
--- a/src/com/android/settings/bluetooth/BluetoothEnabler.java
+++ b/src/com/android/settings/bluetooth/BluetoothEnabler.java
@@ -90,12 +90,10 @@
}
public void setupSwitchBar() {
- mSwitchBar.addOnSwitchChangeListener(this);
mSwitchBar.show();
}
public void teardownSwitchBar() {
- mSwitchBar.removeOnSwitchChangeListener(this);
mSwitchBar.hide();
}
@@ -112,6 +110,7 @@
// Bluetooth state is not sticky, so set it manually
handleStateChanged(mLocalAdapter.getBluetoothState());
+ mSwitchBar.addOnSwitchChangeListener(this);
mContext.registerReceiver(mReceiver, mIntentFilter);
mValidListener = true;
}
@@ -121,6 +120,7 @@
return;
}
+ mSwitchBar.removeOnSwitchChangeListener(this);
mContext.unregisterReceiver(mReceiver);
mValidListener = false;
}