summaryrefslogtreecommitdiff
path: root/framework-s/java
diff options
context:
space:
mode:
author Elliot Sisteron <elliotsisteron@google.com> 2022-11-14 11:40:18 +0000
committer Elliot Sisteron <elliotsisteron@google.com> 2022-11-14 16:20:07 +0000
commitbe79c3b892c8ddbfc0c91136f4ecf27841b8ae39 (patch)
tree893db45054849d2c1f948f58002dc49eb7b037e0 /framework-s/java
parentabb95a03510e5afa06b9566b775a38dbc9379c63 (diff)
Add data issue category to API.
Needed for some new sources integration. Bug: 258444559 Test: atest CtsSafetyCenterTestCases Change-Id: I4cbdb351bbd4187edbbd860508285ee69b4735f0
Diffstat (limited to 'framework-s/java')
-rw-r--r--framework-s/java/android/safetycenter/SafetySourceIssue.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/framework-s/java/android/safetycenter/SafetySourceIssue.java b/framework-s/java/android/safetycenter/SafetySourceIssue.java
index afc4f071f..c823bbe23 100644
--- a/framework-s/java/android/safetycenter/SafetySourceIssue.java
+++ b/framework-s/java/android/safetycenter/SafetySourceIssue.java
@@ -72,6 +72,10 @@ public final class SafetySourceIssue implements Parcelable {
/** Indicates that the risk associated with the issue is related to a user's general safety. */
public static final int ISSUE_CATEGORY_GENERAL = 300;
+ /** Indicates that the risk associated with the issue is related to a user's data. */
+ @RequiresApi(UPSIDE_DOWN_CAKE)
+ public static final int ISSUE_CATEGORY_DATA = 400;
+
/**
* All possible issue categories.
*
@@ -89,8 +93,10 @@ public final class SafetySourceIssue implements Parcelable {
ISSUE_CATEGORY_DEVICE,
ISSUE_CATEGORY_ACCOUNT,
ISSUE_CATEGORY_GENERAL,
+ ISSUE_CATEGORY_DATA
})
@Retention(RetentionPolicy.SOURCE)
+ @TargetApi(UPSIDE_DOWN_CAKE)
public @interface IssueCategory {}
/** Value signifying that the source has not specified a particular notification behavior. */
@@ -1094,6 +1100,9 @@ public final class SafetySourceIssue implements Parcelable {
return value;
default:
}
+ if (SdkLevel.isAtLeastU() && value == ISSUE_CATEGORY_DATA) {
+ return value;
+ }
throw new IllegalArgumentException(
"Unexpected IssueCategory for SafetySourceIssue: " + value);
}