am 23cbeb79: DO NOT MERGE remove save/restore picture from browser app
Merge commit '23cbeb795fe865a5c64f275bf51217fb55363cc0' into gingerbread-plus-aosp
* commit '23cbeb795fe865a5c64f275bf51217fb55363cc0':
DO NOT MERGE
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 8969296..e356dff 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -358,6 +358,15 @@
attachTabToContentView(mTabControl.getCurrentTab());
}
+ // Delete old thumbnails to save space
+ File dir = mTabControl.getThumbnailDir();
+ if (dir.exists()) {
+ for (String child : dir.list()) {
+ File f = new File(dir, child);
+ f.delete();
+ }
+ }
+
// Read JavaScript flags if it exists.
String jsFlags = mSettings.getJsFlags();
if (jsFlags.trim().length() != 0) {
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 00c027f..7f9611d 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -151,7 +151,6 @@
static final String CURRTAB = "currentTab";
static final String CURRURL = "currentUrl";
static final String CURRTITLE = "currentTitle";
- static final String CURRPICTURE = "currentPicture";
static final String CLOSEONEXIT = "closeonexit";
static final String PARENTTAB = "parentTab";
static final String APPID = "appid";
@@ -1907,17 +1906,6 @@
mSavedState = new Bundle();
final WebBackForwardList list = mMainView.saveState(mSavedState);
- if (list != null) {
- final File f = new File(mActivity.getTabControl().getThumbnailDir(),
- mMainView.hashCode() + "_pic.save");
- if (mMainView.savePicture(mSavedState, f)) {
- mSavedState.putString(CURRPICTURE, f.getPath());
- } else {
- // if savePicture returned false, we can't trust the contents,
- // and it may be large, so we delete it right away
- f.delete();
- }
- }
// Store some extra info for displaying the tab in the picker.
final WebHistoryItem item = list != null ? list.getCurrentItem() : null;
@@ -1963,11 +1951,6 @@
if (list == null) {
return false;
}
- if (b.containsKey(CURRPICTURE)) {
- final File f = new File(b.getString(CURRPICTURE));
- mMainView.restorePicture(b, f);
- f.delete();
- }
return true;
}
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 7cd2ccb..afd4ea8 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -229,15 +229,6 @@
}
}
- // This tab may have been pushed in to the background and then closed.
- // If the saved state contains a picture file, delete the file.
- Bundle savedState = t.getSavedState();
- if (savedState != null) {
- if (savedState.containsKey(Tab.CURRPICTURE)) {
- new File(savedState.getString(Tab.CURRPICTURE)).delete();
- }
- }
-
// Remove it from the queue of viewed tabs.
mTabQueue.remove(t);
return true;