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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user