1 /*
2  * Copyright (C) 2017 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.hardware.sidekick;
18 
19 
20 /**
21  * Sidekick local system service interface.
22  *
23  * @hide Only for use within the system server, and maybe by Clockwork Home.
24  */
25 public abstract class SidekickInternal {
26 
27     /**
28      * Tell Sidekick to reset back to newly-powered-on state.
29      *
30      * @return true on success (Sidekick is reset), false if Sidekick is not
31      * available (failed or not present). Either way, upon return Sidekick is
32      * guaranteed not to be controlling the display.
33      */
reset()34     public abstract boolean reset();
35 
36     /**
37      * Tell Sidekick it can start controlling the display.
38      *
39      * SidekickServer may choose not to actually control the display, if it's been told
40      * via other channels to leave the previous image on the display (same as SUSPEND in
41      * a non-Sidekick system).
42      *
43      * @param displayState - one of Display.STATE_DOZE_SUSPEND, Display.STATE_ON_SUSPEND
44      * @return true on success, false on failure (no sidekick available)
45      */
startDisplayControl(int displayState)46     public abstract boolean startDisplayControl(int displayState);
47 
48     /**
49      * Tell Sidekick it must stop controlling the display.
50      *
51      * No return code because this must always succeed - after return, Sidekick
52      * is guaranteed to not be controlling the display.
53      */
endDisplayControl()54     public abstract void endDisplayControl();
55 
56 }
57