Merge "Add new API to set URI on AssistContent." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4573dddcce
@ -119,11 +119,16 @@ public class MainInteractionSession extends VoiceInteractionSession
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHandleAssist(Bundle assistBundle) {
|
||||
if (assistBundle != null) {
|
||||
parseAssistData(assistBundle);
|
||||
} else {
|
||||
Log.i(TAG, "onHandleAssist: NO ASSIST BUNDLE");
|
||||
public void onHandleAssist(Bundle data, AssistStructure structure, AssistContent content) {
|
||||
mAssistStructure = structure;
|
||||
if (mAssistStructure != null) {
|
||||
if (mAssistVisualizer != null) {
|
||||
mAssistVisualizer.setAssistStructure(mAssistStructure);
|
||||
}
|
||||
}
|
||||
if (content != null) {
|
||||
Log.i(TAG, "Assist intent: " + content.getIntent());
|
||||
Log.i(TAG, "Assist clipdata: " + content.getClipData());
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,29 +144,6 @@ public class MainInteractionSession extends VoiceInteractionSession
|
||||
}
|
||||
}
|
||||
|
||||
void parseAssistData(Bundle assistBundle) {
|
||||
if (assistBundle != null) {
|
||||
Bundle assistContext = assistBundle.getBundle(Intent.EXTRA_ASSIST_CONTEXT);
|
||||
if (assistContext != null) {
|
||||
mAssistStructure = AssistStructure.getAssistStructure(assistContext);
|
||||
if (mAssistStructure != null) {
|
||||
if (mAssistVisualizer != null) {
|
||||
mAssistVisualizer.setAssistStructure(mAssistStructure);
|
||||
}
|
||||
}
|
||||
AssistContent content = AssistContent.getAssistContent(assistContext);
|
||||
if (content != null) {
|
||||
Log.i(TAG, "Assist intent: " + content.getIntent());
|
||||
Log.i(TAG, "Assist clipdata: " + content.getClipData());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mAssistVisualizer != null) {
|
||||
mAssistVisualizer.clearAssistData();
|
||||
}
|
||||
}
|
||||
|
||||
void updateState() {
|
||||
if (mState == STATE_IDLE) {
|
||||
mTopContent.setVisibility(View.VISIBLE);
|
||||
|
Reference in New Issue
Block a user