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

Unverified Commit 28816d01 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 f248492d
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -326,8 +326,7 @@ public class BackupManagerService extends IBackupManager.Stub implements BackupM
     * 1. Global suppression: If a suppression file exists for the system user
     *    {@code UserHandle.USER_SYSTEM}, backup is disabled for all users.
     * 2. User-specific suppression: Check if a suppression file exists for the specified user.
     * 3. Default user activation: Check if the user's backup is initially set to active.
     * 4. Explicit activation file: Check if an activation file exists for the user.
     * Otherwise, it is activated for all users.
     */
    private boolean isBackupActivatedForUser(@UserIdInt int userId) {
        // 1. Global suppression.
@@ -340,15 +339,9 @@ public class BackupManagerService extends IBackupManager.Stub implements BackupM
            return false;
        }

        // 3. Default user activation.
        if (isDefaultBackupActiveUser(userId)) {
        return true;
    }

        // 4. Explicit activation file.
        return getActivatedFileForUser(userId).exists();
    }

    /** Determines the default activation state for backup for the specified user ID. */
    @SuppressWarnings("AndroidFrameworkRequiresPermission")
    private boolean isDefaultBackupActiveUser(@UserIdInt int userId) {