am 691976fa: am 29775794: Merge "Get rid of the extra bt_disable call when turning on airplane mode Get rid of enabling bt when in airplane mode." into jb-dev
* commit '691976fae6ff7ef925e411e9e7b273d2623072bf':
Get rid of the extra bt_disable call when turning on airplane mode Get rid of enabling bt when in airplane mode.
diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java
index 2a994b2..1de1839 100644
--- a/core/java/android/server/BluetoothAdapterStateMachine.java
+++ b/core/java/android/server/BluetoothAdapterStateMachine.java
@@ -467,7 +467,8 @@
mBluetoothService.cleanupAfterFinishDisable();
deferMessage(obtainMessage(TURN_COLD));
if (mContext.getResources().getBoolean
- (com.android.internal.R.bool.config_bluetooth_adapter_quick_switch)) {
+ (com.android.internal.R.bool.config_bluetooth_adapter_quick_switch) &&
+ !mBluetoothService.isAirplaneModeOn()) {
deferMessage(obtainMessage(TURN_HOT));
mDelayBroadcastStateOff = true;
}
@@ -564,11 +565,9 @@
sendMessageDelayed(TURN_OFF_TIMEOUT, TURN_OFF_TIMEOUT_TIME);
}
- // we turn all the way to PowerOff with AIRPLANE_MODE_ON
if (message.what == AIRPLANE_MODE_ON || mBluetoothService.isAirplaneModeOn()) {
// We inform all the per process callbacks
allProcessesCallback(false);
- deferMessage(obtainMessage(AIRPLANE_MODE_ON));
}
break;
case AIRPLANE_MODE_OFF:
@@ -707,8 +706,6 @@
mBluetoothService.switchConnectable(false);
sendMessageDelayed(TURN_OFF_TIMEOUT, TURN_OFF_TIMEOUT_TIME);
allProcessesCallback(false);
- // we turn all the way to PowerOff with AIRPLANE_MODE_ON
- deferMessage(obtainMessage(AIRPLANE_MODE_ON));
break;
case USER_TURN_OFF:
Log.w(TAG, "PerProcessState received: " + message.what);