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

Commit 30b022a8 authored by Eugene Susla's avatar Eugene Susla Committed by Sterling Huber
Browse files

RESTRICT AUTOMERGE

Fix CDM package check

CDM was using a pckage check that returns a value intead of throwing,
resulting in failing to throw on querying other package's associations

Test: ensure attached bug no longer reproduces
Bug: 167244818
Change-Id: I21319b6f5495dcae681541c76b847aad0c00b8ab
parent b7eef508
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -372,7 +372,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind

            checkArgument(getCallingUserId() == userId,
                    "Must be called by either same user or system");
            mAppOpsManager.checkPackage(Binder.getCallingUid(), pkg);
            int callingUid = Binder.getCallingUid();
            if (mAppOpsManager.checkPackage(callingUid, pkg) != AppOpsManager.MODE_ALLOWED) {
                throw new SecurityException(pkg + " doesn't belong to uid " + callingUid);
            }
        }

        @Override