diff options
author | Vivek Sekhar <vsekhar@codeaurora.org> | 2015-12-15 11:23:29 -0800 |
---|---|---|
committer | jrizzoli <joey@cyanogenmoditalia.it> | 2016-01-11 22:03:22 +0100 |
commit | 2ce13da05462ceb84f2f79604f9f5c4edb3862bc (patch) | |
tree | d3a3601808bb08651288891dec48e441fbc78123 /src/com/android/browser/Controller.java | |
parent | cb3f72377d4dee4ae859feda9b3c613c9d36f94e (diff) | |
download | android_packages_apps_Gello-2ce13da05462ceb84f2f79604f9f5c4edb3862bc.tar.gz android_packages_apps_Gello-2ce13da05462ceb84f2f79604f9f5c4edb3862bc.tar.bz2 android_packages_apps_Gello-2ce13da05462ceb84f2f79604f9f5c4edb3862bc.zip |
Fix issue of losing tab state
Browser makes a backup of tab state when adding visited history and
page finished. When browser is being destroyed at times there could
be an instance where a background load triggers to write state while
the browser is already in cleanup state. This causes to write empty
state that looses the previous saved status .
Change-Id: I760c36e376c816302f8635c8e73d8b3871faf0b4
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 457b1c47..454b25a8 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -754,6 +754,12 @@ public class Controller /* package */ Bundle createSaveState() { Bundle saveState = new Bundle(); mTabControl.saveState(saveState); + // This method is called multiple times.Need to + // guard against TabControl not having any tabs + // during the destroy cycles which looses all the + // existing saved information. + if (saveState.isEmpty()) + return null; return saveState; } |