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

Commit fe668cf2 authored by Hai Zhang's avatar Hai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in AppOpsService when calling getPackagesForUid()." into main

parents 65732901 7e4703cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2391,7 +2391,8 @@ public class AppOpsService extends IAppOpsService.Stub {
        long token = Binder.clearCallingIdentity();
        try {
            // Permissions are managed by UIDs, but unfortunately a package name is required in API.
            String packageName = ArrayUtils.firstOrNull(packageManager.getPackagesForUid(uid));
            String packageName = ArrayUtils.firstOrNull(ArrayUtils.defeatNullable(
                    packageManager.getPackagesForUid(uid)));
            if (packageName == null) {
                return false;
            }