blob: c8b45c78c5b5f80bdfe6b2b78fe5ed27688a56c2 [file] [log] [blame]
Jeff Brown4532e612012-04-05 14:27:12 -07001/*
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
RoboErikfb290df2013-12-16 11:27:55 -080019import android.hardware.input.InputDeviceIdentifier;
Jeff Brown9f25b7f2012-04-10 14:30:49 -070020import android.hardware.input.KeyboardLayout;
Jeff Brownaf9e8d32012-04-12 17:32:48 -070021import android.hardware.input.IInputDevicesChangedListener;
Michael Wright39e5e942015-08-19 22:52:47 +010022import android.hardware.input.ITabletModeChangedListener;
Jason Gerecked6396d62014-01-27 18:30:37 -080023import android.hardware.input.TouchCalibration;
Jeff Browna47425a2012-04-13 04:09:27 -070024import android.os.IBinder;
Jeff Brownac143512012-04-05 18:57:33 -070025import android.view.InputDevice;
26import android.view.InputEvent;
27
Jeff Brown4532e612012-04-05 14:27:12 -070028/** @hide */
29interface IInputManager {
Jeff Brownac143512012-04-05 18:57:33 -070030 // 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);
Jeff Brown9f25b7f2012-04-10 14:30:49 -070043
Jason Gerecked6396d62014-01-27 18:30:37 -080044 // Calibrate input device position
Jason Gerecked5220742014-03-10 09:47:59 -070045 TouchCalibration getTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation);
46 void setTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation,
Jason Gerecked6396d62014-01-27 18:30:37 -080047 in TouchCalibration calibration);
48
Jeff Brown9f25b7f2012-04-10 14:30:49 -070049 // Keyboard layouts configuration.
50 KeyboardLayout[] getKeyboardLayouts();
51 KeyboardLayout getKeyboardLayout(String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080052 String getCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier);
53 void setCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Browncf39bdf2012-05-18 14:41:19 -070054 String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080055 String[] getKeyboardLayoutsForInputDevice(in InputDeviceIdentifier identifier);
56 void addKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Browncf39bdf2012-05-18 14:41:19 -070057 String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080058 void removeKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Brown9f25b7f2012-04-10 14:30:49 -070059 String keyboardLayoutDescriptor);
Jeff Brownaf9e8d32012-04-12 17:32:48 -070060
61 // Registers an input devices changed listener.
62 void registerInputDevicesChangedListener(IInputDevicesChangedListener listener);
Jeff Browna47425a2012-04-13 04:09:27 -070063
Michael Wright39e5e942015-08-19 22:52:47 +010064 // Registers a tablet mode change listener
65 void registerTabletModeChangedListener(ITabletModeChangedListener listener);
66
Jeff Browna47425a2012-04-13 04:09:27 -070067 // Input device vibrator control.
68 void vibrate(int deviceId, in long[] pattern, int repeat, IBinder token);
69 void cancelVibrate(int deviceId, IBinder token);
Jeff Brown4532e612012-04-05 14:27:12 -070070}