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

Skip to content
Commit 5b17f4e5 authored by [CSarp Misoglu's avatar [CSarp Misoglu Committed by Sarp Misoglu
Browse files

Make B&R active for the main user in headless mode

In this CL we are introducing the concept of a 'default' backup user, for whom backup is activated by default. Basically, if there is a 'main' user on the device, it will be the default user. Otherwise it will be the system user. Note that the main user can be the system user (at least in theory). And if there is a main user that isn't the system user, backup will be deactivated for the system user.

Backup is deactivated by the main user by creating a 'suppress' file for it, just like it worked before for the system user.

There was a previous behavior where if backup was deactivated for the system user, it would be deactivated for every user. I think this was to allow DevicePolicyManager to disable all backups on the device. We maintain this behavior, so if `satBackupService(USER_SYSTEM)` is called, backup will be disabled for ALL users-- even the default user.

To properly test this, mocking a static method was required. This is only possible with extended Mockito, which is enabled in `mockingservicetests` so `BackupManagerServiceTest` is moved there. I also revamped most of the tests in there to be more concise and less... weird (there were a bunch of tests that didn't actually test anything).

Test: BackupManagerServiceTest
Bug: 259850130
Change-Id: Iec8b43d1e3560fe40b70bebfd37db1b2e5b0f9ca
parent 77cbd50b
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