Re-use tab for an intent created by browser

  Bug: 6332680

Change-Id: If9c754e2320e8f112a816c54138918fbaf360597
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/browser/IntentHandler.java
index ecd4545..b21c688 100644
--- a/src/com/android/browser/IntentHandler.java
+++ b/src/com/android/browser/IntentHandler.java
@@ -157,6 +157,16 @@
                 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.