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

Commit 2b27f321 authored by Roopa Sattiraju's avatar Roopa Sattiraju Committed by Android (Google) Code Review
Browse files

Merge "Changing params for SendBroadcastMultiplePermissions as per the API change"

parents 5b2935e9 c6ffc79a
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -984,7 +984,17 @@ public final class Utils {
        return 1 == context.getContentResolver().update(uri, values, null, null);
    }

    /**
     * Returns bundled broadcast options.
     */
    public static @NonNull Bundle getTempAllowlistBroadcastOptions() {
        return getTempBroadcastOptions().toBundle();
    }

    /**
     * Returns broadcast options.
     */
    public static @NonNull BroadcastOptions getTempBroadcastOptions() {
        // Use the Bluetooth process identity to pass permission check when reading DeviceConfig
        final long ident = Binder.clearCallingIdentity();
        final BroadcastOptions bOptions = BroadcastOptions.makeBasic();
@@ -997,9 +1007,8 @@ public final class Utils {
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
        return bOptions.toBundle();
        return bOptions;
    }

    /**
     * Checks that value is present as at least one of the elements of the array.
     * @param array the array to check in
+2 −2
Original line number Diff line number Diff line
@@ -714,11 +714,11 @@ final class RemoteDevices {
                if (pkg.getPermission() != null) {
                    sAdapterService.sendBroadcastMultiplePermissions(intent,
                            new String[] { BLUETOOTH_SCAN, pkg.getPermission() },
                            Utils.getTempAllowlistBroadcastOptions());
                            Utils.getTempBroadcastOptions());
                } else {
                    sAdapterService.sendBroadcastMultiplePermissions(intent,
                            new String[] { BLUETOOTH_SCAN },
                            Utils.getTempAllowlistBroadcastOptions());
                            Utils.getTempBroadcastOptions());
                }
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -1934,7 +1934,7 @@ public class HeadsetClientStateMachine extends StateMachine {

        mService.sendBroadcastMultiplePermissions(intent,
                new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED},
                Utils.getTempAllowlistBroadcastOptions());
                Utils.getTempBroadcastOptions());

        HfpClientConnectionService.onConnectionStateChanged(device, newState, prevState);
    }
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ class MceStateMachine extends StateMachine {
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        mService.sendBroadcastMultiplePermissions(intent,
                new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED},
                Utils.getTempAllowlistBroadcastOptions());
                Utils.getTempBroadcastOptions());
    }

    public synchronized int getState() {
+1 −1
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ final class PbapClientStateMachine extends StateMachine {
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        mService.sendBroadcastMultiplePermissions(intent,
                new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED},
                Utils.getTempAllowlistBroadcastOptions());
                Utils.getTempBroadcastOptions());
    }

    public void disconnect(BluetoothDevice device) {
Loading