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