Skip to content
Commit 523c949d authored by Annie Meng's avatar Annie Meng
Browse files

[Multi-user] Clean up backup service creation and disable

Part of prep to make BMS multi-user aware.

Current disable logic:
- Trampoline is a proxy to BMS that enforces system- and policy-imposed
disabling of the backup service (user-configurable disabling is in BMS).
- Backup service can be disabled by system property = permanent disable.
- Backup service can be disabled by a privileged caller like Device
Policy Manager = temporary disable.

In multi-user context:
- The system user is the main actor in creation and disabling of the
backup service.
- BMS is only created when the system user is unlocked -> system user
will always be unlocked first and is always running.
- Device Policy Manager acts on the system user and shuts down backup
mechanism for the whole device -> disable for system user disables for
all users.
- Non-system users have no impact on the creation/disabling of the
backup service.

This CL:
- Clean up and document the above logic.
- Move synchronization on backup suppress file from 'this' to private
lock.

Bug: 118520567
Test: 1) atest TrampolineTest
2) atest DevicePolicyManagerTest
3) Manual:
- Before unlocking system user > service not started
- Unlock system user > service started

Change-Id: I207858bcfd1e0b9de43291bec178066b59c3a7cb
parent 7eeac900
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment