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; |
Jeff Brown | a47425a | 2012-04-13 04:09:27 -0700 | [diff] [blame] | 22 | import android.os.IBinder; |
Jeff Brown | ac14351 | 2012-04-05 18:57:33 -0700 | [diff] [blame] | 23 | import android.view.InputDevice; |
| 24 | import android.view.InputEvent; |
| 25 | |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 26 | /** @hide */ |
| 27 | interface IInputManager { |
Jeff Brown | ac14351 | 2012-04-05 18:57:33 -0700 | [diff] [blame] | 28 | // Gets input device information. |
| 29 | InputDevice getInputDevice(int deviceId); |
| 30 | int[] getInputDeviceIds(); |
| 31 | |
| 32 | // Reports whether the hardware supports the given keys; returns true if successful |
| 33 | boolean hasKeys(int deviceId, int sourceMask, in int[] keyCodes, out boolean[] keyExists); |
| 34 | |
| 35 | // Temporarily changes the pointer speed. |
| 36 | void tryPointerSpeed(int speed); |
| 37 | |
| 38 | // Injects an input event into the system. To inject into windows owned by other |
| 39 | // applications, the caller must have the INJECT_EVENTS permission. |
| 40 | boolean injectInputEvent(in InputEvent ev, int mode); |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 41 | |
| 42 | // Keyboard layouts configuration. |
| 43 | KeyboardLayout[] getKeyboardLayouts(); |
| 44 | KeyboardLayout getKeyboardLayout(String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 45 | String getCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier); |
| 46 | void setCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | cf39bdf | 2012-05-18 14:41:19 -0700 | [diff] [blame] | 47 | String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 48 | String[] getKeyboardLayoutsForInputDevice(in InputDeviceIdentifier identifier); |
| 49 | void addKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | cf39bdf | 2012-05-18 14:41:19 -0700 | [diff] [blame] | 50 | String keyboardLayoutDescriptor); |
RoboErik | fb290df | 2013-12-16 11:27:55 -0800 | [diff] [blame] | 51 | void removeKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier, |
Jeff Brown | 9f25b7f | 2012-04-10 14:30:49 -0700 | [diff] [blame] | 52 | String keyboardLayoutDescriptor); |
Jeff Brown | af9e8d3 | 2012-04-12 17:32:48 -0700 | [diff] [blame] | 53 | |
| 54 | // Registers an input devices changed listener. |
| 55 | void registerInputDevicesChangedListener(IInputDevicesChangedListener listener); |
Jeff Brown | a47425a | 2012-04-13 04:09:27 -0700 | [diff] [blame] | 56 | |
| 57 | // Input device vibrator control. |
| 58 | void vibrate(int deviceId, in long[] pattern, int repeat, IBinder token); |
| 59 | void cancelVibrate(int deviceId, IBinder token); |
Jeff Brown | 4532e61 | 2012-04-05 14:27:12 -0700 | [diff] [blame] | 60 | } |