From 35647888f3be4f479515539062eabcd2dace96c5 Mon Sep 17 00:00:00 2001 From: Ritesh Reddy Date: Tue, 22 Dec 2015 19:10:08 +0000 Subject: [PATCH] Stopped closing state file descriptors after use The oldState and newState ParcelFileDescriptors and their file streams should not be closed after use as they are reused by the BackupHelper's invoker. Change-Id: I737fce7153168a52ff2818d682d81f3ee6f37369 --- src/com/android/launcher3/LauncherBackupHelper.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/com/android/launcher3/LauncherBackupHelper.java b/src/com/android/launcher3/LauncherBackupHelper.java index 2d11d3af12..48d9351ab5 100644 --- a/src/com/android/launcher3/LauncherBackupHelper.java +++ b/src/com/android/launcher3/LauncherBackupHelper.java @@ -1103,12 +1103,6 @@ public class LauncherBackupHelper implements BackupHelper { } } catch (IOException e) { Log.w(TAG, "failed to close the journal", e); - } finally { - try { - inStream.close(); - } catch (IOException e) { - Log.w(TAG, "failed to close the journal", e); - } } return journal; } @@ -1142,7 +1136,6 @@ public class LauncherBackupHelper implements BackupHelper { outStream = new FileOutputStream(newState.getFileDescriptor()); final byte[] journalBytes = writeCheckedBytes(journal); outStream.write(journalBytes); - outStream.close(); if (VERBOSE) Log.v(TAG, "wrote " + journalBytes.length + " bytes of journal"); } catch (IOException e) { Log.w(TAG, "failed to write backup journal", e);