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
This commit is contained in:
Ritesh Reddy
2015-12-22 19:10:08 +00:00
parent 6e3cffe8ef
commit 35647888f3
@@ -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);