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

Commit 809f0990 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "SystemServer: SatelliteMode bypass thread jump" into main

parents 0a72614a 468a227d
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -459,16 +459,27 @@ class BluetoothManagerService {
        }

        if (currentState == STATE_ON) {
            sendDisableMsg(reason);
            mAdapterLock.readLock().lock();
            try {
                if (mAdapter != null) {
                    mEnable = 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);