diff options
author | John Reck <jreck@google.com> | 2011-06-17 14:47:20 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-06-17 14:47:20 -0700 |
commit | 24f1826440334ba8a3d2453699c51c1a4b117c7b (patch) | |
tree | 831b9b3302b2111cc376cc73fbb688a582565f51 /src/com/android/browser/TabControl.java | |
parent | 7dc444b4c3b70a09a33c0892fb8677922bdf1ecc (diff) | |
download | android_packages_apps_Gello-24f1826440334ba8a3d2453699c51c1a4b117c7b.tar.gz android_packages_apps_Gello-24f1826440334ba8a3d2453699c51c1a4b117c7b.tar.bz2 android_packages_apps_Gello-24f1826440334ba8a3d2453699c51c1a4b117c7b.zip |
Clarify restore dialog, prevent spam
Bug: 4599646
State that it is the browser's windows/tabs to be restored and
show the browser's app icon in the dialog.
Also cut down on the frequency this prompt will appear by
ignoring tabs that haven't loaded anything except the home page.
Change-Id: I2c2cc03aa92da3199c47b455256145d392548930
Diffstat (limited to 'src/com/android/browser/TabControl.java')
-rw-r--r-- | src/com/android/browser/TabControl.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java index 6566ac84..1367ba2c 100644 --- a/src/com/android/browser/TabControl.java +++ b/src/com/android/browser/TabControl.java @@ -288,6 +288,9 @@ class TabControl { */ void saveState(Bundle outState, boolean saveImages) { final int numTabs = getTabCount(); + if (numTabs == 0) { + return; + } long[] ids = new long[numTabs]; int i = 0; for (Tab tab : mTabs) { @@ -297,13 +300,15 @@ class TabControl { tab.getSavedState(saveImages)); } } - outState.putLongArray(POSITIONS, ids); - Tab current = getCurrentTab(); - long cid = -1; - if (current != null) { - cid = current.getId(); + if (!outState.isEmpty()) { + outState.putLongArray(POSITIONS, ids); + Tab current = getCurrentTab(); + long cid = -1; + if (current != null) { + cid = current.getId(); + } + outState.putLong(CURRENT, cid); } - outState.putLong(CURRENT, cid); } /** |