summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-07-25 17:59:36 +0100
committerBen Murdoch <benm@google.com>2011-07-25 19:06:26 +0100
commit679da25ab920d163b3f79a9f5410e78c98d557bc (patch)
tree12a5be4ba1cb73452687a97dffffe8d18ddb7ca3 /src/com/android/browser
parentfb72a9a98d891ecaed0f72905cebccf2faa8514f (diff)
downloadpackages_apps_Browser-679da25ab920d163b3f79a9f5410e78c98d557bc.zip
packages_apps_Browser-679da25ab920d163b3f79a9f5410e78c98d557bc.tar.gz
packages_apps_Browser-679da25ab920d163b3f79a9f5410e78c98d557bc.tar.bz2
Close FileInputStream in CrashRecoveryHandler
Fix strict mode violation. Bug: 5073242 Change-Id: I0c4c276f03428666e924f2dccf4b3e4ed8c5dbe8
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/CrashRecoveryHandler.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/browser/CrashRecoveryHandler.java b/src/com/android/browser/CrashRecoveryHandler.java
index b29ebd6..c43de34 100644
--- a/src/com/android/browser/CrashRecoveryHandler.java
+++ b/src/com/android/browser/CrashRecoveryHandler.java
@@ -35,6 +35,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.IOException;
public class CrashRecoveryHandler {
@@ -201,9 +202,10 @@ public class CrashRecoveryHandler {
private Bundle loadCrashState() {
Bundle state = null;
Parcel parcel = Parcel.obtain();
+ FileInputStream fin = null;
try {
File stateFile = new File(mContext.getCacheDir(), STATE_FILE);
- FileInputStream fin = new FileInputStream(stateFile);
+ fin = new FileInputStream(stateFile);
ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
byte[] buffer = new byte[BUFFER_SIZE];
int read;
@@ -222,6 +224,11 @@ public class CrashRecoveryHandler {
state = null;
} finally {
parcel.recycle();
+ if (fin != null) {
+ try {
+ fin.close();
+ } catch (IOException e) { }
+ }
}
return state;
}