Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35f94d02 authored by Ritesh Reddy's avatar Ritesh Reddy
Browse files

Stopped closing State FDs in AccountSyncSettingsBackupHelper

Stopped closing oldState and newState FDs in
AccountSyncSettingsBackupHelper so that other backups that
follow don't fail.

Bug: 26290952
Change-Id: I10f2ad699207bac8b25b47293252510e7a438b76
parent f3378a29
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -203,9 +203,8 @@ public class AccountSyncSettingsBackupHelper implements BackupHelper {
            }
            }
        } catch (EOFException eof) {
        } catch (EOFException eof) {
            // Initial state may be empty.
            // Initial state may be empty.
        } finally {
            dataInput.close();
        }
        }
        // We explicitly don't close 'dataInput' because we must not close the backing fd.
        return oldMd5Checksum;
        return oldMd5Checksum;
    }
    }


@@ -219,7 +218,10 @@ public class AccountSyncSettingsBackupHelper implements BackupHelper {


        dataOutput.writeInt(STATE_VERSION);
        dataOutput.writeInt(STATE_VERSION);
        dataOutput.write(md5Checksum);
        dataOutput.write(md5Checksum);
        dataOutput.close();

        // We explicitly don't close 'dataOutput' because we must not close the backing fd.
        // The FileOutputStream will not close it implicitly.

    }
    }


    private byte[] generateMd5Checksum(byte[] data) throws NoSuchAlgorithmException {
    private byte[] generateMd5Checksum(byte[] data) throws NoSuchAlgorithmException {