diff options
| author | 2014-10-27 15:15:50 +0000 | |
|---|---|---|
| committer | 2014-10-27 15:15:50 +0000 | |
| commit | 0c1215e237b3466b5084cc3c488f22f933283dba (patch) | |
| tree | 9beda27a49652d531a74e61b8558a2e74a101edd | |
| parent | 1ef3495abfa2a858b3cc7a1844383c8e7dff0b60 (diff) | |
| parent | 44a3506627833deb17d21d6a7d51245a5af2c3e9 (diff) | |
Merge "[native bridge] Add test to verify code_cache existance."
| -rw-r--r-- | runtime/native_bridge_art_interface.cc | 1 | ||||
| -rw-r--r-- | test/115-native-bridge/expected.txt | 1 | ||||
| -rw-r--r-- | test/115-native-bridge/nativebridge.cc | 9 |
3 files changed, 9 insertions, 2 deletions
diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc index b0d8e87a90..f598e27d7b 100644 --- a/runtime/native_bridge_art_interface.cc +++ b/runtime/native_bridge_art_interface.cc @@ -119,7 +119,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"); |