commit | 55b6779852994f5caa46853c4348c0f984c19c0d | [log] [tgz] |
---|---|---|
author | Julia Reynolds <juliacr@google.com> | Tue Mar 28 13:47:02 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Mar 28 13:47:02 2023 +0000 |
tree | bc7b4177caba16f7511409187a4c436280a6a5d9 | |
parent | af01fb89def408328ce9df89aeedfa8e14bb74b8 [diff] | |
parent | 793257967f165970f8cb0f4cebddab9dcd5d8353 [diff] |
Don't show NLSes with excessively long component names am: 793257967f Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22290643 Change-Id: Ia55de46522617d022142a6d1e753569689682a2f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/settings/notification/NotificationAccessSettings.java b/src/com/android/settings/notification/NotificationAccessSettings.java index 4ec9ccd..56d3f0e 100644 --- a/src/com/android/settings/notification/NotificationAccessSettings.java +++ b/src/com/android/settings/notification/NotificationAccessSettings.java
@@ -65,6 +65,7 @@ private static final String TAG = "NotifAccessSettings"; private static final String ALLOWED_KEY = "allowed"; private static final String NOT_ALLOWED_KEY = "not_allowed"; + private static final int MAX_CN_LENGTH = 500; private static final ManagedServiceSettings.Config CONFIG = new ManagedServiceSettings.Config.Builder() @@ -101,6 +102,12 @@ .setNoun(CONFIG.noun) .setSetting(CONFIG.setting) .setTag(CONFIG.tag) + .setValidator(info -> { + if (info.getComponentName().flattenToString().length() > MAX_CN_LENGTH) { + return false; + } + return true; + }) .build(); mServiceListing.addCallback(this::updateList);