diff --git a/src/xrt/auxiliary/android/android_custom_surface.cpp b/src/xrt/auxiliary/android/android_custom_surface.cpp index 829f01fd4..eacfabe1c 100644 --- a/src/xrt/auxiliary/android/android_custom_surface.cpp +++ b/src/xrt/auxiliary/android/android_custom_surface.cpp @@ -24,6 +24,8 @@ using wrap::android::app::Activity; using wrap::android::view::SurfaceHolder; using wrap::org::freedesktop::monado::auxiliary::MonadoView; +using xrt::auxiliary::android::getAppInfo; +using xrt::auxiliary::android::loadClassFromPackage; struct android_custom_surface diff --git a/src/xrt/auxiliary/android/android_load_class.cpp b/src/xrt/auxiliary/android/android_load_class.cpp index 47f42c60b..5db978ba4 100644 --- a/src/xrt/auxiliary/android/android_load_class.cpp +++ b/src/xrt/auxiliary/android/android_load_class.cpp @@ -19,6 +19,8 @@ using wrap::android::content::Context; using wrap::android::content::pm::ApplicationInfo; using wrap::android::content::pm::PackageManager; +namespace xrt::auxiliary::android { + ApplicationInfo getAppInfo(std::string const &packageName, jobject application_context) { @@ -78,6 +80,8 @@ loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_contex return wrap::java::lang::Class(); } } +} // namespace xrt::auxiliary::android + void * android_load_class_from_package(struct _JavaVM *vm, @@ -85,6 +89,7 @@ android_load_class_from_package(struct _JavaVM *vm, void *application_context, const char *classname) { + using namespace xrt::auxiliary::android; jni::init(vm); Context context((jobject)application_context); auto info = getAppInfo(pkgname, (jobject)application_context); diff --git a/src/xrt/auxiliary/android/android_load_class.hpp b/src/xrt/auxiliary/android/android_load_class.hpp index 327158c3e..967889150 100644 --- a/src/xrt/auxiliary/android/android_load_class.hpp +++ b/src/xrt/auxiliary/android/android_load_class.hpp @@ -15,6 +15,9 @@ #ifdef XRT_OS_ANDROID +//! C++-only functionality in the Android auxiliary library +namespace xrt::auxiliary::android { + using wrap::android::content::pm::ApplicationInfo; ApplicationInfo @@ -23,4 +26,6 @@ getAppInfo(std::string const &packageName, jobject application_context); wrap::java::lang::Class loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_context, const char *clazz_name); +} // namespace xrt::auxiliary::android + #endif // XRT_OS_ANDROID diff --git a/src/xrt/ipc/android/ipc_client_android.cpp b/src/xrt/ipc/android/ipc_client_android.cpp index 46adb195a..3d69a346f 100644 --- a/src/xrt/ipc/android/ipc_client_android.cpp +++ b/src/xrt/ipc/android/ipc_client_android.cpp @@ -19,6 +19,8 @@ using wrap::android::app::Activity; using wrap::org::freedesktop::monado::ipc::Client; +using xrt::auxiliary::android::getAppInfo; +using xrt::auxiliary::android::loadClassFromPackage; struct ipc_client_android {