Add ANR internal stop reason.

Bug: 258236856
Bug: 261999509
Test: atest CtsJobSchedulerTestCases
Change-Id: I2920fe66fcc8b5110abda6d84728a35b2dec0d13
This commit is contained in:
Kweku Adams
2023-01-12 20:55:00 +00:00
parent b3fb718c2d
commit 0100539658

View File

@@ -104,6 +104,12 @@ public class JobParameters implements Parcelable {
*/
public static final int INTERNAL_STOP_REASON_USER_UI_STOP =
JobProtoEnums.INTERNAL_STOP_REASON_USER_UI_STOP; // 11.
/**
* The app didn't respond quickly enough from JobScheduler's perspective.
* @hide
*/
public static final int INTERNAL_STOP_REASON_ANR =
JobProtoEnums.INTERNAL_STOP_REASON_ANR; // 12.
/**
* All the stop reason codes. This should be regarded as an immutable array at runtime.
@@ -128,6 +134,7 @@ public class JobParameters implements Parcelable {
INTERNAL_STOP_REASON_RTC_UPDATED,
INTERNAL_STOP_REASON_SUCCESSFUL_FINISH,
INTERNAL_STOP_REASON_USER_UI_STOP,
INTERNAL_STOP_REASON_ANR,
};
/**
@@ -149,6 +156,7 @@ public class JobParameters implements Parcelable {
case INTERNAL_STOP_REASON_RTC_UPDATED: return "rtc_updated";
case INTERNAL_STOP_REASON_SUCCESSFUL_FINISH: return "successful_finish";
case INTERNAL_STOP_REASON_USER_UI_STOP: return "user_ui_stop";
case INTERNAL_STOP_REASON_ANR: return "anr";
default: return "unknown:" + reasonCode;
}
}