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

Commit 2327239d authored by Adam Lesinski's avatar Adam Lesinski Committed by Gerrit Code Review
Browse files

Merge "Handle 'root' pseudo-package in the appops command"

parents 7caa8f14 3875bf6c
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -168,7 +168,12 @@ public class AppOpsCommand extends BaseCommand {
        final IPackageManager pm = ActivityThread.getPackageManager();
        final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
                ServiceManager.getService(Context.APP_OPS_SERVICE));
        final int uid = pm.getPackageUid(packageName, userId);
        final int uid;
        if ("root".equals(packageName)) {
            uid = 0;
        } else {
            uid = pm.getPackageUid(packageName, userId);
        }
        if (uid < 0) {
            System.err.println("Error: No UID for " + packageName + " in user " + userId);
            return;
@@ -211,7 +216,12 @@ public class AppOpsCommand extends BaseCommand {
        final IPackageManager pm = ActivityThread.getPackageManager();
        final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
                ServiceManager.getService(Context.APP_OPS_SERVICE));
        final int uid = pm.getPackageUid(packageName, userId);
        final int uid;
        if ("root".equals(packageName)) {
            uid = 0;
        } else {
            uid = pm.getPackageUid(packageName, userId);
        }
        if (uid < 0) {
            System.err.println("Error: No UID for " + packageName + " in user " + userId);
            return;