LocationManager: disable location access by default

environment variable ATL_UGLY_ENABLE_LOCATION can be set to enable it
This commit is contained in:
Julian Winkler
2023-08-09 12:35:26 +02:00
parent 0282e9fbcb
commit 88c585d9dc

View File

@@ -25,6 +25,11 @@ static void location_updated (
static XdpPortal *portal = NULL; static XdpPortal *portal = NULL;
JNIEXPORT void JNICALL Java_android_location_LocationManager_nativeGetLocation(JNIEnv *env, jobject) { JNIEXPORT void JNICALL Java_android_location_LocationManager_nativeGetLocation(JNIEnv *env, jobject) {
if (!getenv("ATL_UGLY_ENABLE_LOCATION")) {
// Location access is prohibited by default until sanboxing is implemented.
// Set ATL_UGLY_ENABLE_LOCATION environment variable to enable it.
return;
}
if (!portal) { if (!portal) {
portal = xdp_portal_new(); portal = xdp_portal_new();
JavaVM *jvm; JavaVM *jvm;