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

Commit 21e1b8d7 authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Android (Google) Code Review
Browse files

Merge "HeadsetService: extend check to allow dual app" into tm-qpr-dev

parents b6c8f9e5 c5f3ad2d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -617,7 +617,7 @@ public final class Utils {
        return false;
    }

    public static boolean checkCallerIsSystemOrActiveUser() {
    private static boolean checkCallerIsSystemOrActiveUser() {
        int callingUid = Binder.getCallingUid();
        UserHandle callingUser = UserHandle.getUserHandleForUid(callingUid);

@@ -638,7 +638,7 @@ public final class Utils {
        return checkCallerIsSystemOrActiveUser(tag + "." + method + "()");
    }

    public static boolean checkCallerIsSystemOrActiveOrManagedUser(Context context) {
    private static boolean checkCallerIsSystemOrActiveOrManagedUser(Context context) {
        if (context == null) {
            return checkCallerIsSystemOrActiveUser();
        }
+1 −1
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ public class HeadsetService extends ProfileService {

        @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
        private HeadsetService getService(AttributionSource source) {
            if (!Utils.checkCallerIsSystemOrActiveUser(TAG)
            if (!Utils.checkCallerIsSystemOrActiveOrManagedUser(mService, TAG)
                    || !Utils.checkServiceAvailable(mService, TAG)
                    || !Utils.checkConnectPermissionForDataDelivery(mService, source, TAG)) {
                return null;