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

Commit ecd677ad authored by Kweku Adams's avatar Kweku Adams
Browse files

Avoid passing in null String.

IAppOpsCallback.opChanged can be passed in a null value for the package
name. Avoid calling synchronizePackagePermissionsAndAppOpsAsyncForUser
when that happens since it expects a NonNull value.

Bug: 247127880
Test: N/A
Change-Id: I532289e116b4d7b884fac7e1358120e98fecf342
parent 0cea16dc
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -223,9 +223,11 @@ public final class PermissionPolicyService extends SystemService {
                this::synchronizePackagePermissionsAndAppOpsAsyncForUser);

        mAppOpsCallback = new IAppOpsCallback.Stub() {
            public void opChanged(int op, int uid, String packageName) {
            public void opChanged(int op, int uid, @Nullable String packageName) {
                if (packageName != null) {
                    synchronizePackagePermissionsAndAppOpsAsyncForUser(packageName,
                            UserHandle.getUserId(uid));
                }
                resetAppOpPermissionsIfNotRequestedForUidAsync(uid);
            }
        };