am f40f46e9: am 7f92f067: Merge "Allow 3P apps to provide structured data within AssistContent." into mnc-dev
* commit 'f40f46e94c773676158b3f7e9cd51157cc9a91d2': Allow 3P apps to provide structured data within AssistContent.
This commit is contained in:
@@ -4019,10 +4019,12 @@ package android.app {
|
|||||||
ctor public AssistContent();
|
ctor public AssistContent();
|
||||||
method public android.content.ClipData getClipData();
|
method public android.content.ClipData getClipData();
|
||||||
method public android.os.Bundle getExtras();
|
method public android.os.Bundle getExtras();
|
||||||
|
method public java.lang.String getStructuredData();
|
||||||
method public android.net.Uri getWebUri();
|
method public android.net.Uri getWebUri();
|
||||||
method public boolean isAppProvidedIntent();
|
method public boolean isAppProvidedIntent();
|
||||||
method public void setClipData(android.content.ClipData);
|
method public void setClipData(android.content.ClipData);
|
||||||
method public void setIntent(android.content.Intent);
|
method public void setIntent(android.content.Intent);
|
||||||
|
method public void setStructuredData(java.lang.String);
|
||||||
method public void setWebUri(android.net.Uri);
|
method public void setWebUri(android.net.Uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4114,10 +4114,12 @@ package android.app {
|
|||||||
ctor public AssistContent();
|
ctor public AssistContent();
|
||||||
method public android.content.ClipData getClipData();
|
method public android.content.ClipData getClipData();
|
||||||
method public android.os.Bundle getExtras();
|
method public android.os.Bundle getExtras();
|
||||||
|
method public java.lang.String getStructuredData();
|
||||||
method public android.net.Uri getWebUri();
|
method public android.net.Uri getWebUri();
|
||||||
method public boolean isAppProvidedIntent();
|
method public boolean isAppProvidedIntent();
|
||||||
method public void setClipData(android.content.ClipData);
|
method public void setClipData(android.content.ClipData);
|
||||||
method public void setIntent(android.content.Intent);
|
method public void setIntent(android.content.Intent);
|
||||||
|
method public void setStructuredData(java.lang.String);
|
||||||
method public void setWebUri(android.net.Uri);
|
method public void setWebUri(android.net.Uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.os.Parcelable;
|
|||||||
public class AssistContent {
|
public class AssistContent {
|
||||||
private boolean mIsAppProvidedIntent = false;
|
private boolean mIsAppProvidedIntent = false;
|
||||||
private Intent mIntent;
|
private Intent mIntent;
|
||||||
|
private String mStructuredData;
|
||||||
private ClipData mClipData;
|
private ClipData mClipData;
|
||||||
private Uri mUri;
|
private Uri mUri;
|
||||||
private final Bundle mExtras;
|
private final Bundle mExtras;
|
||||||
@@ -124,6 +125,22 @@ public class AssistContent {
|
|||||||
return mClipData;
|
return mClipData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets optional structured data regarding the content being viewed. The provided data
|
||||||
|
* must be a string represented with <a href="http://json-ld.org/">JSON-LD</a> using the
|
||||||
|
* <a href="http://schema.org/">schema.org</a> vocabulary.
|
||||||
|
*/
|
||||||
|
public void setStructuredData(String structuredData) {
|
||||||
|
mStructuredData = structuredData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current {@link #setStructuredData}.
|
||||||
|
*/
|
||||||
|
public String getStructuredData() {
|
||||||
|
return mStructuredData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a web URI associated with the current data being shown to the user.
|
* Set a web URI associated with the current data being shown to the user.
|
||||||
* This URI could be opened in a web browser, or in the app as an
|
* This URI could be opened in a web browser, or in the app as an
|
||||||
@@ -163,6 +180,9 @@ public class AssistContent {
|
|||||||
if (in.readInt() != 0) {
|
if (in.readInt() != 0) {
|
||||||
mUri = Uri.CREATOR.createFromParcel(in);
|
mUri = Uri.CREATOR.createFromParcel(in);
|
||||||
}
|
}
|
||||||
|
if (in.readInt() != 0) {
|
||||||
|
mStructuredData = in.readString();
|
||||||
|
}
|
||||||
mIsAppProvidedIntent = in.readInt() == 1;
|
mIsAppProvidedIntent = in.readInt() == 1;
|
||||||
mExtras = in.readBundle();
|
mExtras = in.readBundle();
|
||||||
}
|
}
|
||||||
@@ -187,6 +207,12 @@ public class AssistContent {
|
|||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
|
if (mStructuredData != null) {
|
||||||
|
dest.writeInt(1);
|
||||||
|
dest.writeString(mStructuredData);
|
||||||
|
} else {
|
||||||
|
dest.writeInt(0);
|
||||||
|
}
|
||||||
dest.writeInt(mIsAppProvidedIntent ? 1 : 0);
|
dest.writeInt(mIsAppProvidedIntent ? 1 : 0);
|
||||||
dest.writeBundle(mExtras);
|
dest.writeBundle(mExtras);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user