summaryrefslogtreecommitdiffstats
path: root/native/include
Commit message (Collapse)AuthorAgeFilesLines
* am c339fe30: am be6ab576: Merge "Fix application launch shortcuts." into ics-mr1Jeff Brown2011-11-291-0/+4
|\ | | | | | | | | * commit 'c339fe302bc5083f0a110569eec06676be511088': Fix application launch shortcuts.
| * Fix application launch shortcuts.Jeff Brown2011-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improved quick launch bookmarks to support category-based shortcuts instead of hardcoding package and class names for all apps. Added a set of Intent categories for typical applications on the platform. Added support for some of the HID application launch usages to reduce reliance on quick launch for special purpose keys. Some keyboard vendors have hardcoded launch keys that synthesize "Search + X" type key combos. The goal is to encourage them to stop doing this by implementing more of HID. Bug: 5674723 Change-Id: I79f1147c65a208efc3f67228c9f0fa5cd050c593
* | Merge "Remove obsolete NativeWindow_fromSurfaceTexture"Glenn Kasten2011-11-151-8/+0
|\ \
| * | Remove obsolete NativeWindow_fromSurfaceTextureGlenn Kasten2011-10-211-8/+0
| |/ | | | | | | Change-Id: I9351103929da515cb411fb2e7906bb9f27c4da20
* | NDK: ANativeActivity: Fix documentation for 'clazz' member.David 'Digit' Turner2011-11-081-1/+8
|/ | | | | | | | | | | As discussed on the android-ndk forum, it turns out that the member named 'clazz' is really a global reference to the NativeActivity instance. As such, it's really a handle to a VM object, not a VM class. Ideally, we would rename it to 'activity', but this cannot be done without breaking NDK source compatibility. Change-Id: I82ca1549b35346a3eacf9e84c4c836387fc883a6
* fix the float Rect in OpenGLRenderer to handle NANsMathias Agopian2011-09-191-0/+3
| | | | | | | | | | | | | | | - we want functions like isEmpty() to return true if NANs are involved in the Rect - also clean-up the intersect familly of calls - minor cleanup in the int32_t Rect as well These played a role in http://b/5331198. Bug: 5331198 Change-Id: I5369725ab482e4b83da9f1bd4cee5256e5de75b2
* Input system bug fixes, particularly for stylus.Jeff Brown2011-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 5049148 Finished stylus support, including support for indirect stylus and mouse tools. Added TILT axis. When stylus tilt X/Y is available, it is transformed into an orientation and tilt inclination which is a more convenient representation and a simpler extension to the exiting API. Touch devices now only report touch data using a single input source. Previously touch devices in pointer mode would report both absolute touch pad data and cooked pointer gestures. Now we just pick one. The touch device switches modes as needed when the focused application enables/disables pointer gestures. This change greatly simplifies the code and reduces the load on the input dispatcher. Fixed an incorrect assumption that the value of ABS_(MT_)DISTANCE would be zero whenever the stylus was in direct contact. It appears that the correct way to determine whether the stylus is in direct contact (rather than hovering) is by checking for a non-zero reported pressure. Added code to read the initial state of tool buttons and axis values when the input devices are initialized or reset. This fixes problems where the input mapper state might have the wrong initial state. Moved responsibility for cancelling pending inputs (keys down, touches, etc.) to the InputDispatcher by sending it a device reset notification. This frees the InputReader from having to synthesize events during reset, which was cumbersome and somewhat brittle to begin with. Consolidated more of the common accumulator logic from SingleTouchInputMapper and MultiTouchInputMapper into TouchInputMapper. Improved the PointerLocation output. Change-Id: I595d3647f7fd7cb1e3eff8b3c76b85043b5fe2f0
* Handle stylus buttons and tool types.Jeff Brown2011-07-251-2/+1
| | | | | | | | | | | | | | | | Added TOOL_TYPE_ERASER. Refactored the InputReader to share more code between the various input mappers that handle button states and to simplify the accumulator implementations by having each one only handle a single type of input. Removed the concept of direct/indirect tool types from the API. If we add it back, it should be done in a manner that is orthogonal to the tool type itself, perhaps as a flags field on the pointer. The device source may well provide sufficient information anyhow. Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
* move lock/unlock implementaion outside of Surface into SurfaceTextureClientMathias Agopian2011-07-151-1/+7
| | | | | | | | | | This makes ANativeWindow_lock/ANativeWindow_unlockAndPost work with ANativeWindows implemented by Surface and SurfaceTextureClient. Also, Surface now inherits directly from SurfaceTextureClient. Bug: 5003724 Change-Id: I9f285877c7bae9a262e9a7af91c2bae78804b2ef
* Hover and stylus API cleanup.Jeff Brown2011-06-271-1/+0
| | | | | | | Added missing setOnHoverListener method. Removed BUTTON_STATE_ERASER. Change-Id: I5d820d0a8e47fe5fd2d88e9fd9fc3fc6ce0dea0d
* resolved conflicts for merge of 54cb63e2 to masterDianne Hackborn2011-06-021-0/+1
|\ | | | | | | Change-Id: I5b741a1781e3f76c03fc1534ffce871117effd10
| * Add "tv" density for 720p screens.Dianne Hackborn2011-05-271-0/+1
| | | | | | | | Change-Id: I028969b007f2fceea66947d77a2ae31ef1d1a630
* | resolved conflicts for merge of bbca8133 to masterDianne Hackborn2011-05-241-0/+1
|\ \ | |/ | | | | Change-Id: I81493674dceab848e41d380a77a37e5a9be06db6
| * Add "television" mode.Dianne Hackborn2011-05-231-0/+1
| | | | | | | | Change-Id: Ida1fdb61b036a8b489dbeda196fb4bc82e651b2b
* | resolved conflicts for merge of 06a8ceac to masterDianne Hackborn2011-05-191-0/+40
|\ \ | |/ | | | | Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
| * Add new "-swNNNdp" resource qualifier.Dianne Hackborn2011-05-191-0/+40
| | | | | | | | Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
* | Add initial API for stylus and mouse buttons.Jeff Brown2011-05-131-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the concept of pointer properties in a MotionEvent. This is currently used to track the pointer tool type to enable applications to distinguish finger touches from a stylus. Button states are also reported to application as part of touch events. There are no new actions for detecting changes in button states. The application should instead query the button state from the MotionEvent and take appropriate action as needed. A good time to check the button state is on ACTION_DOWN. As a side-effect, applications that do not support multiple buttons will treat primary, secondary and tertiary buttons identically for all touch events. The back button on the mouse is mapped to KEYCODE_BACK and the forward button is mapped to KEYCODE_FORWARD. Added basic plumbing for the secondary mouse button to invoke the context menu, particularly in lists. Added clamp and split methods on MotionEvent to take care of common filtering operations so we don't have them scattered in multiple places across the framework. Bug: 4260011 Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
* | Add Java API for writing TTS enginesBjorn Bringert2011-04-151-313/+0
| | | | | | | | | | | | | | | | | | | | This removes the old non-public C++ API for TTS engines and replaces it with a Java API. The new API is still @hidden, until it has been approved. Bug: 4148636 Change-Id: I7614ff788e11f897e87052f684f1b4938d539fb7
* | ANativeWindow_setBuffersGeometry now returns proper error codesMathias Agopian2011-03-311-0/+3
| | | | | | | | Change-Id: Iac59d513fa1d4a55b8378000714d344ef3e2e0a4
* | Add MotionEvent.HOVER_ENTER and HOVER_EXIT.Jeff Brown2011-03-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input dispatcher sends a HOVER_ENTER to a window before dispatching it any HOVER_MOVE events. For compatibility reasons, the window will *also* receive the HOVER_MOVE. When the pointer moves into a different window or the pointer goes down or when events are canceled for some reason, the input dispatcher sends a HOVER_EXIT to the previously hovered window. The view hierarchy behavior is similar. All views under the pointer receive onHoverEvent with HOVER_ENTER followed by any number of HOVER_MOVE events. When the pointer leaves a view, the view receives HOVER_EXIT. Similarly, if a parent view decides to capture hover by returning true from onHoverEvent, the hovered descendants will receive HOVER_EXIT. The default behavior of onHoverEvent is to update the view's hovered state by calling setHovered(true/false). Views can query their current hovered state using isHovered(). For testing purposes, the hovered state is mapped to the pressed drawable state. This will change in a subsequent commit with the introduction of a new hovered drawable state. Change-Id: Ib76a7a90236c8f2c7336e55773acade6346cacbe
* | Merge "Fix an incorrect NDK function prototype."Jeff Brown2011-03-181-2/+4
|\ \
| * | Fix an incorrect NDK function prototype.Jeff Brown2011-03-161-2/+4
| |/ | | | | | | | | | | | | | | | | The function definition includes a history_index parameter but it was missing from the header file. So the function declaration must be fixed. Bug: 4108565 Change-Id: I7bacfacb28fdd51ffc80ae016c1b6ebb51fbd66f
* | Add 3D mode key and others.Jeff Brown2011-03-161-0/+3
|/ | | | | | Related to an AOSP change request. Change-Id: I3f4f84b56a1af626a8783f5ecbb823eb12ba9fbe
* Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1Glenn Kasten2011-03-111-0/+8
|\
| * Bug 3515073 Add ANativeWindow_fromSurfaceTextureGlenn Kasten2011-03-041-0/+8
| | | | | | | | | | | | This is similar to ANativeWindow_fromSurface. Change-Id: Iaadc06a5d0d50685c34876aa89488c16e7cfaa65
* | Joystick tweaks. (DO NOT MERGE)Jeff Brown2011-03-041-0/+5
|/ | | | | | | | | | | | | | | | | | Ensure that the joystick can always reach -1.0, 0.0 and 1.0 positions even when noise filtering is applied. (Bug: 3514510) Add support for a few more standard axes. Add additional mapping modes for axes. Some axes are inverted from standard interpretation or are actually intended to be split into two distict axes such as left/right trigger controls or accelerator/brake. Add key layout file for a G25 racing wheel and XBox 360 controller to tweak behavior. They work fine without them but the axis mappings are not ideal. Change-Id: I0fddd90309af4dc14d35f34fe99ed6e521c0b7c7
* Fade out the mouse pointer after inactivity or other events.Jeff Brown2011-03-021-1/+2
| | | | | | | | | | | | | | 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
* Add support for mouse hover and scroll wheel.Jeff Brown2011-02-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Dispatch ACTION_HOVER_MOVE and ACTION_SCROLL through the View hierarchy as onGenericTouchEvent. Pointer events dispatched this way are delivered to the view under the pointer. Non-pointer events continue to be delivered to the focused view. Added scroll wheel support to AbsListView, ScrollView, HorizontalScrollView and WebView. Shift+VSCROLL is translated to HSCROLL as appropriate. Added logging of new pointer events in PointerLocationView. Fixed a problem in EventHub when a USB device is removed that resulted in a long stream of ENODEV errors being logged until INotify noticed the device was gone. Note that the new events are not supported by wallpapers at this time because the wallpaper engine only delivers touch events. Make all mouse buttons behave identically. (Effectively we only support one button.) Change-Id: I9ab445ffb63c813fcb07db6693987b02475f3756
* Add new hover move action and scroll wheel plumbing.Jeff Brown2011-02-191-1/+7
| | | | | | | | | | | | Added support for tracking the mouse position even when the mouse button is not pressed. To avoid confusing existing applications, mouse movements are reported using the new ACTION_HOVER_MOVE action when the mouse button is not pressed. Added some more plumbing for the scroll wheel axes. The values are reported to Views but they are not yet handled by the framework. Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
* Add new axes for joysticks and mouse wheels.Jeff Brown2011-02-191-0/+30
| | | | | | | | | | | | | | | | | | Added API on InputDevice to query the set of axes available. Added API on KeyEvent and MotionEvent to convert keycodes and axes to symbolic name strings for diagnostic purposes. Added API on KeyEvent to query if a given key code is a gamepad button. Added a new "axis" element to key layout files to specify the mapping between raw absolute axis values and motion axis ids. Expanded the axis bitfield to 64bits to allow for future growth. Modified the Makefile for keyboard prebuilts to run the keymap validation tool during the build. Added layouts for two game controllers. Added default actions for game pad button keys. Added more tests. Fixed a bunch of bugs. Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
* Fix a regression with MotionEvent parceling.Jeff Brown2011-02-171-25/+25
| | | | | | Also added some more unit tests. Change-Id: I413654294d1a998eec056884e6df5eaa50f3daf4
* Add support for arbitrary axes in MotionEvents.Jeff Brown2011-02-151-12/+38
| | | | | | | | | | | 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 "Add joystick support to framework."Jeff Brown2011-01-172-0/+19
|\
| * Add joystick support to framework.Jeff Brown2011-01-172-0/+19
| | | | | | | | Change-Id: I95374436708752e1a9cff3f85c5b9bc3e0987961
* | Add API to get path to OBBs.Dianne Hackborn2011-01-161-0/+7
|/ | | | | | | | | Also hide the bitmap thumbnail stuff, we can't support it in its current form. And fix some bugs with propagating paths to native code. Yikes! Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
* Introduce NDK API for 64-bit assetsKenny Root2010-12-131-1/+38
| | | | | | | Assets were switched to using 64-bit all through the system, so switch the NDK to using this new API as well. Change-Id: I2817b11369db3a4dd504b839ef1a3a9780b83533
* Add support for fallback keycodes.Jeff Brown2010-12-072-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add new keycodes initially used for GoogleTV devices.Jason Bayer2010-11-111-0/+22
| | | | Change-Id: I1b901037d6d401931dd3ec6f7d5e1e6ad165d1c9
* Rename the locked meta key constants for clarity.Jeff Brown2010-11-051-6/+6
| | | | | | Also added some tests for LED setting. Change-Id: I3fd86322afd07ae8de52d1ccbc2fae2c6d586641
* Add plumbing for volume mute key.Jeff Brown2010-11-021-1/+1
| | | | | | | | Full support for the volume mute key will be implemented in a later change. Bug: 2912307 Change-Id: I98c27d6360f159c8b7447e04b45f442eff87b38a
* am 1b98a9e6: am 5219dd8e: Merge "add format parameter to setBufferGeometry" ↵Mathias Agopian2010-10-261-1/+1
|\ | | | | | | into gingerbread
| * add format parameter to setBufferGeometryMathias Agopian2010-10-251-1/+1
| | | | | | | | Change-Id: I7cc2acdc6e65e9468ecfd5b2f22e6b495a383be9
* | am c2f78020: am 23656899: Merge "Fix issue #3126018: No way to specify ↵Dianne Hackborn2010-10-241-2/+30
|\ \ | |/ | | | | | | | | | | | | | | NativeActivity\'s native method" into gingerbread Merge commit 'c2f78020d3887539fc90230d96465e4b1dc84d8e' * commit 'c2f78020d3887539fc90230d96465e4b1dc84d8e': Fix issue #3126018: No way to specify NativeActivity's native method
| * Merge "Fix issue #3126018: No way to specify NativeActivity's native method" ↵Dianne Hackborn2010-10-241-2/+30
| |\ | | | | | | | | | into gingerbread
| | * Fix issue #3126018: No way to specify NativeActivity's native methodDianne Hackborn2010-10-241-2/+30
| | | | | | | | | | | | Change-Id: I59de6a543e7f7f45d963a905829a3f56f32bf8cf
* | | am 2ef36763: am 860c2df4: Merge "Add unit tests for native input and fix ↵Jeff Brown2010-10-241-0/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | bugs identified." into gingerbread Merge commit '2ef36763700eff5679d6012e7f078c57f1a4c465' * commit '2ef36763700eff5679d6012e7f078c57f1a4c465': Add unit tests for native input and fix bugs identified.
| * | Add unit tests for native input and fix bugs identified.Jeff Brown2010-10-231-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a bug where we would lose the first touch point when swiping out of the virtual key area. Fixed a bug where we would not send an ACTION_MOVE event in cases where individual pointers went down/up and the remaining pointers actually moved. This is important since many applications do not handle pointer movements during ACTION_POINTER_DOWN or ACTION_POINTER_UP. In the case of ACTION_POINTER_UP the movement was completely lost since all pointers were dispatched using their old location rather than the new location. Improved motion event validation to check for duplicate pointer ids. Added an input source constant that was missing from the NDK api but defined in the framework api. Added a timestamp when reporting added/removed devices in EventHub. Bug: 3070082 Change-Id: I3206a030f43b7616e2f48006e5a9d522c4d92e56
* | am 86f1b643: am bf5efba2: Merge "Fix issue #3117918: No way to finish a ↵Dianne Hackborn2010-10-211-0/+6
|\ \ | |/ | | | | | | | | | | | | | | native activity" into gingerbread Merge commit '86f1b643d10e0b5b17ae01db3b81020db87b3295' * commit '86f1b643d10e0b5b17ae01db3b81020db87b3295': Fix issue #3117918: No way to finish a native activity
| * Fix issue #3117918: No way to finish a native activityDianne Hackborn2010-10-211-0/+6
| | | | | | | | Change-Id: Ic53e712f7ab5412d72a31b96ecba252344b91644
* | Add keycodes and meta-key modifiers to support external keyboards.Jeff Brown2010-10-152-1/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new key maps for external keyboards. These maps are intended to be shared across devices by inheriting the "keyboards.mk" product makefile as part of the device's product definition. One of the trickier changes here was to unwind some code in MetaKeyKeyListener that assumed that only the low 8 bits of the meta key state were actually used. The new code abandons bitshifts in favor of simple conditionals that are probably easier to read anyways. The special meta key state constants used by MetaKeyKeyListener are now (@hide) defined in KeyEvent now so as to make it clearer that they share the same code space even if those codes are not valid for KeyEvents. The EventHub now takes care of detecting the appropriate key layout map and key character map when the device is added and sets system properties accordingly. This avoids having duplicate code in KeyCharacterMap to probe for the appropriate key character map although the current probing mechanism has been preserved for legacy reasons just in case. Added support for tracking caps lock, num lock and scroll lock and turning their corresponding LEDs on and off as needed. The key character map format will need to be updated to correctly support PC style external keyboard semantics related to modifier keys. That will come in a later change so caps lock doesn't actually do anything right now except turn the shiny LEDs on and off... Added a list of symbolic key names to KeyEvent and improved the toString() output for debug diagnosis. Having this list in a central place in the framework also allows us to remove it from Monkey so there is one less thing to maintain when we add new keycodes. Bug: 2912307 Change-Id: If8c25e8d50a7c29bbf5d663c94284f5f86de5da4