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

Commit 114a4415 authored by Felipe Leme's avatar Felipe Leme
Browse files

Added ViewNode.getWebScheme().

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsAssistTestCases

Fixes: 65207762

Change-Id: Ia8f7b3f5fce8cf0cc783e861fd7e1f1f7f78db19
parent e38c42e6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6683,6 +6683,7 @@ package android.app.assist {
    method public android.graphics.Matrix getTransformation();
    method public int getVisibility();
    method public java.lang.String getWebDomain();
    method public java.lang.String getWebScheme();
    method public int getWidth();
    method public boolean isAccessibilityFocused();
    method public boolean isActivated();
+1 −0
Original line number Diff line number Diff line
@@ -6933,6 +6933,7 @@ package android.app.assist {
    method public android.graphics.Matrix getTransformation();
    method public int getVisibility();
    method public java.lang.String getWebDomain();
    method public java.lang.String getWebScheme();
    method public int getWidth();
    method public boolean isAccessibilityFocused();
    method public boolean isActivated();
+1 −0
Original line number Diff line number Diff line
@@ -6754,6 +6754,7 @@ package android.app.assist {
    method public android.graphics.Matrix getTransformation();
    method public int getVisibility();
    method public java.lang.String getWebDomain();
    method public java.lang.String getWebScheme();
    method public int getWidth();
    method public boolean isAccessibilityFocused();
    method public boolean isActivated();
+22 −3
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ public class AssistStructure implements Parcelable {

        ViewNodeText mText;
        int mInputType;
        String mWebScheme;
        String mWebDomain;
        Bundle mExtras;
        LocaleList mLocaleList;
@@ -751,6 +752,7 @@ public class AssistStructure implements Parcelable {
                mInputType = in.readInt();
            }
            if ((flags&FLAGS_HAS_URL) != 0) {
                mWebScheme = in.readString();
                mWebDomain = in.readString();
            }
            if ((flags&FLAGS_HAS_LOCALE_LIST) != 0) {
@@ -813,7 +815,7 @@ public class AssistStructure implements Parcelable {
            if (mInputType != 0) {
                flags |= FLAGS_HAS_INPUT_TYPE;
            }
            if (mWebDomain != null) {
            if (mWebScheme != null || mWebDomain != null) {
                flags |= FLAGS_HAS_URL;
            }
            if (mLocaleList != null) {
@@ -908,6 +910,7 @@ public class AssistStructure implements Parcelable {
                out.writeInt(mInputType);
            }
            if ((flags&FLAGS_HAS_URL) != 0) {
                out.writeString(mWebScheme);
                out.writeString(mWebDomain);
            }
            if ((flags&FLAGS_HAS_LOCALE_LIST) != 0) {
@@ -1265,12 +1268,25 @@ public class AssistStructure implements Parcelable {
         * {@link android.service.autofill.AutofillService} for more details.
         *
         * @return domain-only part of the document. For example, if the full URL is
         * {@code https://my.site/login?user=my_user}, it returns {@code my.site}.
         * {@code https://example.com/login?user=my_user}, it returns {@code example.com}.
         */
        @Nullable public String getWebDomain() {
            return mWebDomain;
        }

        /**
         * Returns the scheme of the HTML document represented by this view.
         *
         * <p>Typically used when the view associated with the view is a container for an HTML
         * document.
         *
         * @return scheme-only part of the document. For example, if the full URL is
         * {@code https://example.com/login?user=my_user}, it returns {@code https}.
         */
        @Nullable public String getWebScheme() {
            return mWebScheme;
        }

        /**
         * Returns the HTML properties associated with this view.
         *
@@ -1767,10 +1783,13 @@ public class AssistStructure implements Parcelable {
        @Override
        public void setWebDomain(@Nullable String domain) {
            if (domain == null) {
                mNode.mWebScheme = null;
                mNode.mWebDomain = null;
                return;
            }
            mNode.mWebDomain = Uri.parse(domain).getHost();
            Uri uri = Uri.parse(domain);
            mNode.mWebScheme = uri.getScheme();
            mNode.mWebDomain = uri.getHost();
        }

        @Override
+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ public abstract class ViewStructure {
     *
     * <p>Typically used when the view is a container for an HTML document.
     *
     * @param domain URL representing the domain; only the host part will be used.
     * @param domain RFC 2396-compliant URI representing the domain.
     */
    public abstract void setWebDomain(@Nullable String domain);