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
This commit is contained in:
@@ -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());
|
||||
}
|
||||
DataElement dataElement = new DataElement(in);
|
||||
mCallback.onReadDataElement(dataElement.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user