summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PermissionController/res/values/strings.xml56
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionGroup.java81
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java50
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/utils/Utils.java99
4 files changed, 226 insertions, 60 deletions
diff --git a/PermissionController/res/values/strings.xml b/PermissionController/res/values/strings.xml
index 94fb6f500..d0fcc7bb6 100644
--- a/PermissionController/res/values/strings.xml
+++ b/PermissionController/res/values/strings.xml
@@ -867,6 +867,60 @@ Allow <xliff:g id="app_name" example="Gmail">%4$s</xliff:g> to upload a bug repo
<!-- Message shown to the user when the apps requests permission from this group. Shows in the isolated storage case. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
<string name="permgrouprequest_storage_isolated">Allow
&lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access photos and media on your device?</string>
+
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_contacts">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access your contacts?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_location">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access this device\u2019s location?</string>
+ <!-- Subtitle of the message shown to the user when the apps requests permission to use the location only while app is in foreground [CHAR LIMIT=150]-->
+ <string name="permgrouprequestdetail_location">The app will only have access to the location while you\u2019re using the app</string>
+ <!-- Message shown to the user when the apps requests permission to use the location while app is in foreground and background. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgroupbackgroundrequest_location">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access this device\u2019s location?</string>
+ <!-- Subtitle of the message shown to the user when the apps requests permission to use the location while app is in foreground and background. Try to keep the link annotation at the end of the string [CHAR LIMIT=150] -->
+ <string name="permgroupbackgroundrequestdetail_location">This app may want to access your location all the time, even when you\u2019re not using the app. Allow in <annotation id="link">settings</annotation>.</string>
+ <!-- Message shown to the user when the apps requests permission to use the location while app is in foreground and background. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgroupupgraderequest_location">Change location access for &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b>?</string>
<!-- Subtitle of the message shown to the user when the apps requests permission to use the location while app is in foreground and background. Try to keep the link annotation at the end of the string [CHAR LIMIT=150] -->
- <string name="permgroupupgraderequestdeail_location">This wants to access your location all the time, even when you\u2019re not using the app. Allow in <annotation id="link">settings</annotation>.</string>
+ <string name="permgroupupgraderequestdetail_location">This app wants to access your location all the time, even when you\u2019re not using the app. Allow in <annotation id="link">settings</annotation>.</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_calendar">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access your calendar?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_sms">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to send and view SMS messages?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_storage">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access photos, media, and files on your device?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_microphone">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to record audio?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_activityRecognition">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access your physical activity?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_camera">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to take pictures and record video?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_calllog">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access your phone call logs?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_phone">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to make and manage phone calls?</string>
+
+ <!-- Message shown to the user when the apps requests permission from this group. If ever possible this should stay below 80 characters (assuming the parameters takes 20 characters). Don't abbreviate until the message reaches 120 characters though. [CHAR LIMIT=120] -->
+ <string name="permgrouprequest_sensors">Allow
+ &lt;b><xliff:g id="app_name" example="Gmail">%1$s</xliff:g>&lt;/b> to access sensor data about your vital signs?</string>
</resources>
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionGroup.java b/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionGroup.java
index e7a37194e..d3587d4a9 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionGroup.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/model/AppPermissionGroup.java
@@ -91,6 +91,8 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
private final @StringRes int mRequestDetail;
private final @StringRes int mBackgroundRequest;
private final @StringRes int mBackgroundRequestDetail;
+ private final @StringRes int mUpgradeRequest;
+ private final @StringRes int mUpgradeRequestDetail;
private final CharSequence mDescription;
private final ArrayMap<String, Permission> mPermissions = new ArrayMap<>();
private final String mIconPkg;
@@ -261,7 +263,8 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
groupInfo.packageName, groupLabel, fullGroupLabel,
loadGroupDescription(context, groupInfo, packageManager), getRequest(groupInfo),
getRequestDetail(groupInfo), getBackgroundRequest(groupInfo),
- getBackgroundRequestDetail(groupInfo), groupInfo.packageName, groupInfo.icon,
+ getBackgroundRequestDetail(groupInfo), getUpgradeRequest(groupInfo),
+ getUpgradeRequestDetail(groupInfo), groupInfo.packageName, groupInfo.icon,
userHandle, delayChanges, appOpsManager);
final Set<String> whitelistedRestrictedPermissions = context.getPackageManager()
@@ -370,6 +373,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
group.getLabel(), group.getFullLabel(), group.getDescription(),
group.getRequest(), group.getRequestDetail(),
group.getBackgroundRequest(), group.getBackgroundRequestDetail(),
+ group.getUpgradeRequest(), group.getUpgradeRequestDetail(),
group.getIconPkg(), group.getIconResId(), group.getUser(),
delayChanges, appOpsManager);
}
@@ -393,13 +397,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
}
private static @StringRes int getRequest(PackageItemInfo group) {
- if (group instanceof PermissionGroupInfo) {
- return ((PermissionGroupInfo) group).requestRes;
- } else if (group instanceof PermissionInfo) {
- return ((PermissionInfo) group).requestRes;
- } else {
- return 0;
- }
+ return Utils.getRequest(group.name);
}
private static CharSequence loadGroupDescription(Context context, PackageItemInfo group,
@@ -422,6 +420,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
String declaringPackage, CharSequence label, CharSequence fullLabel,
CharSequence description, @StringRes int request, @StringRes int requestDetail,
@StringRes int backgroundRequest, @StringRes int backgroundRequestDetail,
+ @StringRes int upgradeRequest, @StringRes int upgradeRequestDetail,
String iconPkg, int iconResId, UserHandle userHandle, boolean delayChanges,
@NonNull AppOpsManager appOpsManager) {
int targetSDK = packageInfo.applicationInfo.targetSdkVersion;
@@ -445,6 +444,8 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
mRequestDetail = requestDetail;
mBackgroundRequest = backgroundRequest;
mBackgroundRequestDetail = backgroundRequestDetail;
+ mUpgradeRequest = upgradeRequest;
+ mUpgradeRequestDetail = upgradeRequestDetail;
mDelayChanges = delayChanges;
if (iconResId != 0) {
mIconPkg = iconPkg;
@@ -572,11 +573,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
* @return the message or 0 if unset
*/
private static @StringRes int getRequestDetail(PackageItemInfo info) {
- if (info instanceof PermissionGroupInfo) {
- return ((PermissionGroupInfo) info).requestDetailResourceId;
- } else {
- return 0;
- }
+ return Utils.getRequestDetail(info.name);
}
/**
@@ -598,11 +595,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
* @return the message or 0 if unset
*/
private static @StringRes int getBackgroundRequest(PackageItemInfo info) {
- if (info instanceof PermissionGroupInfo) {
- return ((PermissionGroupInfo) info).backgroundRequestResourceId;
- } else {
- return 0;
- }
+ return Utils.getBackgroundRequest(info.name);
}
/**
@@ -624,11 +617,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
* @return the message or 0 if unset
*/
private static @StringRes int getBackgroundRequestDetail(PackageItemInfo info) {
- if (info instanceof PermissionGroupInfo) {
- return ((PermissionGroupInfo) info).backgroundRequestDetailResourceId;
- } else {
- return 0;
- }
+ return Utils.getBackgroundRequestDetail(info.name);
}
/**
@@ -641,6 +630,52 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup>
return mBackgroundRequestDetail;
}
+ /**
+ * Extract the title of the dialog explaining to the user that the permission, which was
+ * previously only granted for foreground, is granted while the app is in background and in
+ * foreground.
+ *
+ * @param info The package item info to extract the message from
+ *
+ * @return the message or 0 if unset
+ */
+ private static @StringRes int getUpgradeRequest(PackageItemInfo info) {
+ return Utils.getUpgradeRequest(info.name);
+ }
+
+ /**
+ * Get the title of the dialog explaining to the user that the permission, which was
+ * previously only granted for foreground, is granted while the app is in background and in
+ * foreground.
+ *
+ * @return the message or 0 if unset
+ */
+ public @StringRes int getUpgradeRequest() {
+ return mUpgradeRequest;
+ }
+
+ /**
+ * Extract the (subtitle) message explaining to the user that the she/he is about to allow the
+ * app to have background access while currently having foreground only.
+ *
+ * @param info The package item info to extract the message from
+ *
+ * @return the message or 0 if unset
+ */
+ private static @StringRes int getUpgradeRequestDetail(PackageItemInfo info) {
+ return Utils.getUpgradeRequestDetail(info.name);
+ }
+
+ /**
+ * Get the (subtitle) message explaining to the user that the she/he is about to allow the
+ * app to have background access while currently having foreground only.
+ *
+ * @return the message or 0 if unset
+ */
+ public @StringRes int getUpgradeRequestDetail() {
+ return mUpgradeRequestDetail;
+ }
+
public CharSequence getDescription() {
return mDescription;
}
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
index c8061e197..58f0d92fb 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
@@ -38,7 +38,6 @@ import static com.android.permissioncontroller.permission.ui.GrantPermissionsVie
import static com.android.permissioncontroller.permission.ui.GrantPermissionsViewHandler.GRANTED_ONE_TIME;
import static com.android.permissioncontroller.permission.utils.Utils.getRequestMessage;
-import android.Manifest;
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.admin.DevicePolicyManager;
@@ -699,7 +698,7 @@ public class GrantPermissionsActivity extends Activity
|| groupState.mGroup.isBackgroundGroup()) { // is tristate
if (needForegroundPermission && needBackgroundPermission) {
// Requests both background and foreground
- messageId = groupState.mGroup.getRequest();
+ messageId = groupState.mGroup.getBackgroundRequest();
detailMessageId = groupState.mGroup.getBackgroundRequestDetail();
mButtonVisibilities[VISIBILITY_ALLOW_BUTTON] = false;
mButtonVisibilities[VISIBILITY_ALLOW_FOREGROUND_BUTTON] = true;
@@ -718,8 +717,8 @@ public class GrantPermissionsActivity extends Activity
isForegroundPermissionUserSet;
} else if (needBackgroundPermission) {
// Upgrade from foreground to background
- messageId = groupState.mGroup.getBackgroundRequest();
- detailMessageId = groupState.mGroup.getBackgroundRequestDetail();
+ messageId = groupState.mGroup.getUpgradeRequest();
+ detailMessageId = groupState.mGroup.getUpgradeRequestDetail();
mButtonVisibilities[VISIBILITY_ALLOW_BUTTON] = false;
mButtonVisibilities[VISIBILITY_DENY_BUTTON] = false;
mButtonVisibilities[VISIBILITY_ALLOW_ONE_TIME_BUTTON] = false;
@@ -745,34 +744,23 @@ public class GrantPermissionsActivity extends Activity
Spanned detailMessage = null;
if (detailMessageId != 0) {
- try {
- detailMessage =
- new SpannableString(getPackageManager().getResourcesForApplication(
- groupState.mGroup.getDeclaringPackage()).getText(
- detailMessageId));
- if (Manifest.permission_group.LOCATION.equals(groupState.mGroup.getName())
- && needBackgroundPermission && !needForegroundPermission) {
- // TODO evanseverson: new requestDetail field to add in frameworks
- detailMessage = new SpannableString(
- getText(R.string.permgroupupgraderequestdeail_location));
- }
- Annotation[] annotations = detailMessage.getSpans(
- 0, detailMessage.length(), Annotation.class);
- int numAnnotations = annotations.length;
- for (int i = 0; i < numAnnotations; i++) {
- Annotation annotation = annotations[i];
- if (annotation.getValue().equals(ANNOTATION_ID)) {
- int start = detailMessage.getSpanStart(annotation);
- int end = detailMessage.getSpanEnd(annotation);
- ClickableSpan clickableSpan = getLinkToAppPermissions(groupState);
- SpannableString spannableString =
- new SpannableString(detailMessage);
- spannableString.setSpan(clickableSpan, start, end, 0);
- detailMessage = spannableString;
- break;
- }
+ detailMessage =
+ new SpannableString(getText(detailMessageId));
+ Annotation[] annotations = detailMessage.getSpans(
+ 0, detailMessage.length(), Annotation.class);
+ int numAnnotations = annotations.length;
+ for (int i = 0; i < numAnnotations; i++) {
+ Annotation annotation = annotations[i];
+ if (annotation.getValue().equals(ANNOTATION_ID)) {
+ int start = detailMessage.getSpanStart(annotation);
+ int end = detailMessage.getSpanEnd(annotation);
+ ClickableSpan clickableSpan = getLinkToAppPermissions(groupState);
+ SpannableString spannableString =
+ new SpannableString(detailMessage);
+ spannableString.setSpan(clickableSpan, start, end, 0);
+ detailMessage = spannableString;
+ break;
}
- } catch (NameNotFoundException ignored) {
}
}
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/utils/Utils.java b/PermissionController/src/com/android/permissioncontroller/permission/utils/Utils.java
index ff7a54920..b027643a8 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/utils/Utils.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/utils/Utils.java
@@ -129,6 +129,13 @@ public final class Utils {
/** Set of groups that will be able to receive one-time grant */
private static final ArraySet<String> ONE_TIME_PERMISSION_GROUPS;
+ private static final ArrayMap<String, Integer> PERM_GROUP_REQUEST_RES;
+ private static final ArrayMap<String, Integer> PERM_GROUP_REQUEST_DETAIL_RES;
+ private static final ArrayMap<String, Integer> PERM_GROUP_BACKGROUND_REQUEST_RES;
+ private static final ArrayMap<String, Integer> PERM_GROUP_BACKGROUND_REQUEST_DETAIL_RES;
+ private static final ArrayMap<String, Integer> PERM_GROUP_UPGRADE_REQUEST_RES;
+ private static final ArrayMap<String, Integer> PERM_GROUP_UPGRADE_REQUEST_DETAIL_RES;
+
private static final Intent LAUNCHER_INTENT = new Intent(Intent.ACTION_MAIN, null)
.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -201,6 +208,38 @@ public final class Utils {
ONE_TIME_PERMISSION_GROUPS.add(LOCATION);
ONE_TIME_PERMISSION_GROUPS.add(CAMERA);
ONE_TIME_PERMISSION_GROUPS.add(MICROPHONE);
+
+ PERM_GROUP_REQUEST_RES = new ArrayMap<>();
+ PERM_GROUP_REQUEST_RES.put(CONTACTS, R.string.permgrouprequest_contacts);
+ PERM_GROUP_REQUEST_RES.put(LOCATION, R.string.permgrouprequest_location);
+ PERM_GROUP_REQUEST_RES.put(CALENDAR, R.string.permgrouprequest_calendar);
+ PERM_GROUP_REQUEST_RES.put(SMS, R.string.permgrouprequest_sms);
+ PERM_GROUP_REQUEST_RES.put(STORAGE, R.string.permgrouprequest_storage);
+ PERM_GROUP_REQUEST_RES.put(MICROPHONE, R.string.permgrouprequest_microphone);
+ PERM_GROUP_REQUEST_RES
+ .put(ACTIVITY_RECOGNITION, R.string.permgrouprequest_activityRecognition);
+ PERM_GROUP_REQUEST_RES.put(CAMERA, R.string.permgrouprequest_camera);
+ PERM_GROUP_REQUEST_RES.put(CALL_LOG, R.string.permgrouprequest_calllog);
+ PERM_GROUP_REQUEST_RES.put(PHONE, R.string.permgrouprequest_phone);
+ PERM_GROUP_REQUEST_RES.put(SENSORS, R.string.permgrouprequest_sensors);
+
+ PERM_GROUP_REQUEST_DETAIL_RES = new ArrayMap<>();
+ PERM_GROUP_REQUEST_DETAIL_RES.put(LOCATION, R.string.permgrouprequestdetail_location);
+
+ PERM_GROUP_BACKGROUND_REQUEST_RES = new ArrayMap<>();
+ PERM_GROUP_BACKGROUND_REQUEST_RES
+ .put(LOCATION, R.string.permgroupbackgroundrequest_location);
+
+ PERM_GROUP_BACKGROUND_REQUEST_DETAIL_RES = new ArrayMap<>();
+ PERM_GROUP_BACKGROUND_REQUEST_DETAIL_RES
+ .put(LOCATION, R.string.permgroupbackgroundrequestdetail_location);
+
+ PERM_GROUP_UPGRADE_REQUEST_RES = new ArrayMap<>();
+ PERM_GROUP_UPGRADE_REQUEST_RES.put(LOCATION, R.string.permgroupupgraderequest_location);
+
+ PERM_GROUP_UPGRADE_REQUEST_DETAIL_RES = new ArrayMap<>();
+ PERM_GROUP_UPGRADE_REQUEST_DETAIL_RES
+ .put(LOCATION, R.string.permgroupupgraderequestdetail_location);
}
private Utils() {
@@ -674,11 +713,7 @@ public final class Utils {
context.getString(R.string.permgrouprequest_storage_isolated),
appLabel), 0);
} else if (requestRes != 0) {
- try {
- return Html.fromHtml(context.getPackageManager().getResourcesForApplication(
- group.getDeclaringPackage()).getString(requestRes, appLabel), 0);
- } catch (PackageManager.NameNotFoundException ignored) {
- }
+ return Html.fromHtml(context.getResources().getString(requestRes, appLabel), 0);
}
return Html.fromHtml(context.getString(R.string.permission_warning_template, appLabel,
@@ -1044,4 +1079,58 @@ public final class Utils {
public static boolean supportsOneTimeGrant(String permissionGroup) {
return ONE_TIME_PERMISSION_GROUPS.contains(permissionGroup);
}
+
+ /**
+ * The resource id for the request message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getRequest(String groupName) {
+ return PERM_GROUP_REQUEST_RES.getOrDefault(groupName, 0);
+ }
+
+ /**
+ * The resource id for the request detail message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getRequestDetail(String groupName) {
+ return PERM_GROUP_REQUEST_DETAIL_RES.getOrDefault(groupName, 0);
+ }
+
+ /**
+ * The resource id for the background request message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getBackgroundRequest(String groupName) {
+ return PERM_GROUP_BACKGROUND_REQUEST_RES.getOrDefault(groupName, 0);
+ }
+
+ /**
+ * The resource id for the background request detail message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getBackgroundRequestDetail(String groupName) {
+ return PERM_GROUP_BACKGROUND_REQUEST_DETAIL_RES.getOrDefault(groupName, 0);
+ }
+
+ /**
+ * The resource id for the upgrade request message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getUpgradeRequest(String groupName) {
+ return PERM_GROUP_UPGRADE_REQUEST_RES.getOrDefault(groupName, 0);
+ }
+
+ /**
+ * The resource id for the upgrade request detail message for a permission group
+ * @param groupName Permission group name
+ * @return The id or 0 if the permission group doesn't exist or have a message
+ */
+ public static int getUpgradeRequestDetail(String groupName) {
+ return PERM_GROUP_UPGRADE_REQUEST_DETAIL_RES.getOrDefault(groupName, 0);
+ }
}