aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Add java.nio.Buffer helper methods.android-mainline-10.0.0_r9android-mainline-10.0.0_r7android-mainline-10.0.0_r5android-mainline-10.0.0_r4android-mainline-10.0.0_r10android-10.0.0_r9android-10.0.0_r8android-10.0.0_r7android-10.0.0_r45android-10.0.0_r44android-10.0.0_r43android-10.0.0_r42android-10.0.0_r41android-10.0.0_r40android-10.0.0_r39android-10.0.0_r38android-10.0.0_r37android-10.0.0_r36android-10.0.0_r35android-10.0.0_r34android-10.0.0_r33android-10.0.0_r32android-10.0.0_r31android-10.0.0_r30android-10.0.0_r29android-10.0.0_r28android-10.0.0_r27android-10.0.0_r26android-10.0.0_r25android-10.0.0_r24android-10.0.0_r23android-10.0.0_r22android-10.0.0_r21android-10.0.0_r20android-10.0.0_r19android-10.0.0_r18android-10.0.0_r16android-10.0.0_r15android-10.0.0_r14android-10.0.0_r13android-10.0.0_r12android10-qpr3-s1-releaseandroid10-qpr3-releaseandroid10-qpr2-s4-releaseandroid10-qpr2-s3-releaseandroid10-qpr2-s2-releaseandroid10-qpr2-s1-releaseandroid10-qpr2-releaseandroid10-qpr1-releaseandroid10-qpr1-mainline-releaseandroid10-qpr1-d-releaseandroid10-qpr1-c-s1-releaseandroid10-qpr1-c-releaseandroid10-qpr1-b-s1-releaseandroid10-qpr1-b-releaseandroid10-mainline-media-releaseandroid10-devandroid10-d4-s1-releaseandroid10-d4-releaseandroid10-c2f2-s2-releaseandroid10-c2f2-s1-releaseandroid10-c2f2-releaseOrion Hodson2019-04-111-0/+60
| | | | | | | | | | Bug: 124338141 Test: Boot and observe no core platform api warnings from opengl (cherry picked from commit f5480bdcdd27e492a9858599664c74e16a46a961) Change-Id: I4680418398f0708c26c0124b418a2ccb1094a038 Merged-In: I6db85f6084dd620e08568dbdeea0d10efb20a84f
* Expose JniConstants::Uninitialize for libcore use.Nicolas Geoffray2019-03-121-0/+5
| | | | | | Test: in ART, two_runtimes_test.cc Bug: 31550016 Change-Id: I33906c8d3911b696f311d8d2a58b9dab4f6ab5a1
* Move AsynchronousCloseMonitor to libjavacore.Pete Bentley2019-02-061-83/+0
| | | | | | | | | | | Final resting place tbd (see b/122881655) but this gets it out of libnativehelper. Bug: 122881655 Test: m && flashall Test: atest CtsLibcoreOkHttpTestCases:com.squareup.okhttp.CallTest Change-Id: I23130154120f04284910bfded574e980bbf1b6ee
* libnativehelper: refactoring for Runtime ModuleOrion Hodson2019-01-175-68/+134
| | | | | | | | | | | | | This change puts a C ABI between the caller and libnativehelper which means each could link separate libc++ library instances using namespaces. Bug: b/119840313 Test: Builds & boots Test: atest JniInvocation_test Test: atest libnativehelper_api_test Change-Id: Idaa4ddd3118cbb4f3997abdcf355220ef80eb775
* libnativehelper: minor C++ modernizationOrion Hodson2019-01-111-8/+0
| | | | | | | | Assume at least C++11 support. Bug: 119840313 Test: builds cleanly with WITH_TIDY=1 mma Change-Id: I246efaa337d69b70280eec595ed80d75226ffbf5
* Move JniConstants to points of useOrion Hodson2019-01-091-85/+0
| | | | | | | | | | | | | | | | Removes the JniConstants from the libnativehelper API. Most of the constants are moved into libcore. Light tidying up in touched files. Bug: 119840313 Test: atest libnativehelper/test Test: atest CtsLibcoreTestCases Test: art/test.py --host -g -j16 Test: device boots Change-Id: I4c0daab450d2efd7e6bd7705e27dbb6309fcb92d
* Remove <nativehelper/UniquePtr.h>Elliott Hughes2018-09-171-234/+0
| | | | | | | | It's 2018. Everyone should be using std::unique_ptr now... Bug: http://b/22403888 Test: builds Change-Id: Ifb94f06e55666f8626cce9ed0d5bc137cedbf8de
* Mark UniquePtr as deprecated.Elliott Hughes2018-08-271-4/+10
| | | | | | | | It's 2018. Everyone should be using std::unique_ptr by now. Bug: http://b/22403888 Test: builds Change-Id: I90b74e375a1cfee4290ed9a000b4f3d36666a162
* Handle null FileDescriptors passed to native methods.Pete Bentley2018-07-241-1/+2
| | | | | | | | | Add null checks to jniSetFileDescriptorOfFD and to its callers where appropriate. Bug: 111523523 Test: cts-tradefed run cts -m CtsLibcoreTestCases Change-Id: Ic8a236b854d455cd51f379a80e15ee2080b6a400
* Add getter for java.io.FileDescriptor.owner.Josh Gao2018-07-161-0/+9
| | | | | | Bug: http://b/110100358 Test: treehugger Change-Id: Ic87c373eb099aa3d06c4e33e28d441fd66604966
* Do not reinitialize system properties to fake their valuesTom Cherry2017-12-141-0/+4
| | | | | | | | | | | Reinitializing system properties can result in crashes later in the program, and is generally not recommended or even supported. Instead, this change uses a very rudamentary approach to mocking out the system property functions. Bug: 62197783 Test: unit tests Change-Id: I99c57e1d87490926e4839ee154c862ee8a199e26
* Libnativehelper: Move mutable class cache to libcoreAndreas Gampe2017-10-301-2/+0
| | | | | | | | | | | These classes and fields are only used in libcore native code. Do not expose them in JniConstants. Bug: 68197265 Test: m Test: m test-art-host Test: vogar --mode=host libcore/luni/src/test/java/libcore/io/OsTest.java Change-Id: I8a84fd0fa88e8174bea86a33bf58ad7eba392c82
* Nativehelper: Export header-only version of helpersAndreas Gampe2017-10-196-390/+7
| | | | | | | | | Export a version of the nativehelper helpers that doesn't have a dependency on the libnativehelper library. Instead, provide an inline function for null throw. Test: m Change-Id: Idfab8809873d54db824c8bc089f003265fe5a9b9
* Merge "Remove setsockoptGroupSourceReq and StructGroupSourceReq"vichang2017-09-211-1/+0
|\
| * Remove setsockoptGroupSourceReq and StructGroupSourceReqVictor Chang2017-08-151-1/+0
| | | | | | | | | | | | | | | | | | | | - setsockoptGroupSourceReq is dead code after removing the corresponding socket options in Iobridge Test: cts-tradefed run cts-dev --module CtsLibcoreTestCases Test: cts-tradefed run cts-dev --module CtsLibcoreOjTestCases Bug: 32071916 Change-Id: Ie1b8a40c77ee092b84eb80ccb3f8bde3cc01b73b
* | Nativehelper: Fix ScopedLocalRefAndreas Gampe2017-09-131-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up to commit 076bf283b9b988ee5c10d6543eb58318d95a5e8f. Remove empty constructor, as it's dangerous to use. Remove null assignment to mEnv as it's actually forbidden. Runtime tests are introduced in a follow-up change. Test: m Test: manual Change-Id: Ib8ad0e6b18eda57489b6ee4b325c50c360830fba
* | Nativehelper: Add C++11 support to ScopedLocalRefAndreas Gampe2017-09-081-2/+31
| | | | | | | | | | | | | | | | Move us into the future past, adding some C++11 goodness to ScopedLocalRef that make it look more like unique_ptr. Test: m Change-Id: I793248da5a48e407bdea1a7fd83fcbc83b0a8f67
* | Merge "Move default libnativehelper include to mock dir."Steven Moreland2017-07-191-1141/+0
|\ \ | | | | | | | | | | | | | | | am: cfdbad8210 Change-Id: I8e11679922ff102b6aacc604b71ca5fcebf3b51a
| * | Move default libnativehelper include to mock dir.Steven Moreland2017-07-181-1141/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include_deprecated contains all of the headers that are currently used by libraries without the "nativehelper/" prefix. The current count of this is this: 2 ScopedLocalFrame.h 4 JniInvocation.h 4 ScopedBytes.h 5 AsynchronousCloseMonitor.h 6 toStringArray.h 7 ScopedStringChars.h 38 JniConstants.h 41 ScopedPrimitiveArray.h 79 ScopedUtfChars.h 80 UniquePtr.h 100 ScopedLocalRef.h 467 JNIHelp.h Now we can remove each file from the global header include on a file by file basis. Bug: 63762847 Test: libraries still find their headers Change-Id: I77f1dcff47389bcce55087fe18c46350992e4e06
* | Merge "Add JNI helper function jniCreateString()."Fredrik Roubert2017-07-171-0/+16
|\| | | | | | | | | | | am: a22102d917 Change-Id: I66fdb72ebc6ae253948615cc85dfbeeec9cde0b5
| * Add JNI helper function jniCreateString().Fredrik Roubert2017-07-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | In C++11, char16_t and uint16_t (which is what jchar is defined as) are two distinct types, even though they are bitwise identical, so to not require C++11 code using char16_t to always reinterpret_cast<uint16_t> the argument passed to JNIEnv::NewString(), this new helper function is overloaded to do the required cast when used in C++11. Bug: 37554848 Test: make Change-Id: I69632b0a7b822537cab77c43dc387d94917933b9
* | Merge "Track libcore commit 58228b82c64808eddac02736f18f5003730443a0"Przemyslaw Szczepaniak2017-07-171-0/+1
|\| | | | | | | | | | | am: faaa80e17c Change-Id: Iac2b8ea8f224ab85234828082bc5addb0c89473f
| * Track libcore commit 58228b82c64808eddac02736f18f5003730443a0Przemyslaw Szczepaniak2017-07-131-0/+1
| | | | | | | | | | | | Test: CtsLibcoreTestCases Bug: 62949898 Change-Id: I9285d65ec106666b66565c17a18f7d45a18fc8e8
* | Add move semantics to ScopedUtfCharsAdam Lesinski2016-10-111-9/+32
|/ | | | | Test: manual Change-Id: Ibcac9b21328f5e0549075443005ac721451d9fac
* Fix google-explicit-constructor warnings.Chih-Hung Hsieh2016-08-151-1/+1
| | | | | | | | * Add explicit keyword to conversion constructors. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I5435bcf34e023ff49d87494accee913d1968f15d
* Track libcore change 162bf4d3d62da1e581e7a40e01f5ad664f0507efYi Kong2016-08-041-0/+1
| | | | | | | Adds StructIfaddrs to JniConstants. Bug: 28609551 Change-Id: I314524f69d1dedbea108a8066f1510f113669e55
* Merge "Add inet6AddressHolderClass JniConstant"Treehugger Robot2016-08-041-0/+1
|\
| * Add inet6AddressHolderClass JniConstantYi Kong2016-07-111-0/+1
| | | | | | | | | | Bug: 29067535 Change-Id: Ie658014fc46e616015d85ba8cfac2a265ac11fef
* | Remove libcore include dependencyColin Cross2016-07-271-1/+0
| | | | | | | | | | | | | | libnativehelper only uses ScopedPthreadMutexLock from libcore/include, rewrite it with std::mutex and std::lock_guard instead. Change-Id: I4eae9e77d21483ffb6b4aedcedcf8c7bb765294f
* | Remove <nativehelper/ScopedFd.h>.Elliott Hughes2016-07-181-68/+0
|/ | | | | | | Use <android-base/unique_fd.h> instead. Bug: http://b/21192156 Change-Id: I29507cb69986fdd1dac49934b11bc3349e0dfbef
* Fix google-explicit-constructor warnings in libnativehelperChih-Hung Hsieh2016-06-302-3/+3
| | | | | | Bug: 28341362 Change-Id: I8e19914bdc20e734fd273e874d329d1c273db894 Test: build with clang-tidy
* Fix misc-macro-parentheses warnings in libnativehelper.Chih-Hung Hsieh2016-06-211-4/+18
| | | | | | | | | Replace T* and T& with POINTER_TYPE(T) and REFERENCE_TYPE(T) in macros to avoid wrong clang-tidy warnings. Use NOLINT to suppress warnings in POINTER_TYPE(T) and REFERENCE_TYPE(T). Bug: 28705665 Change-Id: I4dc985b9050b47af020f0f3188a64a891ff88ac8
* Clean up JniConstantsYi Kong2016-05-181-17/+0
| | | | | | | Remove unused class IDs preloaded in JniConstants. Bug: 28831504 Change-Id: I845fbcda8117e03a11f90a72ca94f9b23ee56ba0
* Add SocketTagger class to JniConstantsYi Kong2016-04-011-0/+1
| | | | | Bug: 27291269 Change-Id: Ia7db477a95527491245dbd774d6afe36f88c97c1
* Move AsynchronousCloseMonitor here from libcorePrzemyslaw Szczepaniak2015-12-221-0/+66
| | | | | | | | | | | AsynchronousCloseMonitor is needed by both libopenjdk and libjavacore. Bug: 26127752 (cherry picked from commit 20d3848be7394fb9a4735b8b2148f994ff735d96) Change-Id: I7d1d89d344180bb1e6bed2e0c83e4e7633122fe0
* Add a JniConstant for InetSocketAddressHolder.Piotr Jastrzebski2015-12-221-0/+1
| | | | | | (cherry picked from commit 39a538702537bab23e21a41c934fdd7b772519e7) Change-Id: I8ed14341ced9edaad723a38563efa543814de5af
* Remove JNI constants related to RealToString.Narayan Kamath2015-12-221-1/+0
| | | | | | (cherry picked from commit 830b9bef45a0f372d099fa81db34ade5cdddafb9) Change-Id: Idd3637e8bc0d3c3dab3bb9dc6b4da83d915c02ac
* Add a JNI constant for InetAddressHolder.Piotr Jastrzebski2015-12-221-0/+1
| | | | | | (cherry picked from commit da7720ddf47e60f0b2a926d778b5c65bc91d1c03) Change-Id: I84bb4ecb4e8e8dc06a3282fb123467530ed277e3
* Track switch to OpenJdk's java.text class.Piotr Jastrzebski2015-12-221-2/+0
| | | | | | | | | bidiRunClass and fieldPositionIteratorClass are no longer necessary. (cherry picked from commit 03e90fe122f95df27ca74a82bdf2fae343bef769) Change-Id: I714f01fce1fb3b6917304dcf810730bcee2c03e3
* Improve ScopedFd APICasey Dahlin2015-11-191-1/+8
| | | | | | | | | The class is now final, and has move constructors and move assignment. Change-Id: I5a87cd11dbf2581594919d37c08519302683f46c Test: Full build of android completes successfully Bug: 25242023 Signed-off-by: Casey Dahlin <sadmac@google.com>
* Speed up ScopedPrimitiveArrayROMathieu Chartier2015-09-111-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For small arrays <= 1024 elements, we use GetArrayRegion with stack allocated backing storage instead of GetArrayElements. The speedup comes from the fact that GetArrayRegion doesn't need to allocate a copy of array. Timing results for: https://android-review.googlesource.com/#/c/169727/ BEFORE Host: Byte length=1 ns/op=452.2633712 Short length=1 ns/op=468.6469192 Int length=1 ns/op=422.5663486 Long length=1 ns/op=423.4946638 Byte length=8 ns/op=424.8546962 Short length=8 ns/op=424.3842626 Int length=8 ns/op=424.3816324 Long length=8 ns/op=452.9407552 Byte length=64 ns/op=441.674149 Short length=64 ns/op=472.2310028 Int length=64 ns/op=455.6142958 Long length=64 ns/op=487.6810328 Byte length=512 ns/op=454.0858634 Short length=512 ns/op=497.675829 Int length=512 ns/op=481.2103832 Long length=512 ns/op=507.4674306 Byte length=4096 ns/op=531.7923602 Short length=4096 ns/op=648.254466 Int length=4096 ns/op=578.0794842 Long length=4096 ns/op=563.3641424 N5: Byte length=1 ns/op=3118.2292802 Short length=1 ns/op=3083.7797488 Int length=1 ns/op=3177.8996446 Long length=1 ns/op=3151.0892072 Byte length=8 ns/op=3287.7326966 Short length=8 ns/op=3126.5799676 Int length=8 ns/op=3197.3203112 Long length=8 ns/op=3201.0613218 Byte length=64 ns/op=3178.7730612 Short length=64 ns/op=3162.2255092 Int length=64 ns/op=3241.3191864 Long length=64 ns/op=3117.6674886 Byte length=512 ns/op=3106.540978 Short length=512 ns/op=3183.0501344 Int length=512 ns/op=3513.8142382 Long length=512 ns/op=3592.4372798 Byte length=4096 ns/op=3552.9428216 Short length=4096 ns/op=3997.586686 Int length=4096 ns/op=4545.2151442 Long length=4096 ns/op=4371.4996338 AFTER Host: Byte length=1 ns/op=261.764995 Short length=1 ns/op=238.6584262 Int length=1 ns/op=262.856902 Long length=1 ns/op=238.0286378 Byte length=8 ns/op=242.4962264 Short length=8 ns/op=247.8668746 Int length=8 ns/op=263.9420024 Long length=8 ns/op=243.3675294 Byte length=64 ns/op=243.3372902 Short length=64 ns/op=249.0408034 Int length=64 ns/op=250.2168296 Long length=64 ns/op=253.837053 Byte length=512 ns/op=252.8071526 Short length=512 ns/op=271.689653 Int length=512 ns/op=291.8933238 Long length=512 ns/op=341.6303746 Byte length=4096 ns/op=540.8749038 Short length=4096 ns/op=661.7068158 Int length=4096 ns/op=569.030217 Long length=4096 ns/op=565.0571702 N5: Byte length=1 ns/op=1209.4042078 Short length=1 ns/op=1207.2498746 Int length=1 ns/op=1377.0557706 Long length=1 ns/op=1348.6359368 Byte length=8 ns/op=1260.0724162 Short length=8 ns/op=1229.6107912 Int length=8 ns/op=1414.1408952 Long length=8 ns/op=1394.1158746 Byte length=64 ns/op=1232.532947 Short length=64 ns/op=1228.1248122 Int length=64 ns/op=1468.2667912 Long length=64 ns/op=1404.232687 Byte length=512 ns/op=1256.976093 Short length=512 ns/op=1335.5540308 Int length=512 ns/op=1599.6927076 Long length=512 ns/op=1769.8866764 Byte length=4096 ns/op=3310.2486656 Short length=4096 ns/op=3956.6322484 Int length=4096 ns/op=4374.6221234 Long length=4096 ns/op=4256.71598 Bug: 19664826 Change-Id: I703d7346de732199be1feadbead021c6647a554a
* Replace InetUnixAddress with UnixSocketAddressNeil Fuller2015-07-071-1/+1
| | | | | | | UnixSocketAddress maps to stuct sockaddr_un from sys/un.h. Bug: 3106438 Change-Id: Ia4d57729e286c8b3a62a78202bc2385f0d33cb52
* ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()Spencer Low2015-05-131-2/+5
| | | | | | | | | | | According to the comments in Posix_close(), TEMP_FAILURE_RETRY() should not be used with close(): https://android.googlesource.com/platform/libcore/+/462bdac45c10f43d88d8f07f6994e272a27c14a2%5E%21/#F12 Bug: http://b/20501816 Change-Id: Ie283f848c4fe50fcde9358c8ed307ec048e70892 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* Add JNI references for PacketSocketAddress.Lorenzo Colitti2015-03-121-5/+5
| | | | | | Also remove an outdated comment. Change-Id: If0da380f78c1e77963953d8e64737d0f22c90fad
* Add JNI references for android.system.NetlinkSocketAddress.Erik Kline2015-02-251-0/+1
| | | | | | | | Developed in conjunction with: https://android-review.googlesource.com/135491 Bug: 18581716 Change-Id: Icddee915579e4187a181138f8ef8d92f3a70de35
* Rename field: fd -> fd_Dmitriy Ivanov2015-01-201-8/+8
| | | | | | This is fix avoid shadow variable warning Change-Id: I014ab622b33326470b89e3971b7ad898700f9962
* Add Class<java.util.zip.ZipEntry> to JniConstants.Narayan Kamath2015-01-081-0/+1
| | | | | | For use in StrictJarFile. Change-Id: Ife29e359cd97cf71b184151ebb0efffaa9cdb0a8
* Don't need swap anymore.Dan Albert2014-11-051-10/+0
| | | | | | | | | | | The declaration of std::swap here is inconsistent with the one in libc++ (noexcept differences). Rather than worrying about keeping them all consistent, just remove swap. It was only ever added for ART, and ART now uses std::unique_ptr instead. This was causing an ambiguous overload error in system/core. Change-Id: I4cf4c41c5dda01a96915e8309af2f8be089d1a2a
* Add DISALLOW_COPY_AND_ASSIGN macro.Ian Rogers2014-11-049-38/+36
| | | | | | | | Make the DISALLOW_COPY_AND_ASSIGN macro delete the member functions rather than just not defining them to improve analysis of the Scoped.. classes. Add a few missing const qualifiers. Change-Id: I48eee0c22908d45a05df6979aa61442d2eedcf36
* NativeHelper: Avoid returning local stack stringNingsheng Jian2014-09-291-2/+5
| | | | | | | | Refactor JniInvocation::GetLibrary to not return a stack-allocated string. Instead, provide a char buffer. Bug: 16404669 Change-Id: I34f4a40e28bc491ba630a2b1bff5792e34937101