From 072b95da3baff96b1eaddd67a00ce33d7c212e50 Mon Sep 17 00:00:00 2001 From: Gavin Corkery Date: Mon, 3 Feb 2020 10:30:52 +0000 Subject: [PATCH] Add disabled check immediately upon package failure Per the attached bug, there was an issue with rescue party continuously returning USER_IMPACT_LOW instead of USER_IMPACT_NONE in the case when Rescue Party is disabled. This change fixes that by returning USER_IMPACT_NONE if disabled. Test: Manual tests in attached bug Bug: 148688994 Change-Id: I12560ef01f373d6d9edea4ce616a5ab3f409be4e --- services/core/java/com/android/server/RescueParty.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/RescueParty.java b/services/core/java/com/android/server/RescueParty.java index bacffb6140eda..3e5c278a7fd43 100644 --- a/services/core/java/com/android/server/RescueParty.java +++ b/services/core/java/com/android/server/RescueParty.java @@ -393,8 +393,8 @@ public class RescueParty { @Override public int onHealthCheckFailed(@Nullable VersionedPackage failedPackage, @FailureReasons int failureReason) { - if (failureReason == PackageWatchdog.FAILURE_REASON_APP_CRASH - || failureReason == PackageWatchdog.FAILURE_REASON_APP_NOT_RESPONDING) { + if (!isDisabled() && (failureReason == PackageWatchdog.FAILURE_REASON_APP_CRASH + || failureReason == PackageWatchdog.FAILURE_REASON_APP_NOT_RESPONDING)) { return mapRescueLevelToUserImpact(getNextRescueLevel()); } else { return PackageHealthObserverImpact.USER_IMPACT_NONE;