DummyNativeBridge.cpp revision 1402fbb13523fed9d96217e801df5678e3c01a6b
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// A dummy implementation of the native-bridge interface.
18
19#include "nativebridge/native_bridge.h"
20
21// NativeBridgeCallbacks implementations
22extern "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
28extern "C" void* native_bridge_loadLibrary(const char* /* libpath */, int /* flag */) {
29  return nullptr;
30}
31
32extern "C" void* native_bridge_getTrampoline(void* /* handle */, const char* /* name */,
33                                             const char* /* shorty */, uint32_t /* len */) {
34  return nullptr;
35}
36
37extern "C" bool native_bridge_isSupported(const char* /* libpath */) {
38  return false;
39}
40
41extern "C" const struct android::NativeBridgeRuntimeValues* native_bridge_getAppEnv(
42    const char* /* abi */) {
43  return nullptr;
44}
45
46android::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