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
This commit is contained in:
Gavin Corkery
2020-02-03 10:30:52 +00:00
parent e3ada502d1
commit 072b95da3b

View File

@@ -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;