Commit Graph

11 Commits

Author SHA1 Message Date
Elliott Hughes
cdf349cf11 Add missing <stdlib.h> include to the native app glue.
On LP64, this could have caused the top bits of the pointer returned by
malloc to be lost because sizeof(int) != sizeof(void*).

Change-Id: I866a5071c1d359478d020d7fa4d466b53d52edab
2015-02-19 22:41:50 -08:00
Martin Storsjo
4ff22dcdcb Fix the name of the native app glue lib in a header comment
The incorrect name is misleading and confusing.

Change-Id: I4040d7bc10370c440401dd9de7e1fc472830287a
2014-07-27 22:15:58 +03:00
Michael Wright
a7d5ca6b2e Stop errors being logged erroneously on event predispatch
Change-Id: Ie4d15a7d01b9d63e7db16a2701024e6108eb0cc0
2013-04-22 18:11:08 -07:00
David 'Digit' Turner
0d92cf5450 ndk: Fix potential event handling issue in android_native_app_glue
Developers report that concurrent events generated from different
sources/devices can lead to application freezes then ANRs.

See https://code.google.com/p/android/issues/detail?id=41755

where it is suggested that handling all incoming events in
the "process_input" callback solves the issue. Hence this patch
implements the suggestion, however it's unclear whether this
solves the symptom, or the root cause of the problem.

Change-Id: Ic6b0ad05d192763a6d8842c8befcb87db9714a3c
2013-03-20 11:13:38 +01:00
David 'Digit' Turner
98f56b100c ndk: disable logs in release builds of native_app_glue library.
This patch disables all the logs from the 'native_app_glue' helper
library (used to implement native activities with the NDK), unless
you're building a debug build.

Change-Id: Iaad9d7c48a392ec119704074ab76e131d7806adb
2012-01-05 16:41:09 +01:00
David 'Digit' Turner
95ae335fd5 native_app_glue: fix APP_CMD_TERM_WINDOW pre-hook
The window field must not be set to NULL in the pre-hook, only the
post-one. See http://code.google.com/p/android/issues/detail?id=14352

Change-Id: Ib6214d47c97766bf4a5e148b6b6707e08366fe36
2011-02-02 00:54:02 +01:00
David 'Digit' Turner
3c7c38b2bb NDK: Last cleanup of the platform headers
- fix a declaration omission in 3/<grp.h>
- add missing 8/<err.h>
- simplify 8/<stdio.h>
- update 9/ headers to the latest Bionic versions
- fix a typo in android_native_app_glue.h
- use __BEGIN_DECLS .. __END_DECLS whenever possible.
- remove C++-style comments from headers

Change-Id: I58b98b3973cde494436206194ba33416a11ca8ee
2010-11-04 04:07:16 -07:00
Jeff Brown
9f44e97108 Update NDK headers and samples to sync up with looper API changes.
Change-Id: I7082603bf280888be90dc4df687521aaae9b1d02
2010-09-14 02:02:15 -07:00
Dianne Hackborn
d3d58cf7d3 Update to follow ALooper ident change.
Also the native-activity sample also has some very simple code showing
how to listen to the accelerometer.

Change-Id: I0629b8bc40cddd66233c1675cd5e8b42a9b722d8
2010-09-07 15:47:35 -07:00
Dianne Hackborn
79b946e8f2 Some native activity sample code cleanup.
Update to include newest headers and library, tweak glue code to
work better with state saving and add support for config changes.

Change-Id: I4d27bd4a0f542f217efaec86cf4f219aca020426
2010-08-11 00:31:37 -07:00
David 'Digit' Turner
4948c16366 Remove prebuilt static library "libthreaded_app.a".
Make the "glue library" part of the NDK as an importable module,
this has several benefits:

- no need to distribute a binary here with no easy way to regenerate it

- no need to explicitely list -lthreaded_app in your LOCAL_LDLIBS
  (this is handled automatically by the module import capability)

- allows easier native debugging of what's really happening.

Note that the header is renamed <threaded_native_app.h>

+ Modify the native-activity sample to use and import the new module
+ Start documenting usage in the header file. We probably need something
  better, and will probably put it under development/ndk/docs/ at some
  point.

After this patch, we should be able to get rid of the code under
framework/base/native/{include.glue}

Change-Id: I6e81d70a225a6ca006beabf6e8b42529e8f371b9
2010-07-13 23:50:02 -07:00