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

Commit 54326175 authored by Ram Periathiruvadi's avatar Ram Periathiruvadi Committed by android-build-merger
Browse files

Merge "Fix for Bluetooth not restarting on User Switch"

am: 196b72aa

Change-Id: Id0ef82b93b047f13683f7538740f0544549b0eca
parents 162d19f5 196b72aa
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1699,7 +1699,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                    mHandler.removeMessages(MESSAGE_USER_SWITCHED);
                    mHandler.removeMessages(MESSAGE_USER_SWITCHED);


                    /* disable and enable BT when detect a user switch */
                    /* disable and enable BT when detect a user switch */
                    if (mEnable && mBluetooth != null) {
                    if (mBluetooth != null && isEnabled()) {
                        try {
                        try {
                            mBluetoothLock.readLock().lock();
                            mBluetoothLock.readLock().lock();
                            if (mBluetooth != null) {
                            if (mBluetooth != null) {
@@ -1768,6 +1768,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                        mState = BluetoothAdapter.STATE_OFF;
                        mState = BluetoothAdapter.STATE_OFF;
                        // enable
                        // enable
                        addActiveLog(REASON_USER_SWITCH, true);
                        addActiveLog(REASON_USER_SWITCH, true);
                        // mEnable flag could have been reset on disableBLE. Reenable it.
                        mEnable = true;
                        handleEnable(mQuietEnable);
                        handleEnable(mQuietEnable);
                    } else if (mBinding || mBluetooth != null) {
                    } else if (mBinding || mBluetooth != null) {
                        Message userMsg = mHandler.obtainMessage(MESSAGE_USER_SWITCHED);
                        Message userMsg = mHandler.obtainMessage(MESSAGE_USER_SWITCHED);