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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user