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

Commit 59823323 authored by JW Wang's avatar JW Wang Committed by Android (Google) Code Review
Browse files

Merge changes Ib5e8027e,I1e5828b2

* changes:
  Remove unused locks (2/n)
  Fix up the threading model (1/n)
parents 6cc03c6d 8164d247
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.rollback.PackageRollbackInfo.RestoreInfo;
import android.os.storage.StorageManager;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.pm.ApexManager;
import com.android.server.pm.Installer;
@@ -59,8 +58,6 @@ public class AppDataRollbackHelper {
     * {@code userIds}. Updates said {@code packageRollbackInfo} with the inodes of the CE user data
     * snapshot folders.
     */
    @GuardedBy("rollback.mLock")
    // TODO(b/136241838): Move into Rollback and synchronize there.
    public void snapshotAppData(
            int rollbackId, PackageRollbackInfo packageRollbackInfo, int[] userIds) {
        for (int user : userIds) {
@@ -87,8 +84,6 @@ public class AppDataRollbackHelper {
     *         to {@code packageRollbackInfo} are restricted to the removal or addition of {@code
     *         userId} to the list of pending backups or restores.
     */
    @GuardedBy("rollback.mLock")
    // TODO(b/136241838): Move into Rollback and synchronize there.
    public boolean restoreAppData(int rollbackId, PackageRollbackInfo packageRollbackInfo,
            int userId, int appId, String seInfo) {
        int storageFlags = Installer.FLAG_STORAGE_DE;
@@ -191,8 +186,6 @@ public class AppDataRollbackHelper {
     * Deletes an app data snapshot with a given {@code rollbackId} for a specified package
     * {@code packageName} for a given {@code user}.
     */
    @GuardedBy("rollback.mLock")
    // TODO(b/136241838): Move into Rollback and synchronize there.
    public void destroyAppDataSnapshot(int rollbackId, PackageRollbackInfo packageRollbackInfo,
            int user) {
        try {
@@ -219,7 +212,6 @@ public class AppDataRollbackHelper {
     *
     * @return true if any backups or restores were found for the userId
     */
    @GuardedBy("rollback.mLock")
    boolean commitPendingBackupAndRestoreForUser(int userId, Rollback rollback) {
        boolean foundBackupOrRestore = false;
        for (PackageRollbackInfo info : rollback.info.getPackages()) {
+361 −334

File changed.

Preview size limit exceeded, changes collapsed.

+0 −2
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.os.UserHandle;
import android.util.Slog;
import android.util.SparseIntArray;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;

import libcore.io.IoUtils;
@@ -259,7 +258,6 @@ class RollbackStore {
    /**
     * Saves the given rollback to persistent storage.
     */
    @GuardedBy("rollback.mLock")
    static void saveRollback(Rollback rollback) {
        try {
            JSONObject dataJson = new JSONObject();