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

Commit 0b697a65 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes from topic "mainline_b3_m" am: 83a4c969

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1913016

Change-Id: I0bb29c9ff91eff4139aa30c099cdb7b22e07ca57
parents 6cb6d070 83a4c969
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class AdapterService extends Service {

    public static final String BLUETOOTH_PRIVILEGED =
            android.Manifest.permission.BLUETOOTH_PRIVILEGED;
    static final String BLUETOOTH_PERM = android.Manifest.permission.BLUETOOTH;
    static final String LOCAL_MAC_ADDRESS_PERM = android.Manifest.permission.LOCAL_MAC_ADDRESS;
    static final String RECEIVE_MAP_PERM = android.Manifest.permission.RECEIVE_BLUETOOTH_MAP;

+20 −2
Original line number Diff line number Diff line
@@ -178,9 +178,27 @@ final class RemoteDevices {
            sSdpTracker.clear();
        }

        synchronized (mDevices) {
            if (mDevices != null) {
                debugLog("reset(): Broadcasting ACL_DISCONNECTED");

                mDevices.forEach((address, deviceProperties) -> {
                    BluetoothDevice bluetoothDevice = deviceProperties.getDevice();

                    debugLog("reset(): address=" + address + ", connected="
                            + bluetoothDevice.isConnected());

                    if (bluetoothDevice.isConnected()) {
                        Intent intent = new Intent(BluetoothDevice.ACTION_ACL_DISCONNECTED);
                        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, bluetoothDevice);
                        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
                        sAdapterService.sendBroadcast(intent, AdapterService.BLUETOOTH_PERM);
                    }
                });
                mDevices.clear();
            }
        }

        if (mDualDevicesMap != null) {
            mDualDevicesMap.clear();