From 88c585d9dc925727a53a79a993d01aedd63f7557 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Wed, 9 Aug 2023 12:35:26 +0200 Subject: [PATCH] LocationManager: disable location access by default environment variable ATL_UGLY_ENABLE_LOCATION can be set to enable it --- src/api-impl-jni/location/android_location_LocationManager.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api-impl-jni/location/android_location_LocationManager.c b/src/api-impl-jni/location/android_location_LocationManager.c index 175847cd..57fe34bb 100644 --- a/src/api-impl-jni/location/android_location_LocationManager.c +++ b/src/api-impl-jni/location/android_location_LocationManager.c @@ -25,6 +25,11 @@ static void location_updated ( static XdpPortal *portal = NULL; 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) { portal = xdp_portal_new(); JavaVM *jvm;