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

Commit 4aea204a authored by Tim Yu's avatar Tim Yu Committed by Android (Google) Code Review
Browse files

Merge "[Autofill] Migrate Flag" into main

parents bc1bfd5b b264058f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3732,6 +3732,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        return afm.shouldAlwaysIncludeWebviewInAssistStructure();
    }

    private boolean shouldIncludeInvisibleView(AutofillManager afm) {
        if (afm == null) return false;
        return afm.shouldIncludeInvisibleViewInAssistStructure();
    }

    /** @hide */
    private void populateChildrenForAutofill(ArrayList<View> list, @AutofillFlags int flags) {
        final int childrenCount = mChildrenCount;
@@ -3754,7 +3759,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                    || (shouldIncludeAllChildrenViewWithAutofillTypeNotNone(afm)
                        && child.getAutofillType() != AUTOFILL_TYPE_NONE)
                    || shouldIncludeAllChildrenViews(afm)
                    || (Flags.includeInvisibleViewGroupInAssistStructure()
                    || (shouldIncludeInvisibleView(afm)
                    && child instanceof ViewGroup && child.getVisibility() != View.VISIBLE)) {
                // If the child is a ViewGroup object and its visibility is not visible, include
                // it as part of the assist structure. The children of these invisible ViewGroup
+20 −0
Original line number Diff line number Diff line
@@ -220,6 +220,19 @@ public class AutofillFeatureFlags {
            DEVICE_CONFIG_ALWAYS_INCLUDE_WEBVIEW_IN_ASSIST_STRUCTURE =
            "always_include_webview_in_assist_structure";

    /**
     * Whether to include invisible views in the assist structure. Including invisible views can fix
     * some cases in which Session is destroyed earlier than it is suppose to.
     *
     * <p>See
     * frameworks/base/services/autofill/bugfixes.aconfig#include_invisible_view_group_in_assist_structure
     * for more information.
     *
     * @hide
     */
    public static final String DEVICE_CONFIG_INCLUDE_INVISIBLE_VIEW_GROUP_IN_ASSIST_STRUCTURE =
            "include_invisible_view_group_in_assist_structure";

    // END AUTOFILL FOR ALL APPS FLAGS //


@@ -473,6 +486,13 @@ public class AutofillFeatureFlags {
                DEVICE_CONFIG_ALWAYS_INCLUDE_WEBVIEW_IN_ASSIST_STRUCTURE, true);
    }

    /** @hide */
    public static boolean shouldIncludeInvisibleViewInAssistStructure() {
        return DeviceConfig.getBoolean(
                DeviceConfig.NAMESPACE_AUTOFILL,
                DEVICE_CONFIG_INCLUDE_INVISIBLE_VIEW_GROUP_IN_ASSIST_STRUCTURE,
                false);
    }

    /**
     * Whether should enable multi-line filter
+13 −0
Original line number Diff line number Diff line
@@ -739,6 +739,9 @@ public final class AutofillManager {
    // Indicate whether WebView should always be included in the assist structure
    private boolean mShouldAlwaysIncludeWebviewInAssistStructure;

    // Indicate whether invisibles views should be included in the assist structure
    private boolean mShouldIncludeInvisibleViewInAssistStructure;

    // Controls logic around apps changing some properties of their views when activity loses
    // focus due to autofill showing biometric activity, password manager, or password breach check.
    private boolean mRelayoutFix;
@@ -968,6 +971,9 @@ public final class AutofillManager {
        mShouldAlwaysIncludeWebviewInAssistStructure =
                AutofillFeatureFlags.shouldAlwaysIncludeWebviewInAssistStructure();

        mShouldIncludeInvisibleViewInAssistStructure =
                AutofillFeatureFlags.shouldIncludeInvisibleViewInAssistStructure();

        mRelayoutFix = Flags.relayout();
        mIsCredmanIntegrationEnabled = Flags.autofillCredmanIntegration();
    }
@@ -1054,6 +1060,13 @@ public final class AutofillManager {
        return mShouldAlwaysIncludeWebviewInAssistStructure;
    }

    /**
     * @hide
     */
    public boolean shouldIncludeInvisibleViewInAssistStructure() {
        return mShouldIncludeInvisibleViewInAssistStructure;
    }

    /**
     * Get the denied or allowed activitiy names under specified package from the list string and
     * set it in fields accordingly