Loading packages/CrashRecovery/services/module/java/com/android/server/PackageWatchdog.java +19 −1 Original line number Diff line number Diff line Loading @@ -1304,7 +1304,7 @@ public class PackageWatchdog { /** Dump status of every observer in mAllObservers. */ public void dump(@NonNull PrintWriter pw) { if (Flags.synchronousRebootInRescueParty() && RescueParty.isRecoveryTriggeredReboot()) { if (Flags.synchronousRebootInRescueParty() && isRecoveryTriggeredReboot()) { dumpInternal(pw); } else { synchronized (sLock) { Loading @@ -1313,6 +1313,24 @@ public class PackageWatchdog { } } /** * Check if we're currently attempting to reboot during mitigation. This method must return * true if triggered reboot early during a boot loop, since the device will not be fully booted * at this time. * @hide */ public static boolean isRecoveryTriggeredReboot() { return isFactoryResetPropertySet() || isRebootPropertySet(); } private static boolean isFactoryResetPropertySet() { return CrashRecoveryProperties.attemptingFactoryReset().orElse(false); } private static boolean isRebootPropertySet() { return CrashRecoveryProperties.attemptingReboot().orElse(false); } private void dumpInternal(@NonNull PrintWriter pw) { IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); ipw.println("Package Watchdog status"); Loading Loading
packages/CrashRecovery/services/module/java/com/android/server/PackageWatchdog.java +19 −1 Original line number Diff line number Diff line Loading @@ -1304,7 +1304,7 @@ public class PackageWatchdog { /** Dump status of every observer in mAllObservers. */ public void dump(@NonNull PrintWriter pw) { if (Flags.synchronousRebootInRescueParty() && RescueParty.isRecoveryTriggeredReboot()) { if (Flags.synchronousRebootInRescueParty() && isRecoveryTriggeredReboot()) { dumpInternal(pw); } else { synchronized (sLock) { Loading @@ -1313,6 +1313,24 @@ public class PackageWatchdog { } } /** * Check if we're currently attempting to reboot during mitigation. This method must return * true if triggered reboot early during a boot loop, since the device will not be fully booted * at this time. * @hide */ public static boolean isRecoveryTriggeredReboot() { return isFactoryResetPropertySet() || isRebootPropertySet(); } private static boolean isFactoryResetPropertySet() { return CrashRecoveryProperties.attemptingFactoryReset().orElse(false); } private static boolean isRebootPropertySet() { return CrashRecoveryProperties.attemptingReboot().orElse(false); } private void dumpInternal(@NonNull PrintWriter pw) { IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); ipw.println("Package Watchdog status"); Loading