Merge "Close InputStream in BatteryStatsHelper" into nyc-dev

This commit is contained in:
Nimrod Gileadi
2016-03-02 09:17:20 +00:00
committed by Android (Google) Code Review

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);