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

Commit 600799b8 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

Add Checkpoint's abortChanges

Test: Call abortChanges from the java side
Change-Id: I31690e0baa11b28fddcb5dd454a77067a60d2590
parent e3a924d2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -194,4 +194,5 @@ interface IStorageManager {
    boolean supportsCheckpoint() = 84;
    void startCheckpoint(int numTries) = 85;
    boolean needsCheckpoint() = 86;
    void abortChanges(in String message, boolean retry) = 87;
}
+13 −0
Original line number Diff line number Diff line
@@ -2894,6 +2894,19 @@ class StorageManagerService extends IStorageManager.Stub
        return mVold.needsCheckpoint();
    }

    /**
     * Abort the current set of changes and either try again, or abort entirely
     */
    @Override
    public void abortChanges(String message, boolean retry) throws RemoteException {
        // Only the system process is permitted to abort checkpoints
        if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) {
            throw new SecurityException("no permission to commit checkpoint changes");
        }

        mVold.abortChanges(message, retry);
    }

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