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

Commit e3a924d2 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

Add needsCheckpoint

Test: Call needsCheckpoint on java side
Change-Id: If991c5b7902c811943d03412d80cebef9e2eb001
parent 137aed14
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -193,4 +193,5 @@ interface IStorageManager {
    void commitChanges() = 83;
    boolean supportsCheckpoint() = 84;
    void startCheckpoint(int numTries) = 85;
    boolean needsCheckpoint() = 86;
}
+13 −0
Original line number Diff line number Diff line
@@ -2881,6 +2881,19 @@ class StorageManagerService extends IStorageManager.Stub
        mVold.commitChanges();
    }

    /**
     * Check if we should be mounting with checkpointing or are checkpointing now
     */
    @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");
        }

        return mVold.needsCheckpoint();
    }

    @Override
    public String getPassword() throws RemoteException {
        mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER,