diff options
author | Leon Scroggins <scroggo@google.com> | 2010-03-15 16:56:57 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-03-15 16:56:57 -0400 |
commit | 2ee4a5acc5c1ef87afa02830b31770cb1359b626 (patch) | |
tree | a9f9c19ab23cad963d5c0922d18f76a6eaea2d22 /src/com/android | |
parent | 945f1007f7574b317e04a43669d092cfc9e5d69c (diff) | |
download | packages_apps_Browser-2ee4a5acc5c1ef87afa02830b31770cb1359b626.zip packages_apps_Browser-2ee4a5acc5c1ef87afa02830b31770cb1359b626.tar.gz packages_apps_Browser-2ee4a5acc5c1ef87afa02830b31770cb1359b626.tar.bz2 |
Allow going back to a voice search to work when choosing from n-best.
Store a copy of the Intent rather than the Intent itself. This way,
when choosing from the n-best, the number will not be appended to
the original Intent, so pressing back works properly.
Change-Id: Id6a0232339f34e5f91928e2bc1502f8f2fc33228
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/Tab.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 409f68c..535e8e7 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -229,7 +229,7 @@ class Tab { .EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS); mVoiceSearchData.mSourceIsGoogle = intent.getBooleanExtra( VoiceSearchData.SOURCE_IS_GOOGLE, false); - mVoiceSearchData.mVoiceSearchIntent = intent; + mVoiceSearchData.mVoiceSearchIntent = new Intent(intent); } String extraData = intent.getStringExtra( SearchManager.EXTRA_DATA_KEY); @@ -250,8 +250,11 @@ class Tab { mActivity.sendBroadcast(logIntent); } if (mVoiceSearchData.mVoiceSearchIntent != null) { - mVoiceSearchData.mVoiceSearchIntent.putExtra( - SearchManager.EXTRA_DATA_KEY, extraData); + // Copy the Intent, so that each history item will have its own + // Intent, with different (or none) extra data. + Intent latest = new Intent(mVoiceSearchData.mVoiceSearchIntent); + latest.putExtra(SearchManager.EXTRA_DATA_KEY, extraData); + mVoiceSearchData.mVoiceSearchIntent = latest; } } mVoiceSearchData.mLastVoiceSearchTitle |