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

Commit 6e1fa85d authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Pass default value of the TextFlags

Bug: 291679670
Test: Manually done
Change-Id: I87133b61f241443c232171611b99267d1bb5a5d2
parent cea6bf39
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -61,6 +61,18 @@ public final class TextFlags {
            Flags.FLAG_USE_BOUNDS_FOR_WIDTH,
    };

    /**
     * List of the default values of the text flags.
     *
     * The order must be the same to the TEXT_ACONFIG_FLAGS.
     */
    public static final boolean[] TEXT_ACONFIG_DEFAULT_VALUE = {
            Flags.deprecateFontsXml(),
            Flags.noBreakNoHyphenationSpan(),
            Flags.phraseStrictFallback(),
            Flags.useBoundsForWidth(),
    };

    /**
     * Get a key for the feature flag.
     */
+4 −2
Original line number Diff line number Diff line
@@ -175,13 +175,15 @@ final class CoreSettingsObserver extends ContentObserver {
                TextFlags.ENABLE_NEW_CONTEXT_MENU_DEFAULT));

        // Register all text aconfig flags.
        for (String flag : TextFlags.TEXT_ACONFIGS_FLAGS) {
        for (int i = 0; i < TextFlags.TEXT_ACONFIGS_FLAGS.length; i++) {
            final String flag = TextFlags.TEXT_ACONFIGS_FLAGS[i];
            final boolean defaultValue = TextFlags.TEXT_ACONFIG_DEFAULT_VALUE[i];
            sDeviceConfigEntries.add(new DeviceConfigEntry<Boolean>(
                    TextFlags.NAMESPACE,
                    flag,
                    TextFlags.getKeyForFlag(flag),
                    boolean.class,
                    false));  // All aconfig flags are false by default.
                    defaultValue));
        }
        // add other device configs here...
    }