From 22f4332bd56d7a6d87175a6bb5c5d38920ec1016 Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Tue, 18 Jul 2023 10:38:32 +0300 Subject: [PATCH] location service bugfix: incorrect handling of request granularity This led to crashes when client had only COARSE_LOCATION (not FINE_LOCATION) permission. Signed-off-by: Dmitrii --- src/app/grapheneos/gmscompat/location/OsLocationProvider.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/grapheneos/gmscompat/location/OsLocationProvider.kt b/src/app/grapheneos/gmscompat/location/OsLocationProvider.kt index 8db0149..280f516 100644 --- a/src/app/grapheneos/gmscompat/location/OsLocationProvider.kt +++ b/src/app/grapheneos/gmscompat/location/OsLocationProvider.kt @@ -40,6 +40,8 @@ class OsLocationProvider(val name: String, val properties: ProviderProperties?, val fudger: LocationFudger? = when (client.permission) { Permission.COARSE -> { when (granularity) { + LocationRequest.GRANULARITY_COARSE, + LocationRequest.GRANULARITY_PERMISSION_LEVEL, -> null LocationRequest.GRANULARITY_FINE -> throw SecurityException() else -> throw IllegalArgumentException() }