Enable ANR trigger for slow app responses.
When an app doesn't respond quickly enough to onStartJob or onStopJob,
JobScheduler stops tracking the job internally without giving any
indication to the app that the job is no longer considered operational.
Now, we trigger an ANR in these situations for apps targeting U+ so they
can get some signal (at least via analytics).
Bug: 258236856
Test: atest CtsJobSchedulerTestCases:JobSchedulingTest
Change-Id: If1df8cefc8dd27a2b87ea4e95ac31104477a8e8f
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
index 4c339ac..f26c3f2 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
@@ -35,7 +35,6 @@
import android.app.job.JobWorkItem;
import android.app.usage.UsageStatsManagerInternal;
import android.compat.annotation.ChangeId;
-import android.compat.annotation.Disabled;
import android.compat.annotation.EnabledAfter;
import android.content.ComponentName;
import android.content.Context;
@@ -97,9 +96,7 @@
* Whether to trigger an ANR when apps are slow to respond on pre-UDC APIs and functionality.
*/
@ChangeId
- @Disabled
- // TODO(258236856): Enable after test is fixed
- // @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.TIRAMISU)
+ @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.TIRAMISU)
private static final long ANR_PRE_UDC_APIS_ON_SLOW_RESPONSES = 258236856L;
private static final String TAG = "JobServiceContext";