Ensure RuntimeExceptions are also caught properly.

While reading the new proto stats, SyncStorageEngine can crash
if a RuntimeException is thrown - update the catch logic.

Bug: 242320010
Test: atest SyncStorageEngineTest
Change-Id: I1bf0ec8bae62f3f8840ad3015d71179729e407d1
This commit is contained in:
Varun Shah
2022-09-22 13:19:41 -07:00
parent 7144d64e3a
commit 89ccdb6bb1

View File

@@ -2083,7 +2083,7 @@ public class SyncStorageEngine {
try (FileInputStream in = mStatusFile.openRead()) {
readStatusInfoLocked(in);
}
} catch (IOException e) {
} catch (Exception e) {
Slog.e(TAG, "Unable to read status info file.", e);
}
}
@@ -2483,7 +2483,7 @@ public class SyncStorageEngine {
try (FileInputStream in = mStatisticsFile.openRead()) {
readDayStatsLocked(in);
}
} catch (IOException e) {
} catch (Exception e) {
Slog.e(TAG, "Unable to read day stats file.", e);
}
}