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

Commit 80e30bf4 authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

Merge "BluetoothManagerService: continue teardown when BLE apps registered"...

Merge "BluetoothManagerService: continue teardown when BLE apps registered" am: 14bfa5e0 am: 22d5265f
am: 6af673dd01

Change-Id: Id01c3121207b0bdd07bfd4c8a0ebd179a2737ade
parents d3404659 22d5265f
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -641,6 +641,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
        if (appCount == 0 && mEnable) {
            disableBleScanMode();
        }
        if (appCount == 0 && !mEnableExternal) {
            sendBrEdrDownCallback();
        }
        return appCount;
    }

@@ -696,7 +699,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            return;
        }

        if (isBleAppPresent() == false) {
        if (isBleAppPresent()) {
            // Need to stay at BLE ON. Disconnect all Gatt connections
            try {
                mBluetoothGatt.unregAll();
            } catch (RemoteException e) {
                Slog.e(TAG, "Unable to disconnect all apps.", e);
            }
        } else {
            try {
                mBluetoothLock.readLock().lock();
                if (mBluetooth != null) mBluetooth.onBrEdrDown();
@@ -705,14 +715,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            } finally {
                mBluetoothLock.readLock().unlock();
            }
        } else {
            // Need to stay at BLE ON. Disconnect all Gatt connections
            try {
                mBluetoothGatt.unregAll();
            } catch (RemoteException e) {
                Slog.e(TAG, "Unable to disconnect all apps.", e);
            }
        }

    }

    public boolean enableNoAutoConnect(String packageName)