summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author James Willcox <jwillcox@google.com> 2024-02-29 02:59:20 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-02-29 02:59:20 +0000
commit4f65a775777fb41d29fbbd4e4fd17531bf3f34a6 (patch)
tree9eaee5c4aafff64e3206f8586d7d9fcdcf006542
parent43f3a1cf51a5fd68ce660a9938f6e2e8698ef816 (diff)
parentbfeee870f146a01f15404913cb6e4dca0a8b6088 (diff)
Merge "Fallback to default holder for WALLET role" into main
-rw-r--r--PermissionController/role-controller/java/com/android/role/controller/behavior/WalletRoleBehavior.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/PermissionController/role-controller/java/com/android/role/controller/behavior/WalletRoleBehavior.java b/PermissionController/role-controller/java/com/android/role/controller/behavior/WalletRoleBehavior.java
index 0e1447598..855012cf1 100644
--- a/PermissionController/role-controller/java/com/android/role/controller/behavior/WalletRoleBehavior.java
+++ b/PermissionController/role-controller/java/com/android/role/controller/behavior/WalletRoleBehavior.java
@@ -40,6 +40,7 @@ import androidx.annotation.RequiresApi;
import com.android.modules.utils.build.SdkLevel;
import com.android.role.controller.model.Role;
import com.android.role.controller.model.RoleBehavior;
+import com.android.role.controller.util.CollectionUtils;
import com.android.role.controller.util.UserUtils;
import org.xmlpull.v1.XmlPullParserException;
@@ -81,6 +82,13 @@ public class WalletRoleBehavior implements RoleBehavior {
@Nullable
@Override
+ public String getFallbackHolderAsUser(@NonNull Role role, @NonNull UserHandle user,
+ @NonNull Context context) {
+ return CollectionUtils.firstOrNull(role.getDefaultHoldersAsUser(user, context));
+ }
+
+ @Nullable
+ @Override
public Boolean isPackageQualifiedAsUser(@NonNull Role role, @NonNull String packageName,
@NonNull UserHandle user, @NonNull Context context) {
return !getQualifyingPackageNamesInternal(packageName, user, context).isEmpty();