From b770b86d78c6bdb5c2d79a6cb2e8ec390d3d9f69 Mon Sep 17 00:00:00 2001 From: Kweku Adams Date: Fri, 24 Mar 2023 17:15:00 +0000 Subject: [PATCH] Update setNotification documentation. Clarify what the contents of the notification should be and fix an API link. Bug: 19536175 Test: Run `m offline-sdk-docs` and check page at out/target/common/docs/offline-sdk/reference/android/app/job/JobService.html Change-Id: Ic1471eb28097aff99567b3b9425f173da569f614 --- .../framework/java/android/app/job/JobService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apex/jobscheduler/framework/java/android/app/job/JobService.java b/apex/jobscheduler/framework/java/android/app/job/JobService.java index 2ab432488df53..47763fbf440b5 100644 --- a/apex/jobscheduler/framework/java/android/app/job/JobService.java +++ b/apex/jobscheduler/framework/java/android/app/job/JobService.java @@ -424,11 +424,14 @@ public abstract class JobService extends Service { * 10 seconds after {@link #onStartJob(JobParameters)} is called, * the system will trigger an ANR and stop this job. * + * The notification must provide an accurate description of the work that the job is doing + * and, if possible, the state of the work. + * *

* Note that certain types of jobs - * (e.g. {@link JobInfo.Builder#setDataTransfer data transfer jobs}) may require the - * notification to have certain characteristics and their documentation will state - * any such requirements. + * (e.g. {@link JobInfo.Builder#setEstimatedNetworkBytes(long, long) data transfer jobs}) + * may require the notification to have certain characteristics + * and their documentation will state any such requirements. * *

* JobScheduler will not remember this notification after the job has finished running,