mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-23 15:11:47 +00:00
c924157c59
Should allow a constrained query manifest in client apps.
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
// Copyright 2020, Collabora, Ltd.
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
/*!
|
|
* @file
|
|
* @brief Function for loading Java code from a package.
|
|
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
|
|
* @ingroup aux_android
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <xrt/xrt_config_os.h>
|
|
|
|
#include "wrap/android.app.h"
|
|
|
|
#ifdef XRT_OS_ANDROID
|
|
|
|
//! C++-only functionality in the Android auxiliary library
|
|
namespace xrt::auxiliary::android {
|
|
|
|
using wrap::android::content::pm::ApplicationInfo;
|
|
|
|
/*!
|
|
* @note Starting from Android 11, NameNotFoundException exception is thrown if application doesn't
|
|
* specify either <queries> or "android.permission.QUERY_ALL_PACKAGES".
|
|
* See https://developer.android.com/training/package-visibility for detail.
|
|
*
|
|
* We work around this by querying first for org.khronos.openxr.OpenXRRuntimeService, for which a query entry is
|
|
* added by the Loader manifest.
|
|
*/
|
|
ApplicationInfo
|
|
getAppInfo(std::string const &packageName, jobject application_context);
|
|
|
|
/*!
|
|
* @note Starting from Android 11, NameNotFoundException exception is thrown if application doesn't
|
|
* specify either <queries> or "android.permission.QUERY_ALL_PACKAGES".
|
|
* See https://developer.android.com/training/package-visibility for detail.
|
|
*/
|
|
wrap::java::lang::Class
|
|
loadClassFromPackage(ApplicationInfo applicationInfo, jobject application_context, const char *clazz_name);
|
|
|
|
/*!
|
|
* Loading class from given apk path.
|
|
*
|
|
* @param application_context Context.
|
|
* @param apk_path Path to apk.
|
|
* @param clazz_name Name of class to be loaded.
|
|
* @return Class object.
|
|
*/
|
|
wrap::java::lang::Class
|
|
loadClassFromApk(jobject application_context, const char *apk_path, const char *clazz_name);
|
|
|
|
/*!
|
|
* Loading class from runtime apk.
|
|
*
|
|
* @param application_context Context.
|
|
* @param clazz_name Name of class to be loaded.
|
|
* @return Class object.
|
|
*/
|
|
wrap::java::lang::Class
|
|
loadClassFromRuntimeApk(jobject application_context, const char *clazz_name);
|
|
|
|
} // namespace xrt::auxiliary::android
|
|
|
|
#endif // XRT_OS_ANDROID
|