Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55b67798 authored by Julia Reynolds's avatar Julia Reynolds Committed by Automerger Merge Worker
Browse files

Don't show NLSes with excessively long component names am: 79325796

parents af01fb89 79325796
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -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);