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

Commit 8c10173c authored by Satoshi Niwa's avatar Satoshi Niwa
Browse files

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
parent 215b9458
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment