From 63b0bde4e4657220942211d2c7b2a6a8d89ca5a7 Mon Sep 17 00:00:00 2001 From: Varun Shah Date: Tue, 28 Feb 2023 23:17:18 +0000 Subject: [PATCH] Ensure RuntimeExceptions are also caught properly. While reading the proto stats from disk, AppExitInfoTracker can crash if a RuntimeException is thrown - update the catch logic. Bug: 268301239 Change-Id: I76c86d844595674ef2171c13508adb710b151dae Test: atest ApplicationExitInfoTest (cherry picked from commit c1544d4df508cc634616aff02358414546c4f56d) --- .../core/java/com/android/server/am/AppExitInfoTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/AppExitInfoTracker.java b/services/core/java/com/android/server/am/AppExitInfoTracker.java index 32d20718c1920..1ba326680fc22 100644 --- a/services/core/java/com/android/server/am/AppExitInfoTracker.java +++ b/services/core/java/com/android/server/am/AppExitInfoTracker.java @@ -674,7 +674,7 @@ public final class AppExitInfoTracker { break; } } - } catch (IOException | IllegalArgumentException | WireTypeMismatchException e) { + } catch (Exception e) { Slog.w(TAG, "Error in loading historical app exit info from persistent storage: " + e); } finally { if (fin != null) {