From 40a59e4afe0122f93ca2971d2d567be319537fae Mon Sep 17 00:00:00 2001 From: vanya elizarov Date: Sun, 31 Dec 2023 18:13:59 +0300 Subject: [PATCH 1/2] fix LocationManager `minUpdateIntervalMillis` --- .../com/baseflow/geolocator/location/LocationManagerClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/LocationManagerClient.java b/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/LocationManagerClient.java index a57054d15..c8b3e59a0 100644 --- a/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/LocationManagerClient.java +++ b/geolocator_android/android/src/main/java/com/baseflow/geolocator/location/LocationManagerClient.java @@ -181,6 +181,7 @@ public void startPositionUpdates( final LocationRequestCompat locationRequest = new LocationRequestCompat.Builder(timeInterval) .setMinUpdateDistanceMeters(distanceFilter) + .setMinUpdateIntervalMillis(timeInterval) .setQuality(quality) .build(); From d216de44cb9833403a339bc41fe56548231d0b95 Mon Sep 17 00:00:00 2001 From: vanya elizarov Date: Sun, 31 Dec 2023 18:22:35 +0300 Subject: [PATCH 2/2] bump version, update CHANGELOG --- geolocator_android/CHANGELOG.md | 4 ++++ geolocator_android/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/geolocator_android/CHANGELOG.md b/geolocator_android/CHANGELOG.md index 2252b527f..643feb901 100644 --- a/geolocator_android/CHANGELOG.md +++ b/geolocator_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.4.1 + +* Fixes a bug where `getPositionStream` caused an `java.lang.IllegalStateException: passive location requests must have an explicit minimum update interval` because `minUpdateIntervalMillis` property in location request was set to -1 by default + ## 4.4.0 - Adds `color` to `ForegroundNotificationConfig` to set the color of the notification icon. diff --git a/geolocator_android/pubspec.yaml b/geolocator_android/pubspec.yaml index 5b98eb575..62d51482f 100644 --- a/geolocator_android/pubspec.yaml +++ b/geolocator_android/pubspec.yaml @@ -2,7 +2,7 @@ name: geolocator_android description: Geolocation plugin for Flutter. This plugin provides the Android implementation for the geolocator. repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_android issue_tracker: https://github.com/baseflow/flutter-geolocator/issues?q=is%3Aissue+is%3Aopen -version: 4.4.0 +version: 4.4.1 environment: sdk: ">=2.15.0 <4.0.0"