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

Commit 15a54465 authored by Paul Lawrence's avatar Paul Lawrence
Browse files

Fix idle maintenance wrt checkpoint check

By calling out to needsCheckpoint and supportsBlockCheckpoint, we
inadvertently added the need for system permission to idleMain.
Relax these permissions.

Test: sm idle-maint run fails without this change, passes with
Bug: 131680526
Change-Id: I3202ca5d818a90d72cce8cdb2c634b21ba308715
(cherry picked from commit eb4f12ca)
parent c2180f47
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -1063,11 +1063,7 @@ class StorageManagerService extends IStorageManager.Stub
    }

     private boolean supportsBlockCheckpoint() throws RemoteException {
        // Only the system process is permitted to start checkpoints
        if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) {
            throw new SecurityException("no permission to check block based checkpoint support");
        }

        enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
        return mVold.supportsBlockCheckpoint();
    }

@@ -2726,11 +2722,7 @@ class StorageManagerService extends IStorageManager.Stub
     */
    @Override
    public boolean needsCheckpoint() throws RemoteException {
        // Only the system process is permitted to commit checkpoints
        if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) {
            throw new SecurityException("no permission to commit checkpoint changes");
        }

        enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
        return mVold.needsCheckpoint();
    }