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

Commit a82f21a6 authored by sunxiang's avatar sunxiang
Browse files

[Bluetooth][BugFix]:Fix Bluetooth unable to enable



MIUI-5324

Test apk test Bluetooth enable and disable, In rare scenarios,mBluetooth not set to null,and when apk enable Bluetooth, it will send MESSAGE_RESTART_BLUETOOTH_SERVICE
Continuously and unable to enable BT

solution: when enable BT and Reach maximum retry to restart Bluetooth, set mBluetooth null, it can enble BT successfully

Signed-off-by: default avatarsunxiang <sunxiang@xiaomi.com>
Change-Id: Ic88886042fa550825e30196c37f36c61f7c2fb6b
parent bc73c58e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2533,6 +2533,9 @@ public class BluetoothManagerService extends IBluetoothManager.Stub {
                                mContext.getPackageName(), true);
                        handleEnable(mQuietEnable);
                    } else {
                        mBluetoothLock.writeLock().lock();
                        mBluetooth = null;
                        mBluetoothLock.writeLock().unlock();
                        Log.e(TAG, "Reach maximum retry to restart Bluetooth!");
                    }
                    break;