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

Commit 1328bc75 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "SystemServer: SatelliteMode bypass thread jump" into main am: abbd22ac am: 3514b958

parents 1dd84192 3514b958
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -459,16 +459,28 @@ class BluetoothManagerService {
        }

        if (currentState == STATE_ON) {
            sendDisableMsg(reason);
            mAdapterLock.readLock().lock();
            try {
                if (mAdapter != null) {
                    mEnable = false;
                    mEnableExternal = false;
                    addActiveLog(reason, false);
                    mAdapter.disable(mContext.getAttributionSource());
                }
            } catch (RemoteException e) {
                Log.e(TAG, "Unable to call disable", e);
            } finally {
                mAdapterLock.readLock().unlock();
            }
        } else if (currentState == STATE_BLE_ON) {
            // If currentState is BLE_ON make sure we trigger stopBle
            mAdapterLock.readLock().lock();
            try {
                if (mAdapter != null) {
                    addActiveLog(reason, false);
                    mAdapter.stopBle(mContext.getAttributionSource());
                    mEnable = false;
                    mEnableExternal = false;
                    addActiveLog(reason, false);
                    mAdapter.stopBle(mContext.getAttributionSource());
                }
            } catch (RemoteException e) {
                Log.e(TAG, "Unable to call stopBle", e);