Skip to content

Commit

Permalink
Fix "You're trying to build a job with no constraints, this is not al…
Browse files Browse the repository at this point in the history
…lowed." error when starting a JobService on Android < Q.

(cherry picked from commit 5d1466b)
  • Loading branch information
Docile-Alligator committed Aug 22, 2024
1 parent 4105d8c commit bf4889a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public static JobInfo constructJobInfo(Context context, long contentEstimatedByt
.build();
} else {
return new JobInfo.Builder(JOB_ID++, new ComponentName(context, DownloadMediaService.class))
.setOverrideDeadline(0)
.setExtras(extras)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static JobInfo constructJobInfo(Context context, long contentEstimatedByt
.build();
} else {
return new JobInfo.Builder(JOB_ID++, new ComponentName(context, DownloadRedditVideoService.class))
.setOverrideDeadline(0)
.setExtras(extras)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public static JobInfo constructJobInfo(Context context, long contentEstimatedByt
.build();
} else {
return new JobInfo.Builder(JOB_ID++, new ComponentName(context, EditProfileService.class))
.setOverrideDeadline(0)
.setExtras(extras)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public static JobInfo constructJobInfo(Context context, long contentEstimatedByt
.build();
} else {
return new JobInfo.Builder(JOB_ID++, new ComponentName(context, SubmitPostService.class))
.setOverrideDeadline(0)
.setExtras(extras)
.build();
}
Expand Down

0 comments on commit bf4889a

Please sign in to comment.