Set the FLAG_FROM_BACKGROUND for job bindings

So it won't reset the process error state (crash times).

Bug: 239042601
Test: Manual - crash an app, wait for its job restart
Change-Id: Ia4f1d5d69d9ac22f52069af7ee333dd6c0849d77
This commit is contained in:
Jing Ji
2022-07-15 16:54:15 -07:00
parent 062ad24921
commit cad330ef3e

View File

@@ -303,7 +303,9 @@ public final class JobServiceContext implements ServiceConnection {
getStartActionId(job), String.valueOf(job.getJobId()));
mVerb = VERB_BINDING;
scheduleOpTimeOutLocked();
final Intent intent = new Intent().setComponent(job.getServiceComponent());
// Use FLAG_FROM_BACKGROUND to avoid resetting the bad-app tracking.
final Intent intent = new Intent().setComponent(job.getServiceComponent())
.setFlags(Intent.FLAG_FROM_BACKGROUND);
boolean binding = false;
try {
final int bindFlags;