Merge "Don't show NLSes with excessively long component names" into udc-dev am: 4726d0de52
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21888167 Change-Id: I60a885a15053e905162e5b4ca0331ffb3722f9e1 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