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

Commit 5d0c9cb3 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Delete expired CE snapshots of app data when user unlocks." into...

Merge "Merge "Delete expired CE snapshots of app data when user unlocks." into rvc-dev am: 70e8f5d5 am: 4479c751" into rvc-d1-dev-plus-aosp
parents 29b88ae1 d796a7ba
Loading
Loading
Loading
Loading
+24 −0
Original line number Original line Diff line number Diff line
@@ -723,6 +723,30 @@ public class Installer extends SystemService {
        }
        }
    }
    }


    /**
     * Deletes all snapshots of credential encrypted user data, where the snapshot id is not
     * included in {@code retainSnapshotIds}.
     *
     * @param userId id of the user whose user data snapshots to delete.
     * @param retainSnapshotIds ids of the snapshots that should not be deleted.
     *
     * @return {@code true} if the operation was successful, or {@code false} if a remote call
     * shouldn't be continued. See {@link #checkBeforeRemote}.
     *
     * @throws InstallerException if failed to delete user data snapshot.
     */
    public boolean destroyCeSnapshotsNotSpecified(@UserIdInt int userId,
            int[] retainSnapshotIds) throws InstallerException {
        if (!checkBeforeRemote()) return false;

        try {
            mInstalld.destroyCeSnapshotsNotSpecified(null, userId, retainSnapshotIds);
            return true;
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
    }

    /**
    /**
     * Migrates obb data from its legacy location {@code /data/media/obb} to
     * Migrates obb data from its legacy location {@code /data/media/obb} to
     * {@code /data/media/0/Android/obb}. This call is idempotent and a fast no-op if data has
     * {@code /data/media/0/Android/obb}. This call is idempotent and a fast no-op if data has
+5 −0
Original line number Original line Diff line number Diff line
@@ -505,6 +505,11 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub {
            rollbackIds[i] = mRollbacks.get(i).info.getRollbackId();
            rollbackIds[i] = mRollbacks.get(i).info.getRollbackId();
        }
        }
        ApexManager.getInstance().destroyCeSnapshotsNotSpecified(userId, rollbackIds);
        ApexManager.getInstance().destroyCeSnapshotsNotSpecified(userId, rollbackIds);
        try {
            mInstaller.destroyCeSnapshotsNotSpecified(userId, rollbackIds);
        } catch (Installer.InstallerException ie) {
            Slog.e(TAG, "Failed to delete snapshots for user: " + userId, ie);
        }
    }
    }


    @WorkerThread
    @WorkerThread