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

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

Merge "Add missing permission enforcement." into sc-dev

parents b84e5cda a4015ce6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -543,6 +543,9 @@ public abstract class PermissionControllerService extends Service {
            public void updateUserSensitiveForApp(int uid, @NonNull AndroidFuture callback) {
                Preconditions.checkNotNull(callback, "callback cannot be null");

                enforceSomePermissionsGrantedToCaller(
                        Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY);

                try {
                    onUpdateUserSensitivePermissionFlags(uid, () -> callback.complete(null));
                } catch (Exception e) {
@@ -609,9 +612,7 @@ public abstract class PermissionControllerService extends Service {
                try {
                    Objects.requireNonNull(permissionGroupName);
                    Objects.requireNonNull(callback);
                    PermissionControllerService
                            .this
                            .onGetGroupOfPlatformPermission(
                    PermissionControllerService.this.onGetGroupOfPlatformPermission(
                            permissionGroupName, callback::complete);
                } catch (Throwable t) {
                    callback.completeExceptionally(t);