aux/android: Move code into official namespaces

This commit is contained in:
Ryan Pavlik 2021-04-30 17:23:59 -05:00
parent 265c49d337
commit 77baa8b7e6
4 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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
{