blob: 582dede9574c76caca6a8e5c6c369f1c32190889 [file] [log] [blame]
Christopher Tated417d622013-08-19 16:14:25 -07001/**
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
17package android.app.maintenance;
18
19import android.app.maintenance.IIdleService;
20
21/**
22 * The server side of the idle maintenance 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 idle service instance is reporting.
28 *
29 * {@hide}
30 */
31interface IIdleCallback {
32 /**
33 * Acknowledge receipt and processing of the asynchronous "start idle work" incall.
34 * 'result' is true if the app wants some time to perform ongoing background
35 * idle-time work; or false if the app declares that it does not need any time
36 * for such work.
37 */
38 void acknowledgeStart(int token, boolean result);
39
40 /**
41 * Acknowledge receipt and processing of the asynchronous "stop idle work" incall.
42 */
43 void acknowledgeStop(int token);
44
45 /*
46 * Tell the idle service manager that we're done with our idle maintenance, so that
47 * it can go on to the next one and stop attributing wakelock time to us etc.
48 *
49 * @param opToken The identifier passed in the startIdleMaintenance() call that
50 * indicated the beginning of this service's idle timeslice.
51 */
52 void idleFinished(int token);
53}