Bug 1363049 - getNextTab() should only use parent tabs of the same type. r?walkingice
That is if the currently selected tab has a web app or custom tab as its "parent tab", we'll ignore that fact when the tab is closed from the tabs tray, so we don't trigger an activity switch that way.
MozReview-Commit-ID: 7bOi90RQUhA
--- a/mobile/android/base/java/org/mozilla/gecko/Tabs.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tabs.java
@@ -594,17 +594,17 @@ public class Tabs implements BundleEvent
}
if (nextTab == null && type != TabType.BROWSING) {
// If there are no non-private tabs of the same type remaining,
// fall back to TabType.BROWSING.
nextTab = getFallbackNextTab(TabType.BROWSING);
}
Tab parent = getTab(tab.getParentId());
- if (parent != null) {
+ if (parent != null && parent.getType() == type) {
// If the next tab is a sibling, switch to it. Otherwise go back to the parent.
if (nextTab != null && nextTab.getParentId() == tab.getParentId())
return nextTab;
else
return parent;
}
return nextTab;
}