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

Commit b8d24442 authored by Martijn Coenen's avatar Martijn Coenen Committed by Android (Google) Code Review
Browse files

Merge "Add StorageManager checkpoint APIs."

parents d55e1b17 f04aca4f
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -191,4 +191,6 @@ interface IStorageManager {
    String translateAppToSystem(String path, int pid, int uid) = 81;
    String translateAppToSystem(String path, int pid, int uid) = 81;
    String translateSystemToApp(String path, int pid, int uid) = 82;
    String translateSystemToApp(String path, int pid, int uid) = 82;
    void commitChanges() = 83;
    void commitChanges() = 83;
    boolean supportsCheckpoint() = 84;
    void startCheckpoint(int numTries) = 85;
}
}
+32 −0
Original line number Original line Diff line number Diff line
@@ -2716,6 +2716,38 @@ class StorageManagerService extends IStorageManager.Stub
        }
        }
    }
    }


    /**
     * Check whether the device supports filesystem checkpointing.
     *
     * @return true if the device supports filesystem checkpointing, false otherwise.
     */
    @Override
    public boolean supportsCheckpoint() 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 filesystem checkpoint support");
        }

        return mVold.supportsCheckpoint();
    }

    /**
     * Signal that checkpointing partitions should start a checkpoint on the next boot.
     *
     * @param numTries Number of times to try booting in checkpoint mode, before we will boot
     *                 non-checkpoint mode and commit all changes immediately. Callers are
     *                 responsible for ensuring that boot is safe (eg, by rolling back updates).
     */
    @Override
    public void startCheckpoint(int numTries) 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 start filesystem checkpoint");
        }

        mVold.startCheckpoint(numTries);
    }

    /**
    /**
     * Signal that checkpointing partitions should commit changes
     * Signal that checkpointing partitions should commit changes
     */
     */