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

Commit e9be5da6 authored by Nimrod Gileadi's avatar Nimrod Gileadi
Browse files

Close InputStream in BatteryStatsHelper

Bug: 17760659
Bug: 27376093
Change-Id: I5e6471f73b3258067fb670a4b66ddc51be62b6ec
(cherry picked from commit e618b53081d9a173305b7c72cab4c2ed6ca2dcec)
parent f3179cf5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);