IInputManager.aidl revision 1db5397d88e722b1ab82ccb2b429ceec1179ccd8
1/*
2 * Copyright (C) 2012 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.hardware.input;
18
19import android.hardware.input.InputDeviceIdentifier;
20import android.hardware.input.KeyboardLayout;
21import android.hardware.input.IInputDevicesChangedListener;
22import android.hardware.input.ITabletModeChangedListener;
23import android.hardware.input.TouchCalibration;
24import android.os.IBinder;
25import android.view.InputDevice;
26import android.view.InputEvent;
27
28/** @hide */
29interface IInputManager {
30    // Gets input device information.
31    InputDevice getInputDevice(int deviceId);
32    int[] getInputDeviceIds();
33
34    // Reports whether the hardware supports the given keys; returns true if successful
35    boolean hasKeys(int deviceId, int sourceMask, in int[] keyCodes, out boolean[] keyExists);
36
37    // Temporarily changes the pointer speed.
38    void tryPointerSpeed(int speed);
39
40    // Injects an input event into the system.  To inject into windows owned by other
41    // applications, the caller must have the INJECT_EVENTS permission.
42    boolean injectInputEvent(in InputEvent ev, int mode);
43
44    // Calibrate input device position
45    TouchCalibration getTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation);
46    void setTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation,
47            in TouchCalibration calibration);
48
49    // Keyboard layouts configuration.
50    KeyboardLayout[] getKeyboardLayouts();
51    KeyboardLayout getKeyboardLayout(String keyboardLayoutDescriptor);
52    String getCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier);
53    void setCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
54            String keyboardLayoutDescriptor);
55    String[] getKeyboardLayoutsForInputDevice(in InputDeviceIdentifier identifier);
56    void addKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
57            String keyboardLayoutDescriptor);
58    void removeKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
59            String keyboardLayoutDescriptor);
60
61    // Registers an input devices changed listener.
62    void registerInputDevicesChangedListener(IInputDevicesChangedListener listener);
63
64    // Registers a tablet mode change listener
65    void registerTabletModeChangedListener(ITabletModeChangedListener listener);
66
67    // Input device vibrator control.
68    void vibrate(int deviceId, in long[] pattern, int repeat, IBinder token);
69    void cancelVibrate(int deviceId, IBinder token);
70
71    void setPointerIconShape(int shapeId);
72}
73