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

Commit 99b718ce authored by Sanket Agarwal's avatar Sanket Agarwal Committed by android-build-merger
Browse files

While turning OFF do not honor ON requests. am: 292415fd

am: 87af41cb

* commit '87af41cb':
  While turning OFF do not honor ON requests.

Change-Id: Iaa3ff49bcb42e844eb76c919a80d8b3e0017c35c
parents d4d1e9b8 87af41cb
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -613,7 +613,20 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                                                "Need BLUETOOTH ADMIN permission");
        if (DBG) {
            Slog.d(TAG,"enable():  mBluetooth =" + mBluetooth +
                    " mBinding = " + mBinding);
                    " mBinding = " + mBinding + " mState = " + mState);
        }
        // We do not honor ON requests when the adapter is already turned ON or in the process of
        // turning ON.
        // As a protective mechanism to make sure that the native stack gets cleaned up properly
        // before turning it back ON we ignore requests while the bluetooth is turning OFF.
        // Bug: b/28318203
        if (mState == BluetoothAdapter.STATE_BLE_TURNING_OFF ||
            mState == BluetoothAdapter.STATE_TURNING_OFF ||
            mState == BluetoothAdapter.STATE_ON ||
            mState == BluetoothAdapter.STATE_BLE_ON ||
            mState == BluetoothAdapter.STATE_TURNING_ON ||
            mState == BluetoothAdapter.STATE_BLE_TURNING_ON) {
            return false;
        }

        synchronized(mReceiver) {