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

Commit 65b79f0b authored by Satoshi Niwa's avatar Satoshi Niwa
Browse files

Refactor BackupEligibilityRules to use UserManagerInternal

Replace the usage of the public UserManager API with UserManagerInternal within BackupEligibilityRules.

Calling UserManager.getMainUser() from the backup service context results in a SecurityException as it lacks the necessary QUERY_USERS permission.
This change resolves the crash by switching to the internal service, which bypasses permission checks for calls from within the system server.

This aligns with the standard practice for core system services interacting with user management and prevents permission-denial crashes.

Test: atest BackupEligibilityRulesTest
Test: com.google.android.gts.backup.BackupManagerTest
Bug: 421975240
Flag: EXEMPT bug fix
Change-Id: I43666d83dd0093d329892c52f38670dd47a35934
parent 1b827075
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