Merge "Close InputStream in BatteryStatsHelper" into nyc-dev

am: c14893bf5a

* commit 'c14893bf5a2ad76ad6279f09b66020610e32041f':
  Close InputStream in BatteryStatsHelper
This commit is contained in:
Nimrod Gileadi
2016-03-02 09:24:38 +00:00
committed by android-build-merger

View File

@@ -754,8 +754,7 @@ public final class BatteryStatsHelper {
try {
ParcelFileDescriptor pfd = service.getStatisticsStream();
if (pfd != null) {
FileInputStream fis = new ParcelFileDescriptor.AutoCloseInputStream(pfd);
try {
try (FileInputStream fis = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) {
byte[] data = readFully(fis, MemoryFile.getSize(pfd.getFileDescriptor()));
Parcel parcel = Parcel.obtain();
parcel.unmarshall(data, 0, data.length);