summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TabControl.java
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2011-09-02 12:03:26 +0100
committerMathew Inwood <mathewi@google.com>2011-09-02 12:04:14 +0100
commite09305e4ad0430571efb8ae880762204ddeaeb33 (patch)
tree2893599cea48b305e3cd1a36c1417c959584dd3c /src/com/android/browser/TabControl.java
parent86b396488290c22dd769f5fe3e6ad00eb8f674af (diff)
downloadpackages_apps_Browser-e09305e4ad0430571efb8ae880762204ddeaeb33.zip
packages_apps_Browser-e09305e4ad0430571efb8ae880762204ddeaeb33.tar.gz
packages_apps_Browser-e09305e4ad0430571efb8ae880762204ddeaeb33.tar.bz2
Make sure preloaded tabs have unique IDs.
Bug: 5251821 Change-Id: I6dd7561a2461805912268a5faf967199cf39fd8c
Diffstat (limited to 'src/com/android/browser/TabControl.java')
-rw-r--r--src/com/android/browser/TabControl.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 932a811..0668b74 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -170,6 +170,12 @@ class TabControl {
}
void addPreloadedTab(Tab tab) {
+ for (Tab current : mTabs) {
+ if (current != null && current.getId() == tab.getId()) {
+ throw new IllegalStateException("Tab with id " + tab.getId() + " already exists: "
+ + current.toString());
+ }
+ }
mTabs.add(tab);
tab.setController(mController);
mController.onSetWebView(tab, tab.getWebView());