Fix a bug where we were opening a new tab unnecessarily.
Code got changed along with other code. When changing to an appTab,
if it matches the current tab, do nothing. Fixes
http:/b/issue?id=197317
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index e0368c3..577206a 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -593,8 +593,11 @@
// No matching application tab, try to find a regular tab
// with a matching url.
appTab = mTabControl.findUnusedTabWithUrl(urlData.mUrl);
- if (appTab != null && current != appTab) {
- switchToTab(mTabControl.getTabIndex(appTab));
+ if (appTab != null) {
+ if (current != appTab) {
+ switchToTab(mTabControl.getTabIndex(appTab));
+ }
+ // Otherwise, we are already viewing the correct tab.
} else {
// if FLAG_ACTIVITY_BROUGHT_TO_FRONT flag is on, the url
// will be opened in a new tab unless we have reached