summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2014-10-28 23:11:38 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-10-28 23:11:38 +0000
commit187e3a05a2bc03e0316abed788d32dea47d77661 (patch)
treed2f2146d95f7141151329c6e8037b0ba8b7cff2e
parentcad0ff2c0b9b3944a07f227cbdd7c33945c86b9c (diff)
parent622f106c72443cc0f859141735ae0bb285fc8d2c (diff)
am 622f106c: Merge "[native bridge] Add test to verify code_cache existance." into lmp-mr1-dev
* commit '622f106c72443cc0f859141735ae0bb285fc8d2c': [native bridge] Add test to verify code_cache existance.
-rw-r--r--runtime/native_bridge_art_interface.cc1
-rw-r--r--test/115-native-bridge/expected.txt1
-rw-r--r--test/115-native-bridge/nativebridge.cc9
3 files changed, 9 insertions, 2 deletions
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc
index bc191b4289..7a8d6f2a88 100644
--- a/runtime/native_bridge_art_interface.cc
+++ b/runtime/native_bridge_art_interface.cc
@@ -118,7 +118,6 @@ void PreInitializeNativeBridge(std::string dir) {
#ifndef __APPLE__ // Mac OS does not support CLONE_NEWNS.
if (unshare(CLONE_NEWNS) == -1) {
LOG(WARNING) << "Could not create mount namespace.";
- return;
}
android::PreInitializeNativeBridge(dir.c_str(), GetInstructionSetString(kRuntimeISA));
#endif
diff --git a/test/115-native-bridge/expected.txt b/test/115-native-bridge/expected.txt
index a5eedc6a27..16a71e4b89 100644
--- a/test/115-native-bridge/expected.txt
+++ b/test/115-native-bridge/expected.txt
@@ -1,3 +1,4 @@
+Code cache exists: './code_cache'.
Native bridge initialized.
Checking for getEnvValues.
Ready for native bridge tests.
diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc
index 442f99c486..23145e3216 100644
--- a/test/115-native-bridge/nativebridge.cc
+++ b/test/115-native-bridge/nativebridge.cc
@@ -23,6 +23,7 @@
#include "jni.h"
#include "stdio.h"
#include "unistd.h"
+#include "sys/stat.h"
#include "nativebridge/native_bridge.h"
@@ -208,7 +209,13 @@ static NativeBridgeMethod* find_native_bridge_method(const char *name) {
// NativeBridgeCallbacks implementations
extern "C" bool native_bridge_initialize(const android::NativeBridgeRuntimeCallbacks* art_cbs,
- const char* private_dir, const char* isa) {
+ const char* app_code_cache_dir, const char* isa) {
+ struct stat st;
+ if ((app_code_cache_dir != nullptr)
+ && (stat(app_code_cache_dir, &st) == 0)
+ && S_ISDIR(st.st_mode)) {
+ printf("Code cache exists: '%s'.\n", app_code_cache_dir);
+ }
if (art_cbs != nullptr) {
gNativeBridgeArtCallbacks = art_cbs;
printf("Native bridge initialized.\n");