mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-17 04:15:44 +00:00
aux/android: Move code into official namespaces
This commit is contained in:
parent
265c49d337
commit
77baa8b7e6
|
@ -24,6 +24,8 @@
|
||||||
using wrap::android::app::Activity;
|
using wrap::android::app::Activity;
|
||||||
using wrap::android::view::SurfaceHolder;
|
using wrap::android::view::SurfaceHolder;
|
||||||
using wrap::org::freedesktop::monado::auxiliary::MonadoView;
|
using wrap::org::freedesktop::monado::auxiliary::MonadoView;
|
||||||
|
using xrt::auxiliary::android::getAppInfo;
|
||||||
|
using xrt::auxiliary::android::loadClassFromPackage;
|
||||||
|
|
||||||
|
|
||||||
struct android_custom_surface
|
struct android_custom_surface
|
||||||
|
|
|
@ -19,6 +19,8 @@ using wrap::android::content::Context;
|
||||||
using wrap::android::content::pm::ApplicationInfo;
|
using wrap::android::content::pm::ApplicationInfo;
|
||||||
using wrap::android::content::pm::PackageManager;
|
using wrap::android::content::pm::PackageManager;
|
||||||
|
|
||||||
|
namespace xrt::auxiliary::android {
|
||||||
|
|
||||||
ApplicationInfo
|
ApplicationInfo
|
||||||
getAppInfo(std::string const &packageName, jobject application_context)
|
getAppInfo(std::string const &packageName, jobject application_context)
|
||||||
{
|
{
|
||||||
|
@ -78,6 +80,8 @@ loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_contex
|
||||||
return wrap::java::lang::Class();
|
return wrap::java::lang::Class();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} // namespace xrt::auxiliary::android
|
||||||
|
|
||||||
|
|
||||||
void *
|
void *
|
||||||
android_load_class_from_package(struct _JavaVM *vm,
|
android_load_class_from_package(struct _JavaVM *vm,
|
||||||
|
@ -85,6 +89,7 @@ android_load_class_from_package(struct _JavaVM *vm,
|
||||||
void *application_context,
|
void *application_context,
|
||||||
const char *classname)
|
const char *classname)
|
||||||
{
|
{
|
||||||
|
using namespace xrt::auxiliary::android;
|
||||||
jni::init(vm);
|
jni::init(vm);
|
||||||
Context context((jobject)application_context);
|
Context context((jobject)application_context);
|
||||||
auto info = getAppInfo(pkgname, (jobject)application_context);
|
auto info = getAppInfo(pkgname, (jobject)application_context);
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
#ifdef XRT_OS_ANDROID
|
#ifdef XRT_OS_ANDROID
|
||||||
|
|
||||||
|
//! C++-only functionality in the Android auxiliary library
|
||||||
|
namespace xrt::auxiliary::android {
|
||||||
|
|
||||||
using wrap::android::content::pm::ApplicationInfo;
|
using wrap::android::content::pm::ApplicationInfo;
|
||||||
|
|
||||||
ApplicationInfo
|
ApplicationInfo
|
||||||
|
@ -23,4 +26,6 @@ getAppInfo(std::string const &packageName, jobject application_context);
|
||||||
wrap::java::lang::Class
|
wrap::java::lang::Class
|
||||||
loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_context, const char *clazz_name);
|
loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_context, const char *clazz_name);
|
||||||
|
|
||||||
|
} // namespace xrt::auxiliary::android
|
||||||
|
|
||||||
#endif // XRT_OS_ANDROID
|
#endif // XRT_OS_ANDROID
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
using wrap::android::app::Activity;
|
using wrap::android::app::Activity;
|
||||||
using wrap::org::freedesktop::monado::ipc::Client;
|
using wrap::org::freedesktop::monado::ipc::Client;
|
||||||
|
using xrt::auxiliary::android::getAppInfo;
|
||||||
|
using xrt::auxiliary::android::loadClassFromPackage;
|
||||||
|
|
||||||
struct ipc_client_android
|
struct ipc_client_android
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue