diff options
author | Mike LeBeau <mlebeau@android.com> | 2009-08-12 21:36:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-08-12 21:36:09 -0700 |
commit | 6f9da6b7b6030ef0c6b3808a830454aeabe35d14 (patch) | |
tree | 155a00b6a2afc98113924f977e1444b54434cc6e /core | |
parent | 67049ccc96f21ac7629a115f2ce82f3494b245ff (diff) | |
parent | 370e1f7439fd2688220bfc9615ea70fa3d397cea (diff) | |
download | frameworks_base-6f9da6b7b6030ef0c6b3808a830454aeabe35d14.zip frameworks_base-6f9da6b7b6030ef0c6b3808a830454aeabe35d14.tar.gz frameworks_base-6f9da6b7b6030ef0c6b3808a830454aeabe35d14.tar.bz2 |
am 370e1f74: Merge change 21038 into donut
Merge commit '370e1f7439fd2688220bfc9615ea70fa3d397cea'
* commit '370e1f7439fd2688220bfc9615ea70fa3d397cea':
Propagate info about whether a "call" command was issued in RecognitionResult.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/speech/RecognitionResult.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/core/java/android/speech/RecognitionResult.java b/core/java/android/speech/RecognitionResult.java index 8d031fc..978106b 100644 --- a/core/java/android/speech/RecognitionResult.java +++ b/core/java/android/speech/RecognitionResult.java @@ -60,9 +60,11 @@ public class RecognitionResult implements Parcelable { * * @param contact the contact name. * @param phoneType the phone type. + * @param callAction whether this result included a command to "call", or just the contact name. */ - public static RecognitionResult newContactResult(String contact, int phoneType) { - return new RecognitionResult(CONTACT_RESULT, contact, phoneType); + public static RecognitionResult newContactResult(String contact, int phoneType, + boolean callAction) { + return new RecognitionResult(CONTACT_RESULT, contact, phoneType, callAction); } /** @@ -112,8 +114,16 @@ public class RecognitionResult implements Parcelable { */ public final String mUrl; - /** Phone number type. This is valid only when mResultType == CONTACT_RESULT */ + /** + * Phone number type. This is valid only when mResultType == CONTACT_RESULT. + */ public final int mPhoneType; + + /** + * Whether a contact recognition result included a command to "call". This is valid only + * when mResultType == CONTACT_RESULT. + */ + public final boolean mCallAction; private RecognitionResult(int type, String query, String html, String url) { mResultType = type; @@ -121,14 +131,16 @@ public class RecognitionResult implements Parcelable { mHtml = html; mUrl = url; mPhoneType = -1; + mCallAction = false; } - private RecognitionResult(int type, String query, int at) { + private RecognitionResult(int type, String query, int phoneType, boolean callAction) { mResultType = type; mText = query; - mPhoneType = at; + mPhoneType = phoneType; mHtml = null; mUrl = null; + mCallAction = callAction; } private RecognitionResult(Parcel in) { @@ -137,6 +149,7 @@ public class RecognitionResult implements Parcelable { mHtml= in.readString(); mUrl= in.readString(); mPhoneType = in.readInt(); + mCallAction = (in.readInt() == 1); } public void writeToParcel(Parcel out, int flags) { @@ -145,6 +158,7 @@ public class RecognitionResult implements Parcelable { out.writeString(mHtml); out.writeString(mUrl); out.writeInt(mPhoneType); + out.writeInt(mCallAction ? 1 : 0); } |