diff options
| author | Ningsheng Jian <ningsheng.jian@arm.com> | 2014-09-17 13:34:09 +0800 |
|---|---|---|
| committer | Andreas Gampe <agampe@google.com> | 2014-09-29 11:43:19 -0700 |
| commit | 88b84ec200091bdf5754b435ef55dfcd30078a67 (patch) | |
| tree | 6f32cbfa31ef4476ac647cc3825932bd6d6e79c0 /include | |
| parent | d318f9e081b0fdd91cea1306b13bf23f19933b08 (diff) | |
| download | platform_libnativehelper-88b84ec200091bdf5754b435ef55dfcd30078a67.tar.gz platform_libnativehelper-88b84ec200091bdf5754b435ef55dfcd30078a67.tar.bz2 platform_libnativehelper-88b84ec200091bdf5754b435ef55dfcd30078a67.zip | |
NativeHelper: Avoid returning local stack string
Refactor JniInvocation::GetLibrary to not return a stack-allocated
string. Instead, provide a char buffer.
Bug: 16404669
Change-Id: I34f4a40e28bc491ba630a2b1bff5792e34937101
Diffstat (limited to 'include')
| -rw-r--r-- | include/nativehelper/JniInvocation.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/nativehelper/JniInvocation.h b/include/nativehelper/JniInvocation.h index b5198ff..fc2ed0a 100644 --- a/include/nativehelper/JniInvocation.h +++ b/include/nativehelper/JniInvocation.h @@ -38,8 +38,11 @@ class JniInvocation { // persist.sys.dalvik.vm.lib. bool Init(const char* library); - // Exposes which library is actually loaded from the given name. - static const char* GetLibrary(const char* library); + // Exposes which library is actually loaded from the given name. The + // buffer of size PROPERTY_VALUE_MAX will be used to load the system + // property for the default library, if necessary. If no buffer is + // provided, the fallback value will be used. + static const char* GetLibrary(const char* library, char* buffer); private: |
