This class implements functions for Android application permissions.
More...
|
static bool | hasPermission (JavaVM *javaVM, jobject activity, const std::string &permission, bool &state, const bool translate=true) |
| Returns whether the Android app has a specific permission. More...
|
|
static bool | requestPermissions (JavaVM *javaVM, jobject activity, const std::vector< std::string > &permissions, const bool translate=true) |
| Requests several permissions for the Android app. More...
|
|
static std::string | translatePermission (JNIEnv *jniEnv, const std::string &permission) |
| Determines Android's internal permission name for a readable permission. More...
|
|
This class implements functions for Android application permissions.
◆ hasPermission()
static bool Ocean::Platform::Android::Permission::hasPermission |
( |
JavaVM * |
javaVM, |
|
|
jobject |
activity, |
|
|
const std::string & |
permission, |
|
|
bool & |
state, |
|
|
const bool |
translate = true |
|
) |
| |
|
static |
Returns whether the Android app has a specific permission.
- Parameters
-
javaVM | The Java virtual machine, must be valid |
activity | The Android main activity, must be valid |
permission | The permission to be checked, must be valid |
translate | If true, translates short permission name to Android-internal full permission name, note: must be false for Oculus permissions, e.g., com.oculus.permission.USE_SCENE |
state | True, if the app has the specified permission; False, if the app does not have the specified permission |
- Returns
- True, if succeeded
◆ requestPermissions()
static bool Ocean::Platform::Android::Permission::requestPermissions |
( |
JavaVM * |
javaVM, |
|
|
jobject |
activity, |
|
|
const std::vector< std::string > & |
permissions, |
|
|
const bool |
translate = true |
|
) |
| |
|
static |
Requests several permissions for the Android app.
- Parameters
-
javaVM | The Java virtual machine, must be valid |
activity | The Android main activity, must be valid |
permissions | The permissions to be requested, at least one |
translate | If true, translates short permission name to Android-internal full permission name, note: must be false for Oculus permissions, e.g., com.oculus.permission.USE_SCENE |
- Returns
- True, if the request was invoked successfully, does not check whether the permission was granted
◆ translatePermission()
static std::string Ocean::Platform::Android::Permission::translatePermission |
( |
JNIEnv * |
jniEnv, |
|
|
const std::string & |
permission |
|
) |
| |
|
static |
Determines Android's internal permission name for a readable permission.
- Parameters
-
jniEnv | The Java environment, attached with the current thread, must be valid |
permission | The readable permission |
- Returns
- Android's internal permission
The documentation for this class was generated from the following file: