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

Commit 079c8623 authored by Al Sutton's avatar Al Sutton Committed by Android (Google) Code Review
Browse files

Merge "Infer the activation state from the presence of a BackupManagerService."

parents 4788ff7d d222a617
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -194,6 +194,11 @@ public class BackupManagerService {
        }
    }

    boolean isAbleToServeUser(int userId) {
        return getServiceUsers().get(UserHandle.USER_SYSTEM) != null
                && getServiceUsers().get(userId) != null;
    }

    /**
     *  Returns a lst of users currently unlocked that have a
     *  {@link UserBackupManagerService} registered.
+3 −4
Original line number Diff line number Diff line
@@ -202,11 +202,10 @@ public class Trampoline extends IBackupManager.Stub {
        }
    }

    // A user is ready for a backup if it's unlocked and is not suppressed by a device
    // admin (device owner or profile owner).
    // This method should not perform any I/O (e.g. do not call isBackupActivatedForUser),
    // it's used in multiple places where I/O waits would cause system lock-ups.
    private boolean isUserReadyForBackup(int userId) {
        return mService != null && mService.getServiceUsers().get(userId) != null
                && isBackupActivatedForUser(userId);
        return mService != null && mService.isAbleToServeUser(userId);
    }

    /**