Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 1 | /** |
| 2 | * Copyright 2014, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.app.job; |
| 18 | |
Dianne Hackborn | 7da13d7 | 2017-04-04 17:17:35 -0700 | [diff] [blame] | 19 | import android.app.job.JobWorkItem; |
| 20 | |
Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 21 | /** |
| 22 | * The server side of the JobScheduler IPC protocols. The app-side implementation |
| 23 | * invokes on this interface to indicate completion of the (asynchronous) instructions |
| 24 | * issued by the server. |
| 25 | * |
| 26 | * In all cases, the 'who' parameter is the caller's service binder, used to track |
| 27 | * which Job Service instance is reporting. |
| 28 | * |
| 29 | * {@hide} |
| 30 | */ |
| 31 | interface IJobCallback { |
| 32 | /** |
| 33 | * Immediate callback to the system after sending a start signal, used to quickly detect ANR. |
| 34 | * |
| 35 | * @param jobId Unique integer used to identify this job. |
| 36 | * @param ongoing True to indicate that the client is processing the job. False if the job is |
| 37 | * complete |
| 38 | */ |
Andrei Onea | f650e3c | 2019-02-25 13:15:54 +0000 | [diff] [blame] | 39 | @UnsupportedAppUsage |
Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 40 | void acknowledgeStartMessage(int jobId, boolean ongoing); |
| 41 | /** |
| 42 | * Immediate callback to the system after sending a stop signal, used to quickly detect ANR. |
| 43 | * |
| 44 | * @param jobId Unique integer used to identify this job. |
| 45 | * @param reschedule Whether or not to reschedule this job. |
| 46 | */ |
Andrei Onea | f650e3c | 2019-02-25 13:15:54 +0000 | [diff] [blame] | 47 | @UnsupportedAppUsage |
Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 48 | void acknowledgeStopMessage(int jobId, boolean reschedule); |
| 49 | /* |
Dianne Hackborn | 7da13d7 | 2017-04-04 17:17:35 -0700 | [diff] [blame] | 50 | * Called to deqeue next work item for the job. |
| 51 | */ |
Andrei Onea | f650e3c | 2019-02-25 13:15:54 +0000 | [diff] [blame] | 52 | @UnsupportedAppUsage |
Dianne Hackborn | 7da13d7 | 2017-04-04 17:17:35 -0700 | [diff] [blame] | 53 | JobWorkItem dequeueWork(int jobId); |
| 54 | /* |
| 55 | * Called to report that job has completed processing a work item. |
| 56 | */ |
Andrei Onea | f650e3c | 2019-02-25 13:15:54 +0000 | [diff] [blame] | 57 | @UnsupportedAppUsage |
Dianne Hackborn | 7da13d7 | 2017-04-04 17:17:35 -0700 | [diff] [blame] | 58 | boolean completeWork(int jobId, int workId); |
| 59 | /* |
Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 60 | * Tell the job manager that the client is done with its execution, so that it can go on to |
| 61 | * the next one and stop attributing wakelock time to us etc. |
| 62 | * |
| 63 | * @param jobId Unique integer used to identify this job. |
| 64 | * @param reschedule Whether or not to reschedule this job. |
| 65 | */ |
Andrei Onea | f650e3c | 2019-02-25 13:15:54 +0000 | [diff] [blame] | 66 | @UnsupportedAppUsage |
Christopher Tate | 7060b04 | 2014-06-09 19:50:00 -0700 | [diff] [blame] | 67 | void jobFinished(int jobId, boolean reschedule); |
| 68 | } |