Merge "Add URL on ViewStructure."
This commit is contained in:
@@ -6574,6 +6574,7 @@ package android.app.assist {
|
||||
method public int getTextStyle();
|
||||
method public int getTop();
|
||||
method public android.graphics.Matrix getTransformation();
|
||||
method public java.lang.String getUrl();
|
||||
method public int getVisibility();
|
||||
method public int getWidth();
|
||||
method public boolean isAccessibilityFocused();
|
||||
@@ -45664,6 +45665,7 @@ package android.view {
|
||||
method public abstract void setTextLines(int[], int[]);
|
||||
method public abstract void setTextStyle(float, int, int, int);
|
||||
method public abstract void setTransformation(android.graphics.Matrix);
|
||||
method public abstract void setUrl(java.lang.String);
|
||||
method public abstract void setVisibility(int);
|
||||
field public static final int AUTO_FILL_FLAG_SANITIZED = 1; // 0x1
|
||||
}
|
||||
|
||||
@@ -6811,6 +6811,7 @@ package android.app.assist {
|
||||
method public int getTextStyle();
|
||||
method public int getTop();
|
||||
method public android.graphics.Matrix getTransformation();
|
||||
method public java.lang.String getUrl();
|
||||
method public int getVisibility();
|
||||
method public int getWidth();
|
||||
method public boolean isAccessibilityFocused();
|
||||
@@ -49102,6 +49103,7 @@ package android.view {
|
||||
method public abstract void setTextLines(int[], int[]);
|
||||
method public abstract void setTextStyle(float, int, int, int);
|
||||
method public abstract void setTransformation(android.graphics.Matrix);
|
||||
method public abstract void setUrl(java.lang.String);
|
||||
method public abstract void setVisibility(int);
|
||||
field public static final int AUTO_FILL_FLAG_SANITIZED = 1; // 0x1
|
||||
}
|
||||
|
||||
@@ -6597,6 +6597,7 @@ package android.app.assist {
|
||||
method public int getTextStyle();
|
||||
method public int getTop();
|
||||
method public android.graphics.Matrix getTransformation();
|
||||
method public java.lang.String getUrl();
|
||||
method public int getVisibility();
|
||||
method public int getWidth();
|
||||
method public boolean isAccessibilityFocused();
|
||||
@@ -45976,6 +45977,7 @@ package android.view {
|
||||
method public abstract void setTextLines(int[], int[]);
|
||||
method public abstract void setTextStyle(float, int, int, int);
|
||||
method public abstract void setTransformation(android.graphics.Matrix);
|
||||
method public abstract void setUrl(java.lang.String);
|
||||
method public abstract void setVisibility(int);
|
||||
field public static final int AUTO_FILL_FLAG_SANITIZED = 1; // 0x1
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@ import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewStructure;
|
||||
import android.view.ViewRootImpl;
|
||||
import android.view.ViewStructure;
|
||||
import android.view.WindowManager;
|
||||
import android.view.WindowManagerGlobal;
|
||||
import android.view.autofill.AutoFillId;
|
||||
import android.view.autofill.AutoFillType;
|
||||
import android.view.autofill.AutoFillValue;
|
||||
import android.view.autofill.AutoFillId;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -579,6 +579,7 @@ public class AssistStructure implements Parcelable {
|
||||
static final int FLAGS_HAS_EXTRAS = 0x00400000;
|
||||
static final int FLAGS_HAS_ID = 0x00200000;
|
||||
static final int FLAGS_HAS_CHILDREN = 0x00100000;
|
||||
static final int FLAGS_HAS_URL = 0x00080000;
|
||||
static final int FLAGS_ALL_CONTROL = 0xfff00000;
|
||||
|
||||
int mFlags;
|
||||
@@ -587,6 +588,7 @@ public class AssistStructure implements Parcelable {
|
||||
CharSequence mContentDescription;
|
||||
|
||||
ViewNodeText mText;
|
||||
String mUrl;
|
||||
Bundle mExtras;
|
||||
|
||||
ViewNode[] mChildren;
|
||||
@@ -651,6 +653,9 @@ public class AssistStructure implements Parcelable {
|
||||
if ((flags&FLAGS_HAS_TEXT) != 0) {
|
||||
mText = new ViewNodeText(in, (flags&FLAGS_HAS_COMPLEX_TEXT) == 0);
|
||||
}
|
||||
if ((flags&FLAGS_HAS_URL) != 0) {
|
||||
mUrl = in.readString();
|
||||
}
|
||||
if ((flags&FLAGS_HAS_EXTRAS) != 0) {
|
||||
mExtras = in.readBundle();
|
||||
}
|
||||
@@ -704,6 +709,9 @@ public class AssistStructure implements Parcelable {
|
||||
flags |= FLAGS_HAS_COMPLEX_TEXT;
|
||||
}
|
||||
}
|
||||
if (mUrl != null) {
|
||||
flags |= FLAGS_HAS_URL;
|
||||
}
|
||||
if (mExtras != null) {
|
||||
flags |= FLAGS_HAS_EXTRAS;
|
||||
}
|
||||
@@ -760,6 +768,9 @@ public class AssistStructure implements Parcelable {
|
||||
if ((flags&FLAGS_HAS_TEXT) != 0) {
|
||||
mText.writeToParcel(out, (flags&FLAGS_HAS_COMPLEX_TEXT) == 0, writeSensitive);
|
||||
}
|
||||
if ((flags&FLAGS_HAS_URL) != 0) {
|
||||
out.writeString(mUrl);
|
||||
}
|
||||
if ((flags&FLAGS_HAS_EXTRAS) != 0) {
|
||||
out.writeBundle(mExtras);
|
||||
}
|
||||
@@ -1039,6 +1050,20 @@ public class AssistStructure implements Parcelable {
|
||||
return mContentDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL represented by this node.
|
||||
*
|
||||
* <p>Typically used in 2 categories of nodes:
|
||||
*
|
||||
* <ol>
|
||||
* <li>Root node (containing the URL of the HTML page)
|
||||
* <li>Child nodes that represent hyperlinks (contains the hyperlink URL).
|
||||
* </ol>
|
||||
*/
|
||||
public String getUrl() {
|
||||
return mUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns any text associated with the node that is displayed to the user, or null
|
||||
* if there is none.
|
||||
@@ -1486,6 +1511,11 @@ public class AssistStructure implements Parcelable {
|
||||
public void setSanitized(boolean sanitized) {
|
||||
mNode.mSanitized = sanitized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUrl(String url) {
|
||||
mNode.mUrl = url;
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@@ -1583,6 +1613,10 @@ public class AssistStructure implements Parcelable {
|
||||
Log.i(TAG, prefix + " Text color fg: #" + Integer.toHexString(node.getTextColor())
|
||||
+ ", bg: #" + Integer.toHexString(node.getTextBackgroundColor()));
|
||||
}
|
||||
CharSequence url = node.getUrl();
|
||||
if (url != null) {
|
||||
Log.i(TAG, prefix + " URL: " + url);
|
||||
}
|
||||
String hint = node.getHint();
|
||||
if (hint != null) {
|
||||
Log.i(TAG, prefix + " Hint: " + hint);
|
||||
|
||||
@@ -338,4 +338,17 @@ public abstract class ViewStructure {
|
||||
|
||||
/** @hide */
|
||||
public abstract AutoFillId getAutoFillId();
|
||||
|
||||
/**
|
||||
* Sets the URL represented by this node.
|
||||
*
|
||||
* <p>Typically used in the following situations:
|
||||
*
|
||||
* <ol>
|
||||
* <li>In a {@link android.app.assist.AssistStructure.WindowNode#getRootViewNode()}, to set up
|
||||
* the main URL of an HTML page.
|
||||
* <li>On child nodes represening hyperlinks.
|
||||
* </ol>
|
||||
*/
|
||||
public abstract void setUrl(String url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user