summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2012-04-17 14:10:52 -0700
committerMichael Kolb <kolby@google.com>2012-04-17 14:55:40 -0700
commitf1286a455eeacd02dfcca1335e6a7a9f87433c1b (patch)
treec141d2def88f04657de5bf74c35983dfb54c26ea
parent0ce8ea567a3ef07d7f691cb2a2716024b5192e01 (diff)
downloadandroid_packages_apps_Gello-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.tar.gz
android_packages_apps_Gello-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.tar.bz2
android_packages_apps_Gello-f1286a455eeacd02dfcca1335e6a7a9f87433c1b.zip
Re-use tab for an intent created by browser
Bug: 6332680 Change-Id: If9c754e2320e8f112a816c54138918fbaf360597
-rw-r--r--src/com/android/browser/IntentHandler.java10
-rw-r--r--src/com/android/browser/UrlHandler.java2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java
index ecd45452..b21c688d 100644
--- a/src/com/android/browser/IntentHandler.java
+++ b/src/com/android/browser/IntentHandler.java
@@ -157,6 +157,16 @@ public class IntentHandler {
mController.openTab(urlData);
return;
}
+ if (Intent.ACTION_VIEW.equals(action)
+ && (appId != null)
+ && appId.startsWith(mActivity.getPackageName())) {
+ Tab appTab = mTabControl.getTabFromAppId(appId);
+ if ((appTab != null) && (appTab == mController.getCurrentTab())) {
+ mController.switchToTab(appTab);
+ mController.loadUrlDataIn(appTab, urlData);
+ return;
+ }
+ }
if ((Intent.ACTION_VIEW.equals(action)
// If a voice search has no appId, it means that it came
// from the browser. In that case, reuse the current tab.
diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java
index a4df999d..ac4b8803 100644
--- a/src/com/android/browser/UrlHandler.java
+++ b/src/com/android/browser/UrlHandler.java
@@ -163,7 +163,7 @@ public class UrlHandler {
// Re-use the existing tab if the intent comes back to us
if (tab != null) {
if (tab.getAppId() == null) {
- tab.setAppId("com.android.browser-" + tab.getId());
+ tab.setAppId(mActivity.getPackageName() + "-" + tab.getId());
}
intent.putExtra(Browser.EXTRA_APPLICATION_ID, tab.getAppId());
}