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