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