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
Loading
Please register or sign in to comment