1 /*
2  * Copyright (C) 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.hardware.input;
18 
19 import android.hardware.display.DisplayViewport;
20 import android.view.InputEvent;
21 
22 import java.util.List;
23 
24 /**
25  * Input manager local system service interface.
26  *
27  * @hide Only for use within the system server.
28  */
29 public abstract class InputManagerInternal {
30     /**
31      * Inject an input event.
32      *
33      * @param event The InputEvent to inject
34      * @param mode Synchronous or asynchronous mode
35      * @return True if injection has succeeded
36      */
injectInputEvent(InputEvent event, int mode)37     public abstract boolean injectInputEvent(InputEvent event, int mode);
38 
39     /**
40      * Called by the display manager to set information about the displays as needed
41      * by the input system.  The input system must copy this information to retain it.
42      */
setDisplayViewports(List<DisplayViewport> viewports)43     public abstract void setDisplayViewports(List<DisplayViewport> viewports);
44 
45     /**
46      * Called by the power manager to tell the input manager whether it should start
47      * watching for wake events.
48      */
setInteractive(boolean interactive)49     public abstract void setInteractive(boolean interactive);
50 
51     /**
52      * Toggles Caps Lock state for input device with specific id.
53      *
54      * @param deviceId The id of input device.
55      */
toggleCapsLock(int deviceId)56     public abstract void toggleCapsLock(int deviceId);
57 
58     /**
59      * Set whether the input stack should deliver pulse gesture events when the device is asleep.
60      */
setPulseGestureEnabled(boolean enabled)61     public abstract void setPulseGestureEnabled(boolean enabled);
62 }
63