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

Commit 9f6044a2 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Don't resume PowerStatsDataStorage read on Exception

If there is a problem with the PowerStatsDataStorage file, the read
should end, instead of catching the excpetion and resuming.

Fixes: 192639542
Test: atest PowerStatsServiceTest (the logcat should not be spammed with
many PowerStats errors)

Change-Id: If2617ab13a8177b75142d52bcad458f80eb5ed2c
parent 72922c8a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -124,12 +124,8 @@ public class PowerStatsDataStorage {
        @Override
        public void read(InputStream in) throws IOException {
            while (in.available() > 0) {
                try {
                DataElement dataElement = new DataElement(in);
                mCallback.onReadDataElement(dataElement.getData());
                } catch (IOException e) {
                    Slog.e(TAG, "Failed to read from storage. " + e.getMessage());
                }
            }
        }
    }