Compare commits

..

5 Commits

Author SHA1 Message Date
Dennis Guse 4f745a94bf Release: v4.8.1 2023-08-22 07:15:53 +02:00
Dennis Guse 9b6df4bf99 Bugfix: request ACCESS_BACKGROUND_LOCATION fails; removing it for now.
Introduced in 3910837d1a

Part of #1653.
2023-08-22 07:15:08 +02:00
dependabot[bot] 73f325e633 Bump com.android.tools.build:gradle from 8.1.0 to 8.1.1
Bumps com.android.tools.build:gradle from 8.1.0 to 8.1.1.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 06:44:06 +02:00
Dennis Guse 28981611f1 GPX export: skip gain/loss if not present.
Part of #1671.
2023-08-20 19:38:37 +02:00
Dennis Guse 7d8c4dcb29 Bugfix: re-introduced race condition fix for newGpsStatus.
Follow-up to e9f24f6bae

Fixes #1668.
2023-08-20 19:28:37 +02:00
8 changed files with 32 additions and 13 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
classpath 'com.android.tools.build:gradle:8.1.1'
}
}
@@ -64,8 +64,8 @@ android {
defaultConfig {
applicationId "de.dennisguse.opentracks"
versionCode 5361
versionName "v4.8.0"
versionCode 5366
versionName "v4.8.1"
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
@@ -0,0 +1,5 @@
v4.8.1: OpenTracks
Bugfix:
- Location permission was not granted due to ACCESS_LOCATION_BACKGROUND (removed)
-2
View File
@@ -31,8 +31,6 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/
<gpxtrkx:MovingTime>0</gpxtrkx:MovingTime>
<gpxtrkx:StoppedTime>0</gpxtrkx:StoppedTime>
<gpxtrkx:MaxSpeed>0.0</gpxtrkx:MaxSpeed>
<gpxtrkx:Ascent>null</gpxtrkx:Ascent>
<gpxtrkx:Descent>null</gpxtrkx:Descent>
</gpxtrkx:TrackStatsExtension>
</extensions>
<trkseg>
+1 -1
View File
@@ -46,7 +46,7 @@ limitations under the License.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<!-- <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />-->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
@@ -276,7 +276,7 @@ public class TrackListActivity extends AbstractTrackDeleteActivity implements Co
}
private void requestRequiredPermissions() {
PermissionRequester.ALL.requestPermissionsIfNeeded(this, this, null, (requester) -> Toast.makeText(this, R.string.permission_gps_failed, Toast.LENGTH_SHORT).show());
PermissionRequester.ALL.requestPermissionsIfNeeded(this, this, null, (requester) -> Toast.makeText(this, R.string.permission_gps_failed, Toast.LENGTH_LONG).show());
}
@Override
@@ -279,8 +279,12 @@ public class GPXTrackExporter implements TrackExporter {
printWriter.println("<gpxtrkx:MovingTime>" + trackStatistics.getMovingTime().getSeconds() + "</gpxtrkx:MovingTime>");
printWriter.println("<gpxtrkx:StoppedTime>" + trackStatistics.getStoppedTime().getSeconds() + "</gpxtrkx:StoppedTime>");
printWriter.println("<gpxtrkx:MaxSpeed>" + trackStatistics.getMaxSpeed().toMPS() + "</gpxtrkx:MaxSpeed>");
printWriter.println("<gpxtrkx:Ascent>" + trackStatistics.getTotalAltitudeGain() + "</gpxtrkx:Ascent>");
printWriter.println("<gpxtrkx:Descent>" + trackStatistics.getTotalAltitudeLoss() + "</gpxtrkx:Descent>");
if (trackStatistics.hasTotalAltitudeGain()) {
printWriter.println("<gpxtrkx:Ascent>" + trackStatistics.getTotalAltitudeGain() + "</gpxtrkx:Ascent>");
}
if (trackStatistics.hasTotalAltitudeLoss()) {
printWriter.println("<gpxtrkx:Descent>" + trackStatistics.getTotalAltitudeLoss() + "</gpxtrkx:Descent>");
}
printWriter.println("</gpxtrkx:TrackStatsExtension>");
printWriter.println("</extensions>");
@@ -32,6 +32,8 @@ import androidx.annotation.VisibleForTesting;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.time.Duration;
import de.dennisguse.opentracks.data.models.Distance;
@@ -244,6 +246,15 @@ public class TrackRecordingService extends Service implements TrackPointCreator.
public void newGpsStatus(GpsStatusValue gpsStatusValue) {
Log.e(TAG, "newGpsStatus: " + gpsStatusValue.message);
if (notificationManager == null) {
StringWriter writer = new StringWriter();
Exception e = new RuntimeException("TrackRecording.newGpsStatus() called after onDestroy(); objectID: " + this + " with thread: " + Thread.currentThread().toString());
e.printStackTrace(new PrintWriter(writer));
Log.e(TAG, e.getMessage() + " " + writer);
return;
}
notificationManager.updateContent(getString(gpsStatusValue.message));
gpsStatusObservable.postValue(gpsStatusValue);
}
@@ -60,11 +60,12 @@ public class PermissionRequester {
private static final List<String> GPS_PERMISSION;
static {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
} else {
//TODO ACCESS_BACKGROUND_LOCATION is required for API, but the permission is not properly granted. See #1653.
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION);
// } else {
GPS_PERMISSION = List.of(Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION);
}
// }
}
private static final List<String> BLUETOOTH_PERMISSIONS;