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: If0f7483eb6d79791ade3f8fb51e6f8852292ff15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Julia Reynolds
2023-03-28 13:48:01 +00:00
committed by Automerger Merge Worker

View File

@@ -65,6 +65,7 @@ public class NotificationAccessSettings extends EmptyTextSettings {
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 @@ public class NotificationAccessSettings extends EmptyTextSettings {
.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);