[Multi-user] Disable backup by default in non-system users
Key changes in this CL: - Backup is now disabled by default in non-system users unless DPM activates backup for this user AND the system user is activated. This provides gating for the multi-user B&R feature. - Activation is done via an 'activate' file that is per-user (but lives in the system user directory to account for locked users). - isBackupServiceActive() handles both locked and unlocked users. - Added a bmgr command to expose isBackupServiceActive() for testing purposes and enforce appropriate permissions. Future CLs: - Handle future migration to backup on by default for non-system users - Change CTS tests to use the new bmgr command Bug: 121306407 Test: 1) atest TrampolineTest 2) Start system user -> service started; run backup and restore successfully 3) Start non-system user -> ignored; 4) adb shell bmgr --user 0 activate true -> security exception; adb shell bmgr --user 10 activate true -> security exception (work profile); adb shell bmgr --user 11 activate true/false -> creates/deletes activate file and starts/stops the service Change-Id: Ic77db9b8b2e5170dcf89bef863dac4713730797a
Loading
Please register or sign in to comment