134 Commits

Author SHA1 Message Date
Dan Albert
107366ad42 Merge "Remove TTS symbols from NDK stub library." am: b056324630 am: 8d8c374307 am: 9424fad097
am: 10663e4f76

Change-Id: Ib9675e2e271bec1f2f0dfae65c915620682a9722
2017-08-22 19:27:42 +00:00
Treehugger Robot
b056324630 Merge "Remove TTS symbols from NDK stub library." 2017-08-22 18:03:10 +00:00
Dan Albert
3644edb0b6 Remove TTS symbols from NDK stub library.
These haven't actually existed in libandroid for some time. We can't
fix the past, so just remove the API from the NDK.

Test: make checkbuild
Bug: http://b/64572149
Change-Id: Ic68e81c63e738e6d341bcae6178cdcc080326da4
2017-08-22 00:15:25 -07:00
John Reck
e4f60cce85 SharedMemory API changes
Hides getFd & getFileDescriptor due to lifecycle concenrs.
Adds ASharedMemory_dupFromJava to allow sharing a shared
memory region between Java & Native as safe as possible.
Mis-use results in an FD leak instead of double-close.

Bug: 64394076
Test: SharedMemory CTS tests
Change-Id: I01a5eb978fc4e99559a79baac75754c32f13bdc4
2017-08-07 15:36:10 -07:00
Steven Moreland
2412b4d979 Merge "frameworks/base: use proper nativehelper headers" am: 826eafd958 am: 5c091dc944 am: c840945a78
am: 9f430b2782

Change-Id: Ibe321dd4a8aae9342c76da0780edf94b90e8cd3a
2017-07-20 03:11:00 +00:00
Steven Moreland
5c091dc944 Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Steven Moreland
2279b25342 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Jiyong Park
7a4f741f56 fix: android/multinetwork.h can't be imported when using libandroid_net
libandroid_net is a subset of libandroid exposing the multinetwork
functionality. Contrary to libandroid which is not available to vendors,
libandroid_net is available to vendors as ll-ndk.

However, the header path for the two libraries are different.

for libandroid:
include <android/multinetwork.h>

for libandroid_net:
include <multinetwork.h>

This is because multinetwork.h is located in
<home_of_libandroid_net>/include directory. Since many vendors are using
<android/multinetwork.h>, we need to have a subdirectory 'android'.

Bug: 63120916
Test: build
Change-Id: I1cbc6e1641edda2013c80f9b16b825f0854776c1
2017-06-29 16:53:47 +09:00
Lorenzo Colitti
e1c426f53c Merge changes from topic 'multinetwork_vndk' into oc-dev
am: cffee96a16

Change-Id: I91cac262cdb6af6e441c4750636ec28a97f2ad1a
2017-05-26 01:01:21 +00:00
Lorenzo Colitti
ec37d5f6a6 Allow vendor code to link to libandroid_net.
This library contains only the multinetwork API, which is part
of the NDK and has long-term support. It is needed by any native
that wants to use network communications on a different network
than the default network, and thus is necessary for vendor code
such as IMS clients or carrier applications.

Bug: 37527489
Test: marlin builds and boots
Test: MultinetworkApiTest CTS tests passes
Change-Id: I2aa592d1d082aae410173adf2a09f6d1dd8092dc
Merged-In: I2aa592d1d082aae410173adf2a09f6d1dd8092dc
2017-05-26 06:02:26 +09:00
Lorenzo Colitti
addb296226 Move libandroid_net from Android.mk to Android.bp.
This is the first step of making libandroid_net available to
vendor code. This is a partial cherry-pick of ag/2210044 that
only moves the build target (hence the Merged-In change ID).

Bug: 37527489
Test: marlin builds and boots
Change-Id: Id9e4d13d4e75f6f6381c675c4e9f72e9f4769d22
Merged-In: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
2017-05-26 06:00:00 +09:00
Lorenzo Colitti
d15f0af2fe Allow vendor code to link to libandroid_net.
This library contains only the multinetwork API, which is part
of the NDK and has long-term support. It is needed by any native
that wants to use network communications on a different network
than the default network, and thus is necessary for vendor code
such as IMS clients or carrier applications.

Bug: 37527489
Test: marlin builds and boots
Test: MultinetworkApiTest CTS tests passes
Change-Id: I2aa592d1d082aae410173adf2a09f6d1dd8092dc
2017-05-25 16:42:12 +09:00
Colin Cross
5c5b7f0ed7 Convert libandroid and libandroid_runtime to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
Merged-In: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
(cherry picked from commit 3f8fd40f285dba5b3639ee1e3d4e4544048c1446)
2017-05-06 00:52:03 +00:00
Colin Cross
af737306f9 Convert libandroid and libandroid_runtime to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
(cherry picked from commit 3f8fd40f285dba5b3639ee1e3d4e4544048c1446)
2017-05-06 00:50:39 +00:00
Colin Cross
3f8fd40f28 Convert libandroid and libandroid_runtime to Android.bp
See build/soong/README.md for more information.

Test: m -j checkbuild
Change-Id: Ie3c9c3d3c8c75ade36422d1e8ee0a5fe117e9091
2017-05-04 13:00:21 -07:00
Jesse Hall
5f73ab7e2a Include vndk/hardware_buffer.h for AHardwareBuffer_getNativeHandle
This function is now VNDK-only, and not in the NDK header.

Bug: 34050596
Test: build
Change-Id: Id0147dbdb65157da9692e7f38b1a068be18be2b9
2017-04-17 08:55:24 -07:00
Dan Willemsen
68686dbb41 Remove .(ll)ndk suffix from (ll)ndk_library
Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Merged-In: Ic10796e75bb886cc3f92c234714ab3e6c85112df
Change-Id: Ic10796e75bb886cc3f92c234714ab3e6c85112df
2017-04-11 15:15:02 +00:00
Dan Willemsen
3dcf031866 Remove .(ll)ndk suffix from (ll)ndk_library
Soong handles these automatically now.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Change-Id: Ic10796e75bb886cc3f92c234714ab3e6c85112df
2017-04-10 12:54:37 -07:00
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
caf8930960 fallout of splitting libsensor out of libgui
Test: compile & run
Bug: treble cleanup
Change-Id: Ib696126506cc9df01dcf9e09779ce05ddb69e4b6
2017-03-06 16:09:55 -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
555bf41049 Merge "Add direct sensor report NDK API" 2017-03-01 17:58:36 +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
2e2c35febf Merge "Added implementation of shared memory NDK API" 2017-02-27 20:58:23 +00: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
Mathias Agopian
fee4a985fd fallout of libandroid.so split
Test: compiled & booted
Bug: 35164655
Change-Id: I786167a21453e17493969cdacfc9d31bdb781d98
2017-02-23 23:28:20 +00:00
Mathias Agopian
f1cb02e7b5 fallout of splitting rect.h out of libandroid.
- Main goal here: libandroid now links against 
libarect and export its includes.

- Also fix some wrongful makefiles that included 
headers without proper dependency list.

Test: built and booted device
Bug: 35164655
Change-Id: Iae17b966bba00fe53424486a75eebff468873787
2017-02-17 12:25:26 -08:00
Mathias Agopian
e68b4f73a9 separate the JNI part of the NDK into their own source
Test: built and booted device
Bug: 35164655
Change-Id: I944c9f28730b82e8c428b5384dc57e1b296144b2
2017-02-10 20:07:33 +00:00
Craig Donner
99015fe465 Merge "Use gralloc1 flags to allocate AHardwareBuffers" 2017-02-08 01:42:35 +00:00
Craig Donner
900510642a Use gralloc1 flags to allocate AHardwareBuffers
Bug: 34939453
Test: cts-tradefed run cts -m CtsNativeHardwareTestCases
Change-Id: I48add1b78c4e1409c0e787d6197f0582f0c3fb4c
2017-02-03 14:24:10 -08:00
Alex Deymo
f2f6961b7b Compile native network functionis into libandroid_net. am: f3b7411060 am: af657d14fc am: 74a410ec81
am: 2e61c0eea3

Change-Id: I7a1d3c40bcf76a3e6eabb3eddff159a53af0c5c1
2017-02-02 21:08:08 +00:00
Craig Donner
2be5b9f966 Add support for BLOB format to HardwareBuffer.
Test: updated CTS test to check for error conditions if the blob dimensions are
bad.
Bug: 34050596

Change-Id: I3ec6e7a43dae8d0ac2b2d04bc4b38cd3c12f8390
2017-01-24 18:43:30 -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
Alex Deymo
f3b7411060 Compile native network functionis into libandroid_net.
libandroid includes some local implementations, but depends on many
other libraries to provide those (counting transitive dependencies, a
total of 65). This patch copies the native network functions provided
by android/multinetwork.h header to its own new libandroid_net shared
library. This new library has only one other shared library dependency.

Bug: 32842753
Test: `make` on aosp_arm-eng
Change-Id: Ifbd529d9bf74a8d4f754733cff345729de6b1521
2017-01-13 23:01:32 +00:00
Dan Albert
98e462df7d Unversion NDK stub libraries.
The system versions of these libraries aren't versioned yet.

Bug: https://github.com/android-ndk/ndk/issues/278
Test: make ndk
Change-Id: I74e988be8f60f8728a0bfa7360091cbd9f5b1186
2017-01-06 11:04:14 -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
Chih-Hung Hsieh
9650521ed1 Merge "Enable clang for arm64."
am: a11a8e5086

Change-Id: If6069ad099ec5068b9b77f1ea84b85ff4a20438d
2016-08-04 17:19:10 +00:00
Chih-Hung Hsieh
248bed0334 Enable clang for arm64.
emutls should work now with latest prebuilt clang/llvm.

BUG: 25642296
Test: build and boot up on arm64 emulator.

Change-Id: I5c8dd36a1575436e5fd56e91f7c285f2b3e6546f
(cherry picked from commit 8ffb6b76f7a72e14882e09f882494e5f7d5fc45d)
2016-08-04 17:09:55 +00:00
Chih-Hung Hsieh
85e0c89ba5 resolve merge conflicts of 1599b981 to nyc-dev-plus-aosp
Change-Id: I90807581e10b6a0024515ff634ac8b29eaa5fc9f
2016-04-28 12:08:15 -07:00
Chih-Hung Hsieh
c6baf563ba Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
2016-04-27 11:38:12 -07:00
Michael Wright
c0d3d3f805 Change storage duration to static for native choreographer.
This ensures that the region is zero initialized, regardless of compiler.

Change-Id: Ie0bfa5d2cd2486ba31a45aee4de6c370513bfc62
2016-04-14 10:18:09 +02:00
Michael Wright
63c168acf7 Add choreographer API to the NDK.
Change-Id: Icb8cffd3cd3bd06814466be72db3e26f6a62cbc6
2016-04-08 16:55:02 +02:00
Aniroop Mathur
ee5c18f038 Sensor: Add batch support for native applications
Currently, it is not possible for native applications to use the
sensor in batch mode. As it is a 'C' header file so function
overloading is not possible. Therefore, lets add a new function to
enable the sensor, set the delay and batch timeout, all together.

Change-Id: I565ec2d945d57f31ae11ed43bf9ba351aebd67a0
Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
2016-03-16 18:07:00 -07:00
Michael Wright
ff20b979e7 Change storage duration to static for native choreographer.
This ensures that the region is zero initialized, regardless of compiler.

Change-Id: Ie0bfa5d2cd2486ba31a45aee4de6c370513bfc62
2016-01-26 16:03:25 -08:00
Michael Wright
3d3fe5026a Add choreographer API to the NDK.
Change-Id: Icb8cffd3cd3bd06814466be72db3e26f6a62cbc6
2016-01-21 16:30:33 -08:00
Aravind Akella
2af91d0e10 Call getInstanceForPackage instead of creating a new SensorManager instance.
Bug: 22529981
Change-Id: If077e042a4af940dfb1fc9c4ac8b9d352dd32685
2015-07-30 19:04:40 +00:00
Narayan Kamath
8d1e344f40 Revert "Call getInstanceForPackage instead of creating a new SensorManager instance."
This reverts commit 5967ddbf05f146bdb6744207e3daed1aa76fc637.

Change-Id: I6d58129585a30d7c2ef39c8cbe796fd696c93f56
2015-07-29 09:35:46 +00:00
Aravind Akella
5967ddbf05 Call getInstanceForPackage instead of creating a new SensorManager instance.
Bug: 22529981
Change-Id: Id3adfbcf55d1268db1a555c72a06456a5219c086
2015-07-27 14:19:31 -07:00