1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 // An implementation of the native-bridge interface for testing.
18 
19 #include "nativebridge/native_bridge.h"
20 
21 // NativeBridgeCallbacks implementations
native_bridge_initialize(const android::NativeBridgeRuntimeCallbacks *,const char *,const char *)22 extern "C" bool native_bridge_initialize(const android::NativeBridgeRuntimeCallbacks* /* art_cbs */,
23                                          const char* /* app_code_cache_dir */,
24                                          const char* /* isa */) {
25   return true;
26 }
27 
native_bridge_loadLibrary(const char *,int)28 extern "C" void* native_bridge_loadLibrary(const char* /* libpath */, int /* flag */) {
29   return nullptr;
30 }
31 
native_bridge_getTrampoline(void *,const char *,const char *,uint32_t)32 extern "C" void* native_bridge_getTrampoline(void* /* handle */, const char* /* name */,
33                                              const char* /* shorty */, uint32_t /* len */) {
34   return nullptr;
35 }
36 
native_bridge_isSupported(const char *)37 extern "C" bool native_bridge_isSupported(const char* /* libpath */) {
38   return false;
39 }
40 
native_bridge_getAppEnv(const char *)41 extern "C" const struct android::NativeBridgeRuntimeValues* native_bridge_getAppEnv(
42     const char* /* abi */) {
43   return nullptr;
44 }
45 
46 android::NativeBridgeCallbacks NativeBridgeItf {
47   .version = 1,
48   .initialize = &native_bridge_initialize,
49   .loadLibrary = &native_bridge_loadLibrary,
50   .getTrampoline = &native_bridge_getTrampoline,
51   .isSupported = &native_bridge_isSupported,
52   .getAppEnv = &native_bridge_getAppEnv
53 };
54