summaryrefslogtreecommitdiffstats
path: root/native
Commit message (Collapse)AuthorAgeFilesLines
* Add AStorageManager API to NDKKenny Root2010-08-203-1/+215
| | | | | | AStorageManager allows users of the NDK to access OBBs for now. Change-Id: I8a25757901a175aa90a9f3e8c2a5db7873e8615e
* More native work.Dianne Hackborn2010-08-119-12/+638
| | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* Added SensorManager.getMinDelay()Mathias Agopian2010-07-292-1/+14
| | | | | | | | | | | | | Exposed the new "min delay" sensor property through native and java sensor apis. This allows the caller to know what is the maximum rate at which a sensor can return events, or, if a sensor works in "update" mode (events returned only when the value changes). Also augmented SensorManager.regusterSensorEvent() so that it can accept a value in microsecond in addition to the 4 constants already defined. Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
* Add stdint.h to fix sim-engKenny Root2010-07-281-0/+1
| | | | Change-Id: I82cebe3e769aa4db99bd758bd2f182b0d462de6f
* Refactor input reader to support new device types more easily.Jeff Brown2010-07-282-3/+169
| | | | | | | | | | | | | | | | | | | | | | Refactored the input reader so that each raw input protocol is handled by a separate subclass of the new InputMapper type. This way, behaviors pertaining to keyboard, trackballs, touchscreens, switches and other devices are clearly distinguished for improved maintainability. Added partial support for describing capabilities of input devices (incomplete and untested for now, will be fleshed out in later commits). Simplified EventHub interface somewhat since InputReader is taking over more of the work. Cleaned up some of the interactions between InputManager and WindowManagerService related to reading input state. Fixed swiping finger from screen edge into display area. Added logging of device information to 'dumpsys window'. Change-Id: I17faffc33e3aec3a0f33f0b37e81a70609378612
* new SensorServiceMathias Agopian2010-07-192-29/+42
| | | | | | | remove old sensor service and implement SensorManager on top of the new (native) SensorManger API. Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
* Implement native key pre-dispatching to IMEs.Dianne Hackborn2010-07-152-2/+16
| | | | | | | | | | | | | | | | This significantly re-works the native key dispatching code to allow events to be pre-dispatched to the current IME before being processed by native code. It introduces one new public API, which must be called after retrieving an event if the app wishes for it to be pre-dispatched. Currently the native code will only do pre-dispatching of system keys, to avoid significant overhead for gaming input. This should be improved to be smarted, filtering for only keys that the IME is interested in. Unfortunately IMEs don't currently provide this information. :p Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
* Add support for new input sources.Jeff Brown2010-07-152-99/+205
| | | | | | | | | | | | | | | | | | | | | | | | | Added several new coordinate values to MotionEvents to capture touch major/minor area, tool major/minor area and orientation. Renamed NDK input constants per convention. Added InputDevice class in Java which will eventually provide useful information about available input devices. Added APIs for manufacturing new MotionEvent objects with multiple pointers and all necessary coordinate data. Fixed a bug in the input dispatcher where it could get stuck with a pointer down forever. Fixed a bug in the WindowManager where the input window list could end up containing stale removed windows. Fixed a bug in the WindowManager where the input channel was being removed only after the final animation transition had taken place which caused spurious WINDOW DIED log messages to be printed. Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
* Add native C APIs for working with the Asset ManagerChristopher Tate2010-07-154-0/+366
| | | | Change-Id: I493b142c4b35e5cc1a1e85283bb5dfb306a6d261
* Merge "Remove old glue code." into gingerbreadDianne Hackborn2010-07-143-553/+0
|\
| * Remove old glue code.Dianne Hackborn2010-07-143-553/+0
| | | | | | | | Change-Id: Ic4a9c1f09d9bd4258d9766d546b0999b79997635
* | Merge "first step at implementing the native sensor support" into gingerbreadMathias Agopian2010-07-142-1/+153
|\ \ | |/ |/|
| * first step at implementing the native sensor supportMathias Agopian2010-07-132-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | in this commit: - implemented the C stub - implemented the binder interfaces involved - implemented most of the C++ client side missing: - SensorManager cannot connect to the SensorServer yet (because there is no SensorServer yet) Change-Id: I75010cbeef31c98d6fa62fd5d388dcef87c2636b
* | Merge "NDK sensor API" into gingerbreadMathias Agopian2010-07-131-0/+235
|\ \ | |/
| * NDK sensor APIMathias Agopian2010-07-131-0/+235
| | | | | | | | Change-Id: Ie07afc349ca3331e065725ba9d7ebe9722959653
* | IME events are now dispatched to native applications.Dianne Hackborn2010-07-135-53/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And also: - APIs to show and hide the IME, and control its interaction with the app. - APIs to tell the app when its window resizes and needs to be redrawn. - API to tell the app the content rectangle of its window (to layout around the IME or status bar). There is still a problem with IME interaction -- we need a way for the app to deliver events to the IME before it handles them, so that for example the back key will close the IME instead of finishing the app. Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
* | Add initial gamepad support.Jeff Brown2010-07-132-106/+117
|/ | | | Change-Id: I0439648f6eb5405f200e4223c915eb3a418b32b9
* Make a stupid thing about the glue less stupid.Dianne Hackborn2010-07-092-18/+14
| | | | | | | There is no reason to make the app developer delete the glue. Seriously. Change-Id: Ic6a93ba17b44889783b35a2a0a2b67ffcd647f47
* Add ANativeWindow API for directly drawing to the surface bits.Dianne Hackborn2010-07-0911-19/+276
| | | | | | | | | | | Also other cleanup and fixes: - We now properly set the default window format to 565. - New APIs to set the window format and flags from native code. - Tweaked glue for simpler handling of the "destroy" message. - Um, other stuff. Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
* Add new glue code for writing native apps.Dianne Hackborn2010-07-087-14/+621
| | | | | | | | | | | | | | | | | This factors out the boiler-plate code from the sample app to a common glue code that can be used for everyone writing this style of app: a dedicated app thread that takes care of waiting for events and processing them. As part of doing this, ALooper has a new facility to allow registration of fds that cause ALooper_pollOnce() to return the fd that has data, allowing the app to drive the loop without callbacks. Hopefully this makes some people feel better. :) Also do some other cleanup of the ALooper API, plus some actual documentation. Change-Id: Ic53bd56bdf627e3ba28a3c093faa06a92be522b8
* Add new native Looper API.Dianne Hackborn2010-07-026-7/+150
| | | | | | | | | | | This allows us to avoid exposing the file descriptor of the event queue; instead, you attach an event queue to a looper. This will also should allow native apps to be written without the need for a separate thread, by attaching the event queue to the main thread's looper and scheduling their own messages there. Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
* Get to the point of being able to do native drawing.Dianne Hackborn2010-07-013-8/+31
| | | | | | A little cleanup. Change-Id: I37ef0557abf330d91d6fe47e81d062206b3bc346
* Make real API for native code to get its window.Dianne Hackborn2010-07-014-19/+73
| | | | | | | Added implementation to use ANativeWindow and provide it to a NativeActivity. Change-Id: I890d71b6e15d4af71e6cf81b327961d7061ec1c2
* Introduce official public NativeWindow type.Dianne Hackborn2010-06-301-0/+33
| | | | | | | Not yet hooked up to anything in the NDK, but requires renaming the existing android_native_window_t type everywhere. Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
* Implement default key handling for native code.Dianne Hackborn2010-06-301-0/+9
| | | | | | | | | The native code now maintains a list of all keys that may use default handling. If the app finishes one of these keys without handling it, the key will be passed back off to Java for default treatment. Change-Id: I6a842a0d728eeafa4de7142fae573f8c11099e18
* Update native activity & event APIs to follow correct conventions.Dianne Hackborn2010-06-293-110/+117
| | | | Change-Id: Ie64fb3a9c68bc9c117fa5621b75d1f609e304e0e
* First stab at attaching native event dispatching.Dianne Hackborn2010-06-225-0/+310
| | | | | | | | | | | | Provides the basic infrastructure for a NativeActivity's native code to get an object representing its event stream that can be used to read input events. Still work to do, probably some API changes, and reasonable default key handling (so that for example back will still work). Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
* Even more native input dispatch work in progress.Jeff Brown2010-06-171-6/+36
| | | | | | | | | | | | | | | | | Added more tests. Fixed a regression in Vector. Fixed bugs in pointer tracking. Fixed a starvation issue in PollLoop when setting or removing callbacks. Fixed a couple of policy nits. Modified the internal representation of MotionEvent to be more efficient and more consistent. Added code to skip/cancel virtual key processing when there are multiple pointers down. This helps to better disambiguate virtual key presses from stray touches (such as cheek presses). Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
* Native input dispatch rewrite work in progress.Jeff Brown2010-06-132-0/+658
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old dispatch mechanism has been left in place and continues to be used by default for now. To enable native input dispatch, edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy. Includes part of the new input event NDK API. Some details TBD. To wire up input dispatch, as the ViewRoot adds a window to the window session it receives an InputChannel object as an output argument. The InputChannel encapsulates the file descriptors for a shared memory region and two pipe end-points. The ViewRoot then provides the InputChannel to the InputQueue. Behind the scenes, InputQueue simply attaches handlers to the native PollLoop object that underlies the MessageQueue. This way MessageQueue doesn't need to know anything about input dispatch per-se, it just exposes (in native code) a PollLoop that other components can use to monitor file descriptor state changes. There can be zero or more targets for any given input event. Each input target is specified by its input channel and some parameters including flags, an X/Y coordinate offset, and the dispatch timeout. An input target can request either synchronous dispatch (for foreground apps) or asynchronous dispatch (fire-and-forget for wallpapers and "outside" targets). Currently, finding the appropriate input targets for an event requires a call back into the WindowManagerServer from native code. In the future this will be refactored to avoid most of these callbacks except as required to handle pending focus transitions. End-to-end event dispatch mostly works! To do: event injection, rate limiting, ANRs, testing, optimization, etc. Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
* Update NativeActivity to allow direct surface access.Dianne Hackborn2010-05-181-1/+114
| | | | | | No actual native API for using a surface, but it's a step. Change-Id: I627f26b705abc7a05edf9117411abfacf0fae64a
* Add new API to take over a window's Surface.Dianne Hackborn2010-05-181-5/+0
| | | | Change-Id: Iad6245faadc95f19ea63c8e229a1c02e9188f69e
* am 89ad07b0: am 42ee86e6: Merge "For issue #2651381, allow library ↵Dan Bornstein2010-05-061-2/+0
|\ | | | | | | | | | | | | | | | | prelinking." into froyo Merge commit '89ad07b048ff035394596d6a8916f639f3f0b868' into kraken * commit '89ad07b048ff035394596d6a8916f639f3f0b868': For issue #2651381, allow library prelinking.
| * For issue #2651381, allow library prelinking.Dan Bornstein2010-05-051-2/+0
| | | | | | | | Change-Id: I1cb467a158e21fc02cac6af585ac8d27c2bf42de
* | First pass at NativeActivity.Dianne Hackborn2010-05-051-0/+68
|/ | | | | | | | | | | This is a rough sketch of the new pure-native API, which you can use through a NativeActivity in your manifest (no Java code in the .apk needed!). Intentionally no docs yet, the API is still being seriously messed with. But it works. Change-Id: I0e916d58a0d159ecaf3689e41834eb8dc681c0c0
* Move the NDK graphics wrapper (libjnigraphics) to frameworks/base/nativeDima Zavin2010-02-043-0/+209
Change-Id: I2a5adde9f8e4683c4b4526a29ad276c3e581e029 Signed-off-by: Dima Zavin <dima@android.com>