Suppress InvalidPatternSyntax issue instead of demoting
So that it will still be an error for other parts of the code.
Bug: 311064136
Test: m RUN_ERROR_PRONE=true SystemUI-core SystemUI-tests SystemUIRobo-stub
Change-Id: I48d85c79f19cb90cc8df7a9890ab9f4719d73d7f
Merged-In: Ic408374fc30f849eedbb60c6f470e432c46d0576
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index fae2991..8ca925b 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -209,11 +209,6 @@
lint: {
extra_check_modules: ["SystemUILintChecker"],
},
- errorprone: {
- javacflags: [
- "-Xep:InvalidPatternSyntax:WARN",
- ],
- },
}
filegroup {
@@ -410,11 +405,6 @@
test: true,
extra_check_modules: ["SystemUILintChecker"],
},
- errorprone: {
- javacflags: [
- "-Xep:InvalidPatternSyntax:WARN",
- ],
- },
}
android_app {
@@ -452,12 +442,6 @@
},
plugins: ["dagger2-compiler"],
-
- errorprone: {
- javacflags: [
- "-Xep:InvalidPatternSyntax:WARN",
- ],
- },
}
android_robolectric_test {
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
index 67e9664..27e6895 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
@@ -165,6 +165,9 @@
+ "\\p{Emoji}(\\p{EMod}|\\x{FE0F}\\x{20E3}?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})"
+ "?)*";
+ // Not all JDKs support emoji patterns, including the one errorprone runs under, which
+ // makes it think that this is an invalid pattern.
+ @SuppressWarnings("InvalidPatternSyntax")
private static final Pattern EMOJI_PATTERN = Pattern.compile(UNICODE_EMOJI_REGEX);
public static final String EMPTY_STRING = "";