summaryrefslogtreecommitdiffstats
path: root/services/jni
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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
* Add support for USB accessory serial numbersMike Lockwood2011-03-141-1/+2
| | | | | Change-Id: I47b79f091b300ced60bfc61eff2f771139663aae Signed-off-by: Mike Lockwood <lockwood@android.com>
* 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>
* | 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
* 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
* Improve support for external keyboards.Jeff Brown2010-12-021-72/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Use Vendor ID, Product ID and optionally the Version to locate keymaps and configuration files for external devices. Moved virtual key definition parsing to native code so that EventHub can identify touch screens with virtual keys and load the appropriate key layout file. Cleaned up a lot of old code in EventHub. Fixed a regression in ViewRoot's fallback event handling. Fixed a minor bug in FileMap that caused it to try to munmap or close invalid handled when released if the attempt to map the file failed. Added a couple of new String8 conveniences for formatting strings. Modified Tokenizer to fall back to open+read when mmap fails since we can't mmap sysfs files as needed to open the virtual key definition files in /sys/board_properties/. Change-Id: I6ca5e5f9547619fd082ddac47e87ce185da69ee6
* Ensure the ShortcutManager uses the correct key character map.Jeff Brown2010-11-301-48/+65
| | | | | | | | | | | | | | | | | The ShortcutManager used to only receive the key code of the key event that triggered the shortcut. This change now provides the shortcut manager with the whole key event so it can look up the associated character using the correct key character map. To make this more efficient, added a mechanism for recycling key events. At the moment it is only used by key events owned by the system process, since clients of the existing API (such as Views) might continue to hold on to key events after dispatch has finished so they would break if the key event were recycled by the framework. Deprecated KeyCharacterMap.BUILT_IN_KEYBOARD. Change-Id: I4313725dd63f2be01c350c005a41c7fde9bc67e8
* Support non-orientation aware keyboards and other devices.Jeff Brown2010-11-301-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Fixed a bug with dpad keys on external keyboards being rotated according to the display orientation by adding a new input device configuration property called "keyboard.orientationAware". Added a mechanism for overriding the key layout and key character map in the input device configuration file using the new "keyboard.layout" and "keyboard.characterMap" properties. Also added "trackball.orientationAware", "touch.orientationAware" and "touch.deviceType" configuration properties. Rewrote the configuration property reading code in native code so that it can be used by EventHub and other components. Added basic support for installable idc, kl, and kcm files in /data/system/devices. However, there is no provision for copying files there yet. Disabled long-press character pickers on full keyboards so that key repeating works as expected. Change-Id: I1bd9f0c3d344421db444e7d271eb09bc8bab4791
* Tell system server whether the app handled input events.Jeff Brown2010-11-081-0/+29
| | | | | | | | | | Refactored ViewRoot, NativeActivity and related classes to tell the dispatcher whether an input event was actually handled by the application. This will be used to move more of the global default key processing into the system server instead of the application. Change-Id: If06b98b6f45c543e5ac5b1eae2b3baf9371fba28
* Add API to find out if there is a vibrator.Dianne Hackborn2010-11-041-0/+6
| | | | Change-Id: If29f6ee19448222433cad9fad325d0095a8e5737
* Fix policy issues when screen is off.Jeff Brown2010-11-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote interceptKeyBeforeQueueing to make the handling more systematic. Behavior should be identical except: - We never pass keys to applications when the screen is off and the keyguard is not showing (the proximity sensor turned off the screen). Previously we passed all non-wake keys through in this case which caused a bug on Crespo where the screen would come back on if a soft key was held at the time of power off because the resulting key up event would sneak in just before the keyguard was shown. It would then be passed through to the dispatcher which would poke user activity and wake up the screen. - We propagate the key flags when broadcasting media keys which ensures that recipients can tell when the key is canceled. - We ignore endcall or power if canceled (shouldn't happen anyways). Changed the input dispatcher to not poke user activity for canceled events since they are synthetic and should not wake the device. Changed the lock screen so that it does not poke the wake lock when the grab handle is released. This fixes a bug where the screen would come back on immediately if the power went off while the user was holding one of the grab handles because the sliding tab would receive an up event after screen turned off and release the grab handles. Fixed a couple of issues where media keys were being handled inconsistently or not at all, particularly in the case of the new PAUSE, PLAY and RECORD keys. Bug: 3144874 Change-Id: Ie630f5fb6f128cfdf94845f9428067045f42892c
* am faebca7f: am c9fa90f9: Merge "GPS: remove some logging" into gingerbreadMike Lockwood2010-10-281-4/+0
|\ | | | | | | | | * commit 'faebca7f4319950927759163a703dd12f2727460': GPS: remove some logging
| * am c9fa90f9: Merge "GPS: remove some logging" into gingerbreadMike Lockwood2010-10-281-4/+0
| |\ | | | | | | | | | | | | * commit 'c9fa90f94b664589d584bb433e748e2b01b368c9': GPS: remove some logging
| | * GPS: remove some loggingMike Lockwood2010-10-281-4/+0
| | | | | | | | | | | | | | | Change-Id: Ib2dca53364c9da207a87f2664b54d2ec1d1bd8d9 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | am c20f205d: am 5bfef1ba: Merge "BatteryService: Set bool to true if sysfs ↵Jean-Baptiste Queru2010-10-211-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | entry is not 0" Merge commit 'c20f205d1059ff71b21d9c44ea147e209c364d2f' * commit 'c20f205d1059ff71b21d9c44ea147e209c364d2f': BatteryService: Set bool to true if sysfs entry is not 0
| * | am 5bfef1ba: Merge "BatteryService: Set bool to true if sysfs entry is not 0"Jean-Baptiste Queru2010-10-201-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '5bfef1ba0501e237b3a0fa1abe98e5348d8c5b04' into gingerbread-plus-aosp * commit '5bfef1ba0501e237b3a0fa1abe98e5348d8c5b04': BatteryService: Set bool to true if sysfs entry is not 0
| | * | BatteryService: Set bool to true if sysfs entry is not 0Axel Haslam2010-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the musb to recognized as online, the musbOnline value has to be set. The battery driver sets the online property of the sysfs as "3" when the charger type is USB. The way the current code is, if the value is not 1, musbOnline would be false and the menu to mount the sdcard on the pc would not pop-up. Since the linux driver returns 0 if the cable is not connected, and 3 if the cable is connected, we should set the boolean variable to 0 only if the sysfs value is 0, otherwise we set it to true. Change-Id: I538d8de446e7ea4f620ffcce156a57cf56b5a4e5 Signed-off-by: Axel Haslam <axelhaslam@ti.com>
* | | | am 8333d591: am 5d5a9db5: Merge "GPS: Enable some more logging" into gingerbreadMike Lockwood2010-10-191-1/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | Merge commit '8333d59133da8e56cfb5465c767e89c61ede28bc' * commit '8333d59133da8e56cfb5465c767e89c61ede28bc': GPS: Enable some more logging
| * | | am 5d5a9db5: Merge "GPS: Enable some more logging" into gingerbreadMike Lockwood2010-10-181-1/+2
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | Merge commit '5d5a9db514a9cf42fbc189fc3af6da602d89b747' into gingerbread-plus-aosp * commit '5d5a9db514a9cf42fbc189fc3af6da602d89b747': GPS: Enable some more logging
| | * | GPS: Enable some more loggingMike Lockwood2010-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I7d13c859002fa96fa8c361c0c709931c6b12eb99 Signed-off-by: Mike Lockwood <lockwood@google.com>
* | | | am 258d0e80: am 0d65a3fc: Merge "Screen on/off animation tweaks" into ↵Joe Onorato2010-10-161-3/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | gingerbread Merge commit '258d0e805ee63685b807b5dae43efc5ecc97179e' * commit '258d0e805ee63685b807b5dae43efc5ecc97179e': Screen on/off animation tweaks
| * | | am 0d65a3fc: Merge "Screen on/off animation tweaks" into gingerbreadJoe Onorato2010-10-141-3/+3
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | Merge commit '0d65a3fc075b7dbdbfaba6b570217d87e307d75f' into gingerbread-plus-aosp * commit '0d65a3fc075b7dbdbfaba6b570217d87e307d75f': Screen on/off animation tweaks
| | * | Screen on/off animation tweaksJoe Onorato2010-10-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Pass to surface flinger whether we want animations or not. - Don't use the animation when the screen goes off because of the prox sensor. - Turn the screen-on animation back off - Also, now the animation setting controls whether or not we do the animation. Bug: 3097475 Bug: 3098508 Change-Id: I205d5564d6668b33a8dc1c40d8cc06c4aad305cf
* | | | am 1442818a: am c792c2e9: Merge "GPS: Remove unnecessary and broken test in ↵Mike Lockwood2010-10-141-3/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | AgpsRilInterface updateNetworkState glue" into gingerbread Merge commit '1442818a10988cc011f55104e997474b5d3d2468' * commit '1442818a10988cc011f55104e997474b5d3d2468': GPS: Remove unnecessary and broken test in AgpsRilInterface updateNetworkState glue
| * | | am c792c2e9: Merge "GPS: Remove unnecessary and broken test in ↵Mike Lockwood2010-10-131-3/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | AgpsRilInterface updateNetworkState glue" into gingerbread Merge commit 'c792c2e9edb3c785208560b6961ac6ed5b07eb4e' into gingerbread-plus-aosp * commit 'c792c2e9edb3c785208560b6961ac6ed5b07eb4e': GPS: Remove unnecessary and broken test in AgpsRilInterface updateNetworkState glue
| | * | Merge "GPS: Remove unnecessary and broken test in AgpsRilInterface ↵Mike Lockwood2010-10-131-3/+1
| | |\ \ | | | | | | | | | | | | | | | updateNetworkState glue" into gingerbread