blob: f1e7e98ff9d81fbc39d50023042db6337e2e96db [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;
Jeff Browna47425a2012-04-13 04:09:27 -070022import android.os.IBinder;
Jeff Brownac143512012-04-05 18:57:33 -070023import android.view.InputDevice;
24import android.view.InputEvent;
25
Jeff Brown4532e612012-04-05 14:27:12 -070026/** @hide */
27interface IInputManager {
Jeff Brownac143512012-04-05 18:57:33 -070028 // 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 Brown9f25b7f2012-04-10 14:30:49 -070041
42 // Keyboard layouts configuration.
43 KeyboardLayout[] getKeyboardLayouts();
44 KeyboardLayout getKeyboardLayout(String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080045 String getCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier);
46 void setCurrentKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Browncf39bdf2012-05-18 14:41:19 -070047 String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080048 String[] getKeyboardLayoutsForInputDevice(in InputDeviceIdentifier identifier);
49 void addKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Browncf39bdf2012-05-18 14:41:19 -070050 String keyboardLayoutDescriptor);
RoboErikfb290df2013-12-16 11:27:55 -080051 void removeKeyboardLayoutForInputDevice(in InputDeviceIdentifier identifier,
Jeff Brown9f25b7f2012-04-10 14:30:49 -070052 String keyboardLayoutDescriptor);
Jeff Brownaf9e8d32012-04-12 17:32:48 -070053
54 // Registers an input devices changed listener.
55 void registerInputDevicesChangedListener(IInputDevicesChangedListener listener);
Jeff Browna47425a2012-04-13 04:09:27 -070056
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 Brown4532e612012-04-05 14:27:12 -070060}