DummyNativeBridge.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // A dummy implementation of the native-bridge interface.
  17. #include "nativebridge/native_bridge.h"
  18. // NativeBridgeCallbacks implementations
  19. extern "C" bool native_bridge_initialize(const android::NativeBridgeRuntimeCallbacks* /* art_cbs */,
  20. const char* /* app_code_cache_dir */,
  21. const char* /* isa */) {
  22. return true;
  23. }
  24. extern "C" void* native_bridge_loadLibrary(const char* /* libpath */, int /* flag */) {
  25. return nullptr;
  26. }
  27. extern "C" void* native_bridge_getTrampoline(void* /* handle */, const char* /* name */,
  28. const char* /* shorty */, uint32_t /* len */) {
  29. return nullptr;
  30. }
  31. extern "C" bool native_bridge_isSupported(const char* /* libpath */) {
  32. return false;
  33. }
  34. extern "C" const struct android::NativeBridgeRuntimeValues* native_bridge_getAppEnv(
  35. const char* /* abi */) {
  36. return nullptr;
  37. }
  38. android::NativeBridgeCallbacks NativeBridgeItf {
  39. .version = 1,
  40. .initialize = &native_bridge_initialize,
  41. .loadLibrary = &native_bridge_loadLibrary,
  42. .getTrampoline = &native_bridge_getTrampoline,
  43. .isSupported = &native_bridge_isSupported,
  44. .getAppEnv = &native_bridge_getAppEnv
  45. };