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

Commit 5cc865b9 authored by lijilou's avatar lijilou Committed by Jilou li
Browse files

PackageWatchdog: fix the double close issue.

1 without the IOException happen,the finishWrite method will close the stream.
2 with the IOException happen,the failWrite method will close the stream.
so,we no need to close the stream in finally method.

Bug: none
Flag: EXEMPT minor optimization
Change-Id: If2e01149499d4848ccc56323b964637c8894b658
parent 2daef7f6
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1228,8 +1228,6 @@ public class PackageWatchdog {
                Slog.w(TAG, "Failed to save monitored packages, restoring backup", e);
                mPolicyFile.failWrite(stream);
                return false;
            } finally {
                IoUtils.closeQuietly(stream);
            }
        }
    }