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

Commit 5bc3c702 authored by Oliver Scott's avatar Oliver Scott Committed by Michael Bestas
Browse files

Enable backup service by default for all users

* Useful for work profiles and secondary users

cdesai: Port to 14
Issue: calyxos#1057
Change-Id: I3b2e1797c2e0d9e3af477f624c7d3ab613c2ea2c
parent c5148af6
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -319,14 +319,7 @@ public class BackupManagerService extends IBackupManager.Stub {
    /**
     * If there is a "suppress" file for the system user, backup is inactive for ALL users.
     *
     * Otherwise, the below logic applies:
     *
     * For the {@link #mDefaultBackupUserId}, backup is active by default. Backup is only
     * deactivated if there exists a "suppress" file for the user, which can be created by calling
     * {@link #setBackupServiceActive}.
     *
     * For non-main users, backup is only active if there exists an "activated" file for the user,
     * which can also be created by calling {@link #setBackupServiceActive}.
     * Otherwise, it is activated for all users.
     */
    private boolean isBackupActivatedForUser(int userId) {
        if (getSuppressFileForUser(UserHandle.USER_SYSTEM).exists()) {
@@ -341,11 +334,7 @@ public class BackupManagerService extends IBackupManager.Stub {
            return false;
        }

        if (isDefaultUser && getSuppressFileForUser(userId).exists()) {
            return false;
        }

        return isDefaultUser || getActivatedFileForUser(userId).exists();
        return true;
    }

    @VisibleForTesting