commit | ce0c1c4de7b58d18287afea2f1ed82e9cf24acce | [log] [tgz] |
---|---|---|
author | Julia Reynolds <juliacr@google.com> | Wed Mar 15 14:27:39 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Mar 15 14:27:39 2023 +0000 |
tree | 36ae1feab4a00b69a23c454d34d536f1486156d8 | |
parent | 7e131d0b94d7171848c5fd15a7fd00e77971287a [diff] | |
parent | 7626600bbfaa79924eb21290f30df97e85f5175d [diff] |
Merge "Don't show NLSes with excessively long component names" into tm-qpr-dev am: 7626600bbf Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22066389 Change-Id: I90173ce86cc356ba97e4ff51dffd6b6588bb0c49 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);