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:
@@ -65,6 +65,7 @@ public class NotificationAccessSettings extends EmptyTextSettings {
|
|||||||
private static final String TAG = "NotifAccessSettings";
|
private static final String TAG = "NotifAccessSettings";
|
||||||
private static final String ALLOWED_KEY = "allowed";
|
private static final String ALLOWED_KEY = "allowed";
|
||||||
private static final String NOT_ALLOWED_KEY = "not_allowed";
|
private static final String NOT_ALLOWED_KEY = "not_allowed";
|
||||||
|
private static final int MAX_CN_LENGTH = 500;
|
||||||
|
|
||||||
private static final ManagedServiceSettings.Config CONFIG =
|
private static final ManagedServiceSettings.Config CONFIG =
|
||||||
new ManagedServiceSettings.Config.Builder()
|
new ManagedServiceSettings.Config.Builder()
|
||||||
@@ -101,6 +102,12 @@ public class NotificationAccessSettings extends EmptyTextSettings {
|
|||||||
.setNoun(CONFIG.noun)
|
.setNoun(CONFIG.noun)
|
||||||
.setSetting(CONFIG.setting)
|
.setSetting(CONFIG.setting)
|
||||||
.setTag(CONFIG.tag)
|
.setTag(CONFIG.tag)
|
||||||
|
.setValidator(info -> {
|
||||||
|
if (info.getComponentName().flattenToString().length() > MAX_CN_LENGTH) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
.build();
|
.build();
|
||||||
mServiceListing.addCallback(this::updateList);
|
mServiceListing.addCallback(this::updateList);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user