From be79c3b892c8ddbfc0c91136f4ecf27841b8ae39 Mon Sep 17 00:00:00 2001 From: Elliot Sisteron Date: Mon, 14 Nov 2022 11:40:18 +0000 Subject: Add data issue category to API. Needed for some new sources integration. Bug: 258444559 Test: atest CtsSafetyCenterTestCases Change-Id: I4cbdb351bbd4187edbbd860508285ee69b4735f0 --- framework-s/java/android/safetycenter/SafetySourceIssue.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'framework-s/java') 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); } -- cgit v1.2.3-59-g8ed1b