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

Commit 23e03930 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add logcat for bad appop call"

parents 23c31f8e 8d3928b7
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -4562,8 +4562,9 @@ public class AppOpsService extends IAppOpsService.Stub {
        }
        if (pkgUid != Process.INVALID_UID) {
            if (pkgUid != UserHandle.getAppId(uid)) {
                //TODO 195339480: replace true with debug
                String otherUidMessage = true ? " but it is really " + pkgUid : " but it is not";
                Slog.e(TAG, "Bad call made by uid " + callingUid + ". "
                        + "Package \"" + packageName + "\" does not belong to uid " + uid + ".");
                String otherUidMessage = DEBUG ? " but it is really " + pkgUid : " but it is not";
                throw new SecurityException("Specified package \"" + packageName + "\" under uid "
                        +  UserHandle.getAppId(uid) + otherUidMessage);
            }
@@ -4619,8 +4620,9 @@ public class AppOpsService extends IAppOpsService.Stub {
        }

        if (pkgUid != uid) {
            //TODO 195339480: replace true with debug
            String otherUidMessage = true ? " but it is really " + pkgUid : " but it is not";
            Slog.e(TAG, "Bad call made by uid " + callingUid + ". "
                    + "Package \"" + packageName + "\" does not belong to uid " + uid + ".");
            String otherUidMessage = DEBUG ? " but it is really " + pkgUid : " but it is not";
            throw new SecurityException("Specified package \"" + packageName + "\" under uid " + uid
                    + otherUidMessage);
        }