Refactor BackupManagerService activation logic
This change refactors parts of BackupManagerService, primarily focusing on the logic that determines whether backup is active for a given user. This serves as preparation for future changes. Key modifications include: - Introduced a new helper method `isDefaultBackupActiveUser(int userId)` to encapsulate the logic determining if a user's backup is initially set to active. - Refactored the `isBackupActivatedForUser(int userId)` method to improve clarity and structure. - Updated `activateBackupForUserLocked` and `deactivateBackupForUserLocked` to utilize the new `isDefaultBackupActiveUser` helper method. - Updated `BackupManagerServiceTest` to mock the static call to `UserManager.isHeadlessSystemUserMode()` introduced by the refactoring. - Replaced `mStateLock` with `mLock`. - Added `@UserIdInt` annotations to `userId` parameters in numerous methods for improved code clarity and type safety. Test: Existing tests in BackupManagerServiceTest updated and pass. Bug: 374830726 Bug: 406114361 Flag: EXEMPT refactoring Change-Id: If8134514a1b7e7c148c421e4dc96eb6d6e31c26e
Loading
Please register or sign in to comment