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

Commit 42ef52c2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HeadsetService: extend check to allow dual app"

parents c0fee617 851d7e0d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ public final class Utils {
        return false;
    }

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

@@ -637,7 +637,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
@@ -479,7 +479,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;