Loading services/core/java/com/android/server/pm/ApexManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,14 @@ public abstract class ApexManager { */ public abstract boolean destroyDeSnapshots(int rollbackId); /** * Deletes snapshots of the credential encrypted apex data directories for the specified user, * where the rollback id is not included in {@code retainRollbackIds}. * * @return boolean true if the delete was successful */ public abstract boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds); /** * Dumps various state information to the provided {@link PrintWriter} object. * Loading Loading @@ -745,6 +753,17 @@ public abstract class ApexManager { } } @Override public boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds) { try { mApexService.destroyCeSnapshotsNotSpecified(userId, retainRollbackIds); return true; } catch (Exception e) { Slog.e(TAG, e.getMessage(), e); return false; } } /** * Dump information about the packages contained in a particular cache * @param packagesCache the cache to print information about. Loading Loading @@ -962,6 +981,11 @@ public abstract class ApexManager { throw new UnsupportedOperationException(); } @Override public boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds) { return true; } @Override void dump(PrintWriter pw, String packageName) { // No-op Loading services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.server.LocalServices; import com.android.server.PackageWatchdog; import com.android.server.SystemConfig; import com.android.server.Watchdog; import com.android.server.pm.ApexManager; import com.android.server.pm.Installer; import java.io.File; Loading Loading @@ -485,6 +486,8 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub { } latch.countDown(); destroyCeSnapshotsForExpiredRollbacks(userId); }); try { Loading @@ -494,6 +497,15 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub { } } @WorkerThread private void destroyCeSnapshotsForExpiredRollbacks(int userId) { int[] rollbackIds = new int[mRollbacks.size()]; for (int i = 0; i < rollbackIds.length; i++) { rollbackIds[i] = mRollbacks.get(i).info.getRollbackId(); } ApexManager.getInstance().destroyCeSnapshotsNotSpecified(userId, rollbackIds); } @WorkerThread private void updateRollbackLifetimeDurationInMillis() { mRollbackLifetimeDurationInMillis = DeviceConfig.getLong( Loading Loading
services/core/java/com/android/server/pm/ApexManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -300,6 +300,14 @@ public abstract class ApexManager { */ public abstract boolean destroyDeSnapshots(int rollbackId); /** * Deletes snapshots of the credential encrypted apex data directories for the specified user, * where the rollback id is not included in {@code retainRollbackIds}. * * @return boolean true if the delete was successful */ public abstract boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds); /** * Dumps various state information to the provided {@link PrintWriter} object. * Loading Loading @@ -745,6 +753,17 @@ public abstract class ApexManager { } } @Override public boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds) { try { mApexService.destroyCeSnapshotsNotSpecified(userId, retainRollbackIds); return true; } catch (Exception e) { Slog.e(TAG, e.getMessage(), e); return false; } } /** * Dump information about the packages contained in a particular cache * @param packagesCache the cache to print information about. Loading Loading @@ -962,6 +981,11 @@ public abstract class ApexManager { throw new UnsupportedOperationException(); } @Override public boolean destroyCeSnapshotsNotSpecified(int userId, int[] retainRollbackIds) { return true; } @Override void dump(PrintWriter pw, String packageName) { // No-op Loading
services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.server.LocalServices; import com.android.server.PackageWatchdog; import com.android.server.SystemConfig; import com.android.server.Watchdog; import com.android.server.pm.ApexManager; import com.android.server.pm.Installer; import java.io.File; Loading Loading @@ -485,6 +486,8 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub { } latch.countDown(); destroyCeSnapshotsForExpiredRollbacks(userId); }); try { Loading @@ -494,6 +497,15 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub { } } @WorkerThread private void destroyCeSnapshotsForExpiredRollbacks(int userId) { int[] rollbackIds = new int[mRollbacks.size()]; for (int i = 0; i < rollbackIds.length; i++) { rollbackIds[i] = mRollbacks.get(i).info.getRollbackId(); } ApexManager.getInstance().destroyCeSnapshotsNotSpecified(userId, rollbackIds); } @WorkerThread private void updateRollbackLifetimeDurationInMillis() { mRollbackLifetimeDurationInMillis = DeviceConfig.getLong( Loading