diff --git a/app/build.gradle b/app/build.gradle index bacc9a69..38ac67d0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,15 +2,15 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { applicationId 'org.traccar.client' buildConfigField 'boolean', 'HIDDEN_APP', 'false' minSdkVersion 16 - targetSdkVersion 32 - versionCode 78 - versionName '6.17' + targetSdkVersion 33 + versionCode 79 + versionName '6.18' multiDexEnabled true } namespace 'org.traccar.client' @@ -48,7 +48,7 @@ dependencies { implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.test:core-ktx:1.4.0' - implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.core:core-ktx:1.9.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.github.judemanutd:autostarter:1.1.0' implementation('dev.doubledot.doki:library:0.0.1@aar') { @@ -60,7 +60,7 @@ dependencies { googleImplementation 'com.google.firebase:firebase-core' googleImplementation 'com.google.firebase:firebase-analytics' googleImplementation 'com.google.firebase:firebase-crashlytics' - googleImplementation 'com.google.android.gms:play-services-location:20.0.0' + googleImplementation 'com.google.android.gms:play-services-location:21.0.0' googleImplementation 'com.google.android.play:core:1.10.3' } diff --git a/app/src/main/java/org/traccar/client/PositionProvider.kt b/app/src/main/java/org/traccar/client/PositionProvider.kt index 1b84f9e5..6b50ea0c 100644 --- a/app/src/main/java/org/traccar/client/PositionProvider.kt +++ b/app/src/main/java/org/traccar/client/PositionProvider.kt @@ -47,13 +47,14 @@ abstract class PositionProvider( abstract fun requestSingleLocation() protected fun processLocation(location: Location?) { + val lastLocation = this.lastLocation if (location != null && (lastLocation == null || location.time - lastLocation!!.time >= interval || distance > 0 && location.distanceTo(lastLocation) >= distance || angle > 0 && abs(location.bearing - lastLocation!!.bearing) >= angle) ) { Log.i(TAG, "location new") - lastLocation = location + this.lastLocation = location listener.onPositionUpdate(Position(deviceId, location, getBatteryStatus(context))) } else { Log.i(TAG, if (location != null) "location ignored" else "location nil") diff --git a/build.gradle b/build.gradle index 671dd329..906ad256 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ buildscript { - ext.kotlin_version = '1.7.0' + ext.kotlin_version = '1.7.20' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' - classpath 'com.google.gms:google-services:4.3.13' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1' + classpath 'com.android.tools.build:gradle:7.3.1' + classpath 'com.google.gms:google-services:4.3.14' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0dfb4f8c..c50b3c8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip