From 2bc12fe9d63ecc53375188f80df99273370933b0 Mon Sep 17 00:00:00 2001 From: andrekir Date: Tue, 4 Jan 2022 11:15:59 -0300 Subject: [PATCH 1/4] update play-services-location --- app/build.gradle | 2 +- .../main/java/com/geeksville/mesh/service/MeshService.kt | 7 +++---- .../main/java/com/geeksville/mesh/ui/SettingsFragment.kt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 12b70ecbb..31e4224a4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -171,7 +171,7 @@ dependencies { implementation 'com.squareup.okhttp3:okhttp:4.9.0' // location services - implementation 'com.google.android.gms:play-services-location:18.0.0' + implementation 'com.google.android.gms:play-services-location:19.0.0' // For Google Sign-In (owner name accesss) implementation 'com.google.android.gms:play-services-auth:20.0.0' diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt index 5c79f1d53..4d0702ba9 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -7,6 +7,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.IBinder +import android.os.Looper import android.os.RemoteException import android.widget.Toast import androidx.annotation.UiThread @@ -196,6 +197,7 @@ class MeshService : Service(), Logging { * start our location requests (if they weren't already running) * * per https://developer.android.com/training/location/change-location-settings + * & https://developer.android.com/training/location/request-updates */ @SuppressLint("MissingPermission") @UiThread @@ -253,10 +255,7 @@ class MeshService : Service(), Logging { } val client = LocationServices.getFusedLocationProviderClient(this) - - // FIXME - should we use Looper.myLooper() in the third param per https://github.com/android/location-samples/blob/432d3b72b8c058f220416958b444274ddd186abd/LocationUpdatesForegroundService/app/src/main/java/com/google/android/gms/location/sample/locationupdatesforegroundservice/LocationUpdatesService.java - client.requestLocationUpdates(request, locationCallback, null) - + client.requestLocationUpdates(request, locationCallback, Looper.getMainLooper()) fusedLocationClient = client } } diff --git a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt index 1a0685799..ce9948838 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/SettingsFragment.kt @@ -878,7 +878,7 @@ class SettingsFragment : ScreenFragment("Settings"), Logging { } locationSettingsResponse.addOnSuccessListener { - if (!it.locationSettingsStates.isBleUsable || !it.locationSettingsStates.isLocationUsable) + if (!it.locationSettingsStates?.isBleUsable!! || !it.locationSettingsStates?.isLocationUsable!!) weNeedAccess() else debug("We have location access") From 58136c9cf48f87fefcd5f798f241f0d4db473639 Mon Sep 17 00:00:00 2001 From: andrekir Date: Sun, 9 Jan 2022 23:54:50 -0300 Subject: [PATCH 2/4] fix duplicate strings --- app/src/main/res/values-sk/strings.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 76356b8a8..9f519becf 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -63,7 +63,6 @@ Pripomenúť neskôr Ohodnotiť teraz Ohodnoťte Meshtastic - Pripojené k vysielaču Krátky dosah / Rýchle Stredný dosah / Rýchle Dlhý dosah / Rýchle @@ -104,7 +103,6 @@ Ste si istý, že chcete preladiť na základný (default) kanál? Nie je možné zmeniť kanál, pretože vysielač ešte nie je pripojený. Skúste to neskôr. Firmvér vysielača je príliš zastaralý, aby dokázal komunikovať s aplikáciou. Prosím choďte na panel nastavení a zvoľte možnosť \"Aktualizácia firmvéru\". Viac informácií nájdete na našom sprievodcovi inštaláciou firmvéru na Github-e. - Použiť Aplikácia pre odoslanie URL nebola nájdená Téma Svetlá From e8e389930eaed98345308d34472eabd11fef3cb2 Mon Sep 17 00:00:00 2001 From: andrekir Date: Mon, 10 Jan 2022 00:33:26 -0300 Subject: [PATCH 3/4] downgrade zxing:core for minSdkVersion 21 --- app/build.gradle | 6 +++--- app/src/main/AndroidManifest.xml | 3 --- app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 31e4224a4..dcd2865ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -186,9 +186,9 @@ dependencies { // https://firebase.google.com/docs/android/setup#available-libraries // barcode support - // per https://github.com/journeyapps/zxing-android-embedded for support of android version 22 - implementation('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false } - implementation 'com.google.zxing:core:3.4.1' + // per https://github.com/journeyapps/zxing-android-embedded#older-sdk-versions for minSdkVersion 21 + implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false } + implementation 'com.google.zxing:core:3.3.0' // <-- don't update def work_version = '2.7.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 91cfdb93d..7e2a26a86 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,9 +12,6 @@ android:name="android.hardware.location.gps" android:required="false" /> - - - diff --git a/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt index b2ca3fb80..73b644550 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt @@ -211,6 +211,7 @@ class ChannelFragment : ScreenFragment("Channel"), Logging { binding.scanButton.setOnClickListener { if ((requireActivity() as MainActivity).hasCameraPermission()) { + debug("Starting QR code scanner") val zxingScan = IntentIntegrator.forSupportFragment(this) zxingScan.setCameraId(0) zxingScan.setPrompt("") From 10e820d31e36445d9d624eacdfcf1ffe7407755d Mon Sep 17 00:00:00 2001 From: andrekir Date: Mon, 10 Jan 2022 17:42:00 -0300 Subject: [PATCH 4/4] 1.2.53 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index dcd2865ff..8e5b9a43c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,8 +42,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 30 // 30 can't work until an explicit location permissions dialog is added - versionCode 20252 // format is Mmmss (where M is 1+the numeric major number - versionName "1.2.52" + versionCode 20253 // format is Mmmss (where M is 1+the numeric major number + versionName "1.2.53" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio