8 Commits

Author SHA1 Message Date
Jiwen 'Steve' Cai
d28e8283d3 ANativeWindow_toSurface implementation
This enables the conversion from an ANativeWindow (created by NDK API
such as: AImageReader_create) to a Java Surface, so that developers can
hookup a Java Producer to a native buffer consumer.

This CL also introduces android_view_Surface_createFromSurface helper
function in libandroid_runtime to convert a C++ sp<Surface> to a Java
Surface object.

Bug: 36862948
Test: android.media.cts.NativeImageReaderTest
Change-Id: Ia99adb654da505ac117a8e58153ac800df23a650
2017-04-03 19:13:31 -07:00
Peng Xu
63483ad252 Parameter checks for sensor NDK APIs, fix map file
* Add parameter check for all sensor NDK APIs.
* Added a previously added API (from AOSP contribution) to
  libandroid.map.txt file.

Test: SensorNativeTest pass
Change-Id: I6482a684767034f2a31d806a4cba0d6648dcabff
2017-03-07 15:47:21 -08:00
Mathias Agopian
bce1d3b60b Revert "Remove AHardwareBuffer_ API from libandroid"
This reverts commit 8e90cc3e3adf1d84b92b0b165193762cc8bb295d.

Both ANativeWindow and AHardwareBuffer need to be
available in libandroid (as well as libnativewindow)
otherwise it would make our developer’s life
very difficult when they want to support multiple
versions of android.

Moreover, this would have an impact on AndroidStudio
when doing an NDK project.

Test: compiled
Bug: treble

Change-Id: I2cc63b06b3f80fa80f7170ba2ba2996228fa9b2c
2017-03-02 18:55:39 -08:00
Mathias Agopian
8e90cc3e3a Remove AHardwareBuffer_ API from libandroid
It’s now in libnativewindow. Also tag
ANativeWindow_ symbols as removed (no-op currently)


Test: compiled
Bug: treble
Change-Id: I912a7d09b35f25cf7d33d224f42b9779a3e0ae71
2017-03-01 20:24:21 +00:00
Peng Xu
3b17017346 Add direct sensor report NDK API
Added libandroid mapping and implementation of the following API:

  * ASensorManager_configureDirectReport
  * ASensorManager_createSharedMemoryDirectChannel
  * ASensorManager_createHardwareBufferDirectChannel
  * ASensorManager_destroyDirectChannel
  * ASensor_getHighestDirectReportRateLevel
  * ASensor_isDirectChannelTypeSupported

Test:  cts-tradefed run cts --module CtsSensorTestCases \
      --test android.hardware.cts.SensorNativeTest

Bug: 30985702
Change-Id: Ic808cc50d1ecbc789944ef77a4b247dc0c83c28a
2017-02-28 17:30:47 -08:00
Peng Xu
5f88ac5cce Added implementation of shared memory NDK API
Implemeneted the following APIs:

*  int ASharedMemory_create(const char *name, size_t size);
*  size_t ASharedMemory_getSize(int fd);
*  int ASharedMemory_setProt(int fd, int prot);

Test: cts-tradefed run cts --module CtsSensorTestCases \
      --test android.hardware.cts.SensorNativeTest
Bug: 5995644, 30985702

Change-Id: I645b35e67293673efce9bb90f042ec0d3b83aa42
2017-02-24 02:42:51 -08:00
Craig Donner
0cff9d955e AHardwareBuffer implementation.
Bug: 34050596
Test: Added gunit tests in CTS (CtsNativeHardwareTestCases)
Change-Id: I41f914a6d346fbb5f818a6591c86e7bf12f0576c
2017-01-19 17:01:19 -08:00
Dan Albert
2a8d9c20bd Migrate libandroid.so to ndk_library.
Test: make native
Bug: http://b/30465923
Change-Id: I956b5014c4da4dce1ce28da706b9d868eba4cce3
2016-09-27 13:59:04 -07:00