Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9107e37b authored by Matthew Xie's avatar Matthew Xie
Browse files

Get rid of the extra bt_disable call when turning on airplane mode

Get rid of enabling bt when in airplane mode.

Current code has 2 paths that trying to place bluetooth in cold state when
turning airplane mode on. This caused extra call of bt_disable that
causing a kernel sleep failure. The fix removes one of the sys call.
This CL keeps Bluetooth in cold state after turning airplane mode on
instead of seting it to hotoff state
bug 6563480

Change-Id: I30c413707157acb4a8e83ded9452256cf6260899
parent c4b0d098
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -467,7 +467,8 @@ final class BluetoothAdapterStateMachine extends StateMachine {
                            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 @@ final class BluetoothAdapterStateMachine extends StateMachine {
                        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 @@ final class BluetoothAdapterStateMachine extends StateMachine {
                    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);