diff options
author | 2024-01-10 20:13:26 +0000 | |
---|---|---|
committer | 2024-01-19 17:55:37 +0000 | |
commit | 645eda6c3ad5cdf3816871b9f6cb95fd18f7b3b1 (patch) | |
tree | 3f780feb72502291ac134fa82d81932aa3377256 | |
parent | 8008d8e1b336db2432ec4ce28a60014cffb83da0 (diff) |
Add Wallet Role to supported types
in role service and add a getter for
the holder.
Test: manual
Bug: 291794775
Change-Id: I933aecfc8e615157555cf260af3cc10fe29345aa
-rw-r--r-- | service/java/com/android/role/RoleService.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/service/java/com/android/role/RoleService.java b/service/java/com/android/role/RoleService.java index 2524627eb..a2a6bab35 100644 --- a/service/java/com/android/role/RoleService.java +++ b/service/java/com/android/role/RoleService.java @@ -100,15 +100,22 @@ public class RoleService extends SystemService implements RoleUserState.Callback private static final long GRANT_DEFAULT_ROLES_INTERVAL_MILLIS = 1000; - private static final String[] DEFAULT_APPLICATION_ROLES = { - RoleManager.ROLE_ASSISTANT, - RoleManager.ROLE_BROWSER, - RoleManager.ROLE_CALL_REDIRECTION, - RoleManager.ROLE_CALL_SCREENING, - RoleManager.ROLE_DIALER, - RoleManager.ROLE_HOME, - RoleManager.ROLE_SMS, - }; + private static final String[] DEFAULT_APPLICATION_ROLES; + + static { + List<String> defaultApplicationRoles = new ArrayList<>(); + defaultApplicationRoles.add(RoleManager.ROLE_ASSISTANT); + defaultApplicationRoles.add(RoleManager.ROLE_BROWSER); + defaultApplicationRoles.add(RoleManager.ROLE_CALL_REDIRECTION); + defaultApplicationRoles.add(RoleManager.ROLE_CALL_SCREENING); + defaultApplicationRoles.add(RoleManager.ROLE_DIALER); + defaultApplicationRoles.add(RoleManager.ROLE_HOME); + defaultApplicationRoles.add(RoleManager.ROLE_SMS); + if (SdkLevel.isAtLeastV()) { + defaultApplicationRoles.add(RoleManager.ROLE_WALLET); + } + DEFAULT_APPLICATION_ROLES = defaultApplicationRoles.toArray(new String[0]); + } @NonNull private final AppOpsManager mAppOpsManager; |