summaryrefslogtreecommitdiffstats
path: root/services/jni
Commit message (Collapse)AuthorAgeFilesLines
* Initial checkin of spot presentation for touchpad gestures.Jeff Brown2011-04-191-58/+68
| | | | | | | | | | | | | | | | | | | | Added a new PointerIcon API (hidden for now) for loading pointer icons. Fixed a starvation problem in the native Looper's sendMessage implementation which caused new messages to be posted ahead of old messages sent with sendMessageDelayed. Redesigned the touch pad gestures to be defined in terms of more fluid finger / spot movements. The objective is to reinforce the natural mapping between fingers and spots which means there must not be any discontinuities in spot motion relative to the fingers. Removed the SpotController stub and folded its responsibilities into PointerController. Change-Id: I5126b1e69d95252fda7f2a684c9287e239a57163
* More native code cleanup.Elliott Hughes2011-04-121-20/+12
| | | | | | | | Don't keep unused global references to classes, don't throw exceptions when an exception is already pending, and fix a (harmless) misunderstanding about how GetStringChars works. Change-Id: Ie445036f057daa8a1c76aceb7bad2a84fb81d820
* Merge "You don't need to poke around inside FileDescriptor manually."Elliott Hughes2011-04-111-25/+4
|\
| * You don't need to poke around inside FileDescriptor manually.Elliott Hughes2011-04-111-25/+4
| | | | | | | | | | | | | | | | | | | | We can help you with that. Note also that getParcelFileDescriptorFD did no such thing. All its callers were passing in a regular java.io.FileDescriptor and expecting the int. No ParcelFileDescriptors involved. Change-Id: Idc233626f20c092e719f152562601f406cc1b64a
* | Add a sprite controller.Jeff Brown2011-04-111-6/+28
|/ | | | | | | | | | | | | | | | | | Refactored PointerController to extract the surface management code to a new component called a SpriteController so that it can be used to move finger tracking spots around the screen as well. The SpriteController is designed to fully decouple the client from any latency introduced by surface transactions and drawing. All sprite updates are performed asynchronously on the Looper using a copy of the sprite state. Added a stub SpotController implementation for touch pad UX. It will be implemented in a subsequent patch. Fixed a little bug in pointer orientation changes when entering DISPLAY_ORIENTATION_90 the x offset was clobbered. Change-Id: Ib25d162d577c9b354cb74d5d761c3c9f9f438d42
* Don't use local ref for cached jclass reference in JNI codeBrian Carlstrom2011-04-061-2/+2
| | | | | Change-Id: Id45b2acb358a819f2fd332e99f3a095f6fc7299b related-to-bug: 4241138
* Add input filter mechanism for accessibility.Jeff Brown2011-03-301-4/+54
| | | | | | | | | | | | | | | | | | | This patch adds a mechanism for capturing, filtering, transforming and injecting input events at a very low level before the input dispatcher attempts to deliver them to applications. At this time, the mechanism is only intended to be used by the accessibility system to implement built-in system-level accessibility affordances. The accessibility input filter is currently just a stub. It logs the input events receives and reinjects them unchanged, except that it transforms KEYCODE_Q into KEYCODE_Z. Currently, the accessibility input filter is installed whenever accessibility is enabled. We'll probably want to change that so it only enables the input filter when a screen reader is installed and we want touch exploration. Change-Id: I35764fdf75522b69d09ebd78c9766eb7593c1afe
* Merge "Support chorded fallback keys."Jeff Brown2011-03-291-2/+6
|\
| * Support chorded fallback keys.Jeff Brown2011-03-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also be more careful about canceling fallback keys during focus transitions, when the application handles the key, or when the policy decides to do something different. Fixed a crash due to JNI CallObjectMethod returning an undefined value (not null) when an exception is thrown. Fixed a crash due to the policy trying to create a Dialog for recent apps on the dispatcher thread. It should happen on the policy's Looper instead. Bug: 4187302 Change-Id: I659a3fd1bd2325ed36d965f9beb75dacb89790c9
* | am 038c7297: am b115807a: am 7661dd8d: Merge "UsbService: Fix JNI local ↵Mike Lockwood2011-03-281-1/+8
|\ \ | | | | | | | | | | | | | | | | | | reference leaks in the USB host support code" into honeycomb-mr1 * commit '038c7297c9e2e4b6cdb490ac9fe7102da434278a': UsbService: Fix JNI local reference leaks in the USB host support code
| * | UsbService: Fix JNI local reference leaks in the USB host support codeMike Lockwood2011-03-271-1/+8
| | | | | | | | | | | | | | | | | | | | | Bug: 4175857 Change-Id: I8b385f2257e509b0fb4d5f9516e9813b8165352d Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | merge libsurfaceflinger_client into libguiMathias Agopian2011-03-251-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | this is the first step in unifying surfacetexture and surface. for this reason the header files were not moved, as most of them will eventually go away. NOTE: currently we keep libsurfaceflinger_client.so as an empty library to workaround prebuilt binaries wrongly linking against it. Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
* | Fix focused application handle.Jeff Brown2011-03-251-0/+1
| | | | | | | | | | | | | | | | | | | | Fix a bug where we were always setting the focused application handle to NULL. This broke ANR processing while starting applications and caused input events to be dropped while starting applications. Bug: 4174573 Change-Id: Icd7b8c4c49ed73c41978f3ff076c2e5cd839a802
* | am 14438b81: am 970bad67: am be368de7: Merge "Fix missing AOSP copyright ↵James Dong2011-03-171-0/+16
|\ \ | |/ | | | | | | | | | | headers for more files" into honeycomb-mr1 * commit '14438b81a1fe4d7ebdf8977f3d80a1dd1867c5ad': Fix missing AOSP copyright headers for more files
| * Fix missing AOSP copyright headers for more filesJames Dong2011-03-171-0/+16
| | | | | | | | | | | | | | | | | | | | o Update the copyright date on InputDispatcher_test.cpp and InputReader_test.cpp because these two files were moved from other places to the current location, and were actually created in 2010. bug - 4119349 Change-Id: Ic93b81ddafb58e9e72a2e9e02ca3d9f173d6dca7
* | Merge "Improve VelocityTracker numerical stability."Jeff Brown2011-03-151-4/+3
|\ \
| * | Improve VelocityTracker numerical stability.Jeff Brown2011-03-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced VelocityTracker with a faster and more accurate native implementation. This avoids the duplicate maintenance overhead of having two implementations. The new algorithm requires that the sample duration be at least 10ms in order to contribute to the velocity calculation. This ensures that the velocity is not severely overestimated when samples arrive in bursts. The new algorithm computes the exponentially weighted moving average using weights based on the relative duration of successive sample periods. The new algorithm is also more careful about how it handles individual pointers going down or up and their effects on the collected movement traces. The intent is to preserve the last known velocity of pointers as they go up while also ensuring that other motion samples do not count twice in that case. Bug: 4086785 Change-Id: I2632321232c64d6b8faacdb929e33f60e64dcdd3
* | | am 0958fb10: am 221830b9: Merge "Add support for USB accessory serial ↵Mike Lockwood2011-03-141-1/+2
|\ \ \ | |/ / |/| / | |/ | | | | | | numbers" into honeycomb-mr1 * commit '0958fb1068ee1b5e6c40eee16d943a664b1124b4': Add support for USB accessory serial numbers
| * Add support for USB accessory serial numbersMike Lockwood2011-03-141-1/+2
| | | | | | | | | | Change-Id: I47b79f091b300ced60bfc61eff2f771139663aae Signed-off-by: Mike Lockwood <lockwood@android.com>
* | am 84edf14b: am cc08c439: Merge "UsbAccessory: Add URI string, replace type ↵Mike Lockwood2011-03-101-2/+3
|\ \ | |/ | | | | | | | | | | string with description" into honeycomb-mr1 * commit '84edf14b62eaf3304252bb76b0b2ca3f518c8d54': UsbAccessory: Add URI string, replace type string with description
| * Merge "UsbAccessory: Add URI string, replace type string with description" ↵Mike Lockwood2011-03-101-2/+3
| |\ | | | | | | | | | into honeycomb-mr1
| | * UsbAccessory: Add URI string, replace type string with descriptionMike Lockwood2011-03-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first step toward adding USB accessory URI support BUG: 4073248 Modified USB accessory matching logic to look only at manufacturer, model and version (description and URI are not considered when matching apps to accessories) Also added test for USB accessory protocol version to accessorytest BUG: 4080288 Change-Id: I992a3433c74efa7a7db37bf030f02c1f0c92f9e2 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | am e6f0ae12: am efd3266b: Input improvements and bug fixes.Jeff Brown2011-03-091-5/+4
|\ \ \ | |/ / | | | | | | | | | * commit 'e6f0ae12b18819424dd8395b433a8fc9caefa77b': Input improvements and bug fixes.
| * | Input improvements and bug fixes.Jeff Brown2011-03-091-5/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Associate each motion axis with the source from which it comes. It is possible for multiple sources of the same device to define the same axis. This fixes new API that was introduced in MR1. (Bug: 4066146) Fixed a bug that might cause a segfault when using a trackball. Only fade out the mouse pointer when touching the touch screen, ignore other touch pads. Changed the plural "sources" to "source" in several places in the InputReader where we intend to refer to a particular source rather than to a combination of sources. Improved the batching code to support batching events from different sources of the same device in parallel. (Bug: 3391564) Change-Id: I0189e18e464338f126f7bf94370b928e1b1695f2
| * Eliminate some accidental log spam. (DO NOT MERGE)Jeff Brown2011-03-081-3/+3
| | | | | | | | | | | | Used #ifdef where I should have used #if. Change-Id: Ie3a083d601c89f4fc4d83244bb5060a202574dc2
* | Merge "Remove unused JNI global references."Carl Shapiro2011-03-086-87/+75
|\ \
| * | Remove unused JNI global references.Carl Shapiro2011-03-056-87/+75
| |/ | | | | | | Change-Id: Ie4886ab66538e293832c3bc3d6023e34304a2d21
* | Eliminate some accidental log spam.Jeff Brown2011-03-071-3/+3
|/ | | | | | Used #ifdef where I should have used #if. Change-Id: I4cc84484dd508b0ec1a01858d8bd62ec92f23de1
* Get key repeat timeout and delay from ViewConfiguration.Jeff Brown2011-03-021-3/+37
| | | | | | | | | | Replaces previously hardcoded values. This ensures that key repeat takes the accessibility long press timeout setting into account. Unfortunately the system must be rebooted for the change to take effect. We will fix that later. Change-Id: I3ab70bb037331620b7e532170c1727287b5c6f91
* Wake screen from external HID peripherals.Jeff Brown2011-03-021-17/+52
| | | | | | | | | | | | | | | | | | Added some plumbing to enable the policy to intercept motion events when the screen is off to handle wakeup if needed. Added a basic concept of an external device to limit the scope of the wakeup policy to external devices only. The wakeup policy for internal devices should be based on explicit rules such as policy flags in key layout files. Moved isTouchEvent to native. Ensure the dispatcher sends the right event type to userActivity for non-touch pointer events like HOVER_MOVE and SCROLL. Bug: 3193114 Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
* Fade out the mouse pointer after inactivity or other events.Jeff Brown2011-03-021-8/+54
| | | | | | | | | | | | | | Fades out the mouse pointer: - after 15 seconds of inactivity normally - after 3 seconds of inactivity in lights out mode - after a non-modifier key down - after a touch down Extended the native Looper to support enqueuing time delayed messages. This is used by the PointerController to control pointer fade timing. Change-Id: I87792fea7dbe2d9376c78cf354fe3189a484d9da
* UsbManager: Enhancements for managing USB devices and accessoriesMike Lockwood2011-02-281-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a USB device or accessory is connected, the UsbService now asks the user which application to associate with the device or accessory. Applications interested in devices or accessories must specify the devices they work with via meta-data attached to their manifest. Permission to communicate with the device is assigned when the user chooses the activity to use for the device. The user has the option of clicking the "always use this application" checkbox to make the assignment automatic in the future. The user may later clear this preference and revoke permission for an application to have permission to communicate with the device by clicking the "Clear defaults" button for the activity in the Manage Applications panel in Settings. Added class UsbResolveActivity (a subclass or ResolveActivity for choosing an activity for a USB device or accessory) Added UsbDeviceManager, which manages the mapping between USB devices/accessories and applications, including default applications for devices and accessories, and manages application permissions. Add interface to allow Settings to clear device and accessory preferences and permissions for an application. Remove obsolete ACCESS_USB permission. Add new signatureOrSystem MANAGE_USB permission to allow administrating preferences and permissions. Moved UsbService.java to a "usb" subdirectory, along with new classes UsbResolveActivity and UsbDeviceManager. Change-Id: I92554381e9779e68ce380daaee4e1401fb875703 Signed-off-by: Mike Lockwood <lockwood@android.com>
* GpsLocationProvider: Clean up HAL initialization/cleanup sequenceMike Lockwood2011-02-231-141/+83
| | | | | Change-Id: Id5467000f3f3da5cbe1f112dad97a032688d2eac Signed-off-by: Mike Lockwood <lockwood@android.com>
* Start window manager refactoring.Dianne Hackborn2011-02-175-21/+21
| | | | | | Move all of the pieces into a new com.android.server.wm package. Change-Id: I942b7bcfb84ee0f843f47d58e55ffc5a93c0da94
* Merge "Add support for arbitrary axes in MotionEvents."Jeff Brown2011-02-161-4/+0
|\
| * Add support for arbitrary axes in MotionEvents.Jeff Brown2011-02-151-4/+0
| | | | | | | | | | | | | | | | | | | | | | This change makes it possible to extend the set of axes that are reported in MotionEvents by defining new axis constants. The MotionEvent object is now backed by its C++ counterpart to avoid having to maintain multiple representations of the same data. Change-Id: Ibe93c90d4b390d43c176cce48d558d20869ee608
* | Merge "UsbManager: New APIs for USB accessories"Mike Lockwood2011-02-161-1/+65
|\ \
| * | UsbManager: New APIs for USB accessoriesMike Lockwood2011-02-161-1/+65
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB accessories are peripherals that connect to android devices as a USB host. When connected, the accessory will first identify itself to the android device by sending manufacturer, product, accessory type and version strings to the device, and then request the device to enter USB accessory mode. The device will then enable the USB accessory kernel driver and disable all other USB functionality except possibly adb (adb can be used while the android device is connected to the PC and the PC is running software that emulates a USB accessory) The class android.hardware.UsbAccessory is used to describe the currently attached USB accessory. UsbAccessory contains the manufacturer, product, accessory type and version strings to identify the accessory. The accessory can be opened as a ParcelFileDescriptor, which can be used to communicate with the accessory over two bulk endpoints. The Intents UsbManager.USB_ACCESSORY_ATTACHED and UsbManager.USB_ACCESSORY_DETACHED are broadcast when accessories are connected and disconnected to the device. The USB_ACCESSORY_ATTACHED contains a UsbAccessory object for the attached accessory as an extra. The Intent also contains string extras for the manufacturer, product, accessory type and version strings to allow filtering on these strings. Change-Id: Ie77cbf51814a4aa44a6b1e62673bfe4c6aa81755 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Clean up use of HAVE_ANDROID_OSKenny Root2011-02-162-7/+7
|/ | | | | | | | HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0" for non-targets. Changing them to #ifdef should be safe and matches all the other uses of HAVE_ANDROID_OS throughout the system. Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
* New APIs for USB host support:Mike Lockwood2011-01-223-0/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | UsbManager: - is now a service retrievable via Context.getSystemService(Context.USB_SERVICE). - provides support for returning a list all connected USB devices - broadcasts ACTION_USB_DEVICE_ATTACHED and USB_DEVICE_DETACHED when devices are added and removed from the USB host bus UsbDevice: - represents an attached USB device. UsbInterface: - represents an interface on a USB device - devices may have multiple interfaces if they provide multiple sets of functionality (for example, android phones typically have interfaces for both USB mass storage and adb) UsbEndpoint: - represents an endpoint on a USB interface - endpoints are used for sending or receiving data (only in one or the other direction) UsbRequest: - encapsulates a send or receive request to be sent over an endpoint Change-Id: Ieef3e434c62760770ea839070cf5eba1a705967a Signed-off-by: Mike Lockwood <lockwood@android.com>
* Filter virtual keys after touches.Jeff Brown2011-01-181-1/+25
| | | | | | | | | | | | | | | Adds a new virtualKeyQuietTimeMillis configuration resource that sets the duration for which virtual keys will be dropped after recent touches on screen. The default value is 0; it is intended to be overridden per device using a resource overlay. This change is designed to help in two cases: 1. Swipes from touchscreen into virtual key area. 2. Accidental taps in virtual key area while using on-screen keyboard. Bug: 3089163 Change-Id: Ib912d4f8a4df9966a39cd537d3ec7c24afab7225
* Support non-rectangular input regions.Jeff Brown2011-01-161-47/+15
| | | | | | | | This enables the system bar to carve out a region through which events will be sent to the IME behind it. Bug: 3238092 Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
* Prevent events from getting backlogged.Jeff Brown2011-01-1011-411/+840
| | | | | | | | | | | | | | | | | | | | | | | | This change implements two heuristics. 1. When events are older than 10 seconds, they are dropped. 2. If the application is currently busy processing an event and the user touches a window belonging to a different application then we drop the currently queued events so the other application can start processing the gesture immediately. Note that the system takes care of synthesizing cancelation events automatically for any events that it drops. Added some new handle types to allow the native dispatcher to indirectly refer to the WindowManager's window state and app window token. This was done to enable the dispatcher to identify the application to which each window belongs but it also eliminates some lookup tables and linear searches through the window list on each key press. Bug: 3224911 Change-Id: I9dae8dfe23d195d76865f97011fe2f1d351e2940
* Temporarily remove UsbManager support for USB host.Mike Lockwood2011-01-063-177/+0
| | | | | | | A new USB host API will be added in an upcoming commit Change-Id: I5816c10c7acd236d31ab8ae255fc83c77121eea0 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Mouse pointer integration.Jeff Brown2011-01-042-353/+56
| | | | | | | | | | Added support for loading the pointer icon from a resource. Moved the system server related bits of the input manager out of libui and into libinput since they do not need to be linked into applications. Change-Id: Iec11e0725b3add2b905c51f8ea2c3b4b0d1a2d67
* Merge "Add initial support for cursor-based pointing devices."Jeff Brown2010-12-291-32/+421
|\
| * Add initial support for cursor-based pointing devices.Jeff Brown2010-12-291-32/+421
| | | | | | | | | | | | | | Some parts stubbed out but you can plug in a mouse and move a green cursor around to interact with the UI. Change-Id: I80d597a7f11d3bd92041890f74b3c77326975e6e
* | Change libusbhost and libmtp from static to shared librariesMike Lockwood2010-12-291-12/+11
|/ | | | | Change-Id: Iccc67db32400cdeb88aa33261c9e0cf73db992ca Signed-off-by: Mike Lockwood <lockwood@android.com>
* Rename android.hardware.Usb to UsbManager and UsbObserver to UsbServiceMike Lockwood2010-12-093-10/+10
| | | | | | | In preparation for an upcoming change that will make UsbService into a real system service Change-Id: Id85d624cfc6b10b49a08105cfaaacc667a492c12 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Add support for fallback keycodes.Jeff Brown2010-12-071-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This change enables the framework to synthesize key events to implement default behavior when an application does not handle a key. For example, this change enables numeric keypad keys to perform their associated special function when numlock is off. The application is informed that it is processing a fallback keypress so it can choose to ignore it. Added a new keycode for switching applications. Added ALT key deadkeys. New default key mappings: - ESC -> BACK - Meta+ESC -> HOME - Alt+ESC -> MENU - Meta+Space -> SEARCH - Meta+Tab -> APP_SWITCH Fixed some comments. Fixed some tests. Change-Id: Id7f3b6645f3a350275e624547822f72652f3defe