• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.annotation.Nullable;
20 import android.hardware.display.DisplayViewport;
21 import android.view.InputEvent;
22 import android.view.inputmethod.InputMethodInfo;
23 import android.view.inputmethod.InputMethodSubtype;
24 
25 /**
26  * Input manager local system service interface.
27  *
28  * @hide Only for use within the system server.
29  */
30 public abstract class InputManagerInternal {
injectInputEvent(InputEvent event, int displayId, int mode)31     public abstract boolean injectInputEvent(InputEvent event, int displayId, int mode);
32 
33     /**
34      * Called by the display manager to set information about the displays as needed
35      * by the input system.  The input system must copy this information to retain it.
36      */
setDisplayViewports(DisplayViewport defaultViewport, DisplayViewport externalTouchViewport)37     public abstract void setDisplayViewports(DisplayViewport defaultViewport,
38             DisplayViewport externalTouchViewport);
39 
40     /**
41      * Called by the power manager to tell the input manager whether it should start
42      * watching for wake events.
43      */
setInteractive(boolean interactive)44     public abstract void setInteractive(boolean interactive);
45 
46     /**
47      * Notifies that InputMethodManagerService switched the current input method subtype.
48      *
49      * @param userId user id that indicates who is using the specified input method and subtype.
50      * @param inputMethodInfo {@code null} when no input method is selected.
51      * @param subtype {@code null} when {@code inputMethodInfo} does has no subtype.
52      */
onInputMethodSubtypeChanged(int userId, @Nullable InputMethodInfo inputMethodInfo, @Nullable InputMethodSubtype subtype)53     public abstract void onInputMethodSubtypeChanged(int userId,
54             @Nullable InputMethodInfo inputMethodInfo, @Nullable InputMethodSubtype subtype);
55 
56     /**
57      * Toggles Caps Lock state for input device with specific id.
58      *
59      * @param deviceId The id of input device.
60      */
toggleCapsLock(int deviceId)61     public abstract void toggleCapsLock(int deviceId);
62 
63     /**
64      * Set whether the input stack should deliver pulse gesture events when the device is asleep.
65      */
setPulseGestureEnabled(boolean enabled)66     public abstract void setPulseGestureEnabled(boolean enabled);
67 }
68