Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 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 | |
| 17 | package android.hardware.input; |
| 18 | |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 19 | import android.hardware.input.InputDeviceIdentifier; |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 20 | import android.hardware.input.KeyboardLayout; |
Jeff Brown | af9e8d3 | 2012-04-12 17:32:48 -0700 | [diff] [blame] | 21 | import android.hardware.input.IInputDevicesChangedListener; |
Michael Wright | 39e5e94 | 2015-08-19 22:52:47 +0100 | [diff] [blame^] | 22 | import android.hardware.input.ITabletModeChangedListener; |
Jason Gerecke | d6396d6 | 2014-01-27 18:30:37 -0800 | [diff] [blame] | 23 | import android.hardware.input.TouchCalibration; |
Jeff Brown | a47425a | 2012-04-13 04:09:27 -0700 | [diff] [blame] | 24 | import android.os.IBinder; |
Jeff Brown | ac14351 | 2012-04-05 18:57:33 -0700 | [diff] [blame] | 25 | import android.view.InputDevice; |
| 26 | import android.view.InputEvent; |
| 27 | |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 28 | /** @hide */ |
| 29 | interface IInputManager { |
Jeff Brown | ac14351 | 2012-04-05 18:57:33 -0700 | [diff] [blame] | 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); |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 43 | |
Jason Gerecke | d6396d6 | 2014-01-27 18:30:37 -0800 | [diff] [blame] | 44 | // Calibrate input device position |
Jason Gerecke | d522074 | 2014-03-10 09:47:59 -0700 | [diff] [blame] | 45 | TouchCalibration getTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation); |
| 46 | void setTouchCalibrationForInputDevice(String inputDeviceDescriptor, int rotation, |
Jason Gerecke | d6396d6 | 2014-01-27 18:30:37 -0800 | [diff] [blame] | 47 | in TouchCalibration calibration); |
| 48 | |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 49 | // Keyboard layouts configuration. |
| 50 | KeyboardLayout[] getKeyboardLayouts(); |
| 51 | KeyboardLayout getKeyboardLayout(String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 52 | String getCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier); |
| 53 | void setCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | cf39bdf | 2012-05-18 14:41:19 -0700 | [diff] [blame] | 54 | String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 55 | String[] getKeyboardLayoutsForInputDevice(in InputDeviceIdentifier identifier); |
| 56 | void addKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | cf39bdf | 2012-05-18 14:41:19 -0700 | [diff] [blame] | 57 | String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 58 | void removeKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 59 | String keyboardLayoutDescriptor); |
Jeff Brown | af9e8d3 | 2012-04-12 17:32:48 -0700 | [diff] [blame] | 60 | |
| 61 | // Registers an input devices changed listener. |
| 62 | void registerInputDevicesChangedListener(IInputDevicesChangedListener listener); |
Jeff Brown | a47425a | 2012-04-13 04:09:27 -0700 | [diff] [blame] | 63 | |
Michael Wright | 39e5e94 | 2015-08-19 22:52:47 +0100 | [diff] [blame^] | 64 | // Registers a tablet mode change listener |
| 65 | void registerTabletModeChangedListener(ITabletModeChangedListener listener); |
| 66 | |
Jeff Brown | a47425a | 2012-04-13 04:09:27 -0700 | [diff] [blame] | 67 | // Input device vibrator control. |
| 68 | void vibrate(int deviceId, in long[] pattern, int repeat, IBinder token); |
| 69 | void cancelVibrate(int deviceId, IBinder token); |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 70 | } |