PackageUtils: Use try-with block for DigestInputStream.
Bug: 332045106
Previously, a DigestInputStream object was opened within an
ordinary try clause that was not explicitly closed, causing
potential resource leakage.
This fix changes the opening of that to be within a try-with
clause to ensure auto closure of the stream.
Test: Manual.
adb shell cmd transparency get apex_info -o
The command above was executed pre and post change to
ensure SHA256 of large files are still computed correctly
by this change.
Change-Id: Ic56dbf72ae8375e9f6897eea93f56a6148e33bc1
1 file changed