Skip to content

Commit

Permalink
location service bugfix: incorrect handling of request granularity
Browse files Browse the repository at this point in the history
This led to crashes when client had only COARSE_LOCATION (not FINE_LOCATION) permission.

Signed-off-by: Dmitrii <bankersenator@gmail.com>
  • Loading branch information
muhomorr authored and shutter-cat committed Aug 3, 2023
1 parent 33fc52d commit 22f4332
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/grapheneos/gmscompat/location/OsLocationProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 22f4332

Please sign in to comment.