summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Richard MacGregor <rmacgregor@google.com> 2025-03-03 09:39:18 -0800
committer Richard MacGregor <rmacgregor@google.com> 2025-03-03 09:39:18 -0800
commit6ae668e15ab0a7ef7be801baf7039084ff2e57b7 (patch)
tree9c18b8d00512d0c6f45cf9470e83c5b6ec690c24
parent47e5e0643a0235d3eea66a71220154364758ce14 (diff)
Add Role names to role exclusivity error messages
Bug: 396225382 Flag: EXEMPT log only update Relnote: N/A Test: build Change-Id: I753e7452e05effbbc8aeae2bda62c7ca659f3cb4
-rw-r--r--PermissionController/role-controller/java/com/android/role/controller/model/Role.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/PermissionController/role-controller/java/com/android/role/controller/model/Role.java b/PermissionController/role-controller/java/com/android/role/controller/model/Role.java
index 0f79b19c0..0c2d51c80 100644
--- a/PermissionController/role-controller/java/com/android/role/controller/model/Role.java
+++ b/PermissionController/role-controller/java/com/android/role/controller/model/Role.java
@@ -340,15 +340,19 @@ public class Role {
Integer exclusivity = mBehavior.getExclusivity();
if (exclusivity != null) {
if (!sExclusivityValues.get(exclusivity)) {
- throw new IllegalArgumentException("Invalid exclusivity: " + exclusivity);
+ throw new IllegalArgumentException(
+ "Role " + mName + " has invalid exclusivity: "
+ + exclusivity);
}
if (mShowNone && exclusivity == EXCLUSIVITY_NONE) {
throw new IllegalArgumentException(
- "Role cannot be non-exclusive when showNone is true: " + exclusivity);
+ "Role " + mName + " cannot be non-exclusive when showNone is true: "
+ + exclusivity);
}
if (!mPreferredActivities.isEmpty() && exclusivity == EXCLUSIVITY_PROFILE_GROUP) {
throw new IllegalArgumentException(
- "Role cannot have preferred activities when exclusivity is profileGroup");
+ "Role " + mName + " cannot have preferred activities when exclusivity is "
+ + "profileGroup");
}
return exclusivity;
}