From ce8e67eb5d156ad4381c821edc26fa89f49e3639 Mon Sep 17 00:00:00 2001 From: andrekir Date: Mon, 3 Oct 2022 23:57:28 -0300 Subject: [PATCH 1/7] update workflow JDK --- .github/workflows/android.yml | 11 ++++------- .github/workflows/release.yml | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index cf79f7891..fa881ea69 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -24,17 +24,14 @@ jobs: cp ./app/special/curfirmwareversion.xml ./app/src/main/res/values/ - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'adopt' + java-version: '11' + distribution: 'temurin' cache: gradle - + - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 - - - name: Integration test - run: ./gradlew test --stacktrace - name: Build debug APK run: ./gradlew assembleDebug diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88be660ab..7b1e6d553 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,10 +30,10 @@ jobs: KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }} - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'adopt' + java-version: '11' + distribution: 'temurin' # Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine - name: Find firmware release tag From 43652f4742db413eda706b3a9d2f8ade49802f7d Mon Sep 17 00:00:00 2001 From: andrekir Date: Tue, 4 Oct 2022 00:12:39 -0300 Subject: [PATCH 2/7] organize build.gradle --- app/build.gradle | 31 ++++++++++++++++--------------- build.gradle | 12 +++++++----- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4314d903a..1d15d8b46 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,20 +1,21 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-parcelize' -apply plugin: 'kotlinx-serialization' -apply plugin: 'dagger.hilt.android.plugin' -apply plugin: 'com.github.triplet.play' -apply plugin: 'de.mobilej.unmock' -// apply plugin: "app.brant.amazonappstorepublisher" +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-parcelize' + id 'kotlinx-serialization' + id 'dagger.hilt.android.plugin' + id 'com.github.triplet.play' + id 'de.mobilej.unmock' + // id "app.brant.amazonappstorepublisher" -// Firebase Crashlytics -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.google.firebase.crashlytics' + // protobufs + id 'com.google.protobuf' -// protobuf -apply plugin: 'com.google.protobuf' - -apply plugin: 'kotlin-kapt' + // Firebase Crashlytics + id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' +} unMock { keep "android.net.Uri" diff --git a/build.gradle b/build.gradle index 08634d10a..1c9ce9d1a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.6.21' - ext.coroutines_version = '1.6.0' - ext.room_version = '2.4.3' - ext.hilt_version = '2.40.5' - ext.datastore_version = '1.0.0' + ext { + kotlin_version = '1.6.21' + coroutines_version = '1.6.0' + room_version = '2.4.3' + hilt_version = '2.40.5' + datastore_version = '1.0.0' + } repositories { google() From 801bc2dd6c5d2674657a845db2656ef88b773e28 Mon Sep 17 00:00:00 2001 From: andrekir Date: Tue, 4 Oct 2022 00:22:41 -0300 Subject: [PATCH 3/7] remove GeeksvilleApplication constructors with default parameters --- .../geeksville/mesh/MeshUtilApplication.kt | 5 +---- .../mesh/android/GeeksvilleApplication.kt | 20 ++----------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/MeshUtilApplication.kt b/app/src/main/java/com/geeksville/mesh/MeshUtilApplication.kt index fc9839238..e7687fcd2 100644 --- a/app/src/main/java/com/geeksville/mesh/MeshUtilApplication.kt +++ b/app/src/main/java/com/geeksville/mesh/MeshUtilApplication.kt @@ -9,11 +9,8 @@ import com.geeksville.mesh.util.Exceptions import com.google.firebase.crashlytics.FirebaseCrashlytics import dagger.hilt.android.HiltAndroidApp -// NOTE: This is a workaround since the Hilt Gradle plugin doesn't support constructors with default parameters -open class GeeksvilleApplicationWrapper : GeeksvilleApplication() - @HiltAndroidApp -class MeshUtilApplication : GeeksvilleApplicationWrapper() { +class MeshUtilApplication : GeeksvilleApplication() { override fun onCreate() { super.onCreate() diff --git a/app/src/main/java/com/geeksville/mesh/android/GeeksvilleApplication.kt b/app/src/main/java/com/geeksville/mesh/android/GeeksvilleApplication.kt index 446a55857..0b34f9f64 100644 --- a/app/src/main/java/com/geeksville/mesh/android/GeeksvilleApplication.kt +++ b/app/src/main/java/com/geeksville/mesh/android/GeeksvilleApplication.kt @@ -4,7 +4,6 @@ import android.app.Activity import android.app.Application import android.content.Context import android.content.SharedPreferences -import android.net.ConnectivityManager import android.os.Bundle import android.provider.Settings import androidx.core.content.edit @@ -23,11 +22,7 @@ fun isGooglePlayAvailable(context: Context): Boolean { * Created by kevinh on 1/4/15. */ -open class GeeksvilleApplication( - val splunkKey: String? = null, - val mixpanelKey: String? = null, - val pushKey: String? = null -) : Application(), Logging { +open class GeeksvilleApplication : Application(), Logging { companion object { lateinit var analytics: AnalyticsProvider @@ -88,7 +83,7 @@ open class GeeksvilleApplication( } override fun onCreate() { - super.onCreate() + super.onCreate() val googleAnalytics = com.geeksville.mesh.analytics.GoogleAnalytics(this) analytics = googleAnalytics @@ -98,15 +93,4 @@ open class GeeksvilleApplication( registerActivityLifecycleCallbacks(lifecycleCallbacks) } - - fun isInternetConnected(): Boolean { - val cm = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager - - val activeNetwork = cm.getActiveNetworkInfo(); - val isConnected = activeNetwork != null && - activeNetwork.isConnectedOrConnecting(); - - return isConnected - } - } From 18c8e1253f68507ec2f5ad50cde1ee828a44681a Mon Sep 17 00:00:00 2001 From: andrekir Date: Tue, 4 Oct 2022 16:23:56 -0300 Subject: [PATCH 4/7] updating proto submodule to latest --- app/src/main/proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/proto b/app/src/main/proto index 0328a5269..d3375fe59 160000 --- a/app/src/main/proto +++ b/app/src/main/proto @@ -1 +1 @@ -Subproject commit 0328a5269f8368f1eaa617d0e39f886d03d44c76 +Subproject commit d3375fe599da1dd48572354325d3186eccf6f449 From 736d526b51e6ad1167417b75c3ed7f57edde1a10 Mon Sep 17 00:00:00 2001 From: andrekir Date: Wed, 5 Oct 2022 22:06:46 -0300 Subject: [PATCH 5/7] add router role to lsEnabled --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 3f3ab92e4..d167ad368 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -1116,8 +1116,9 @@ class MeshService : Service(), Logging { } private fun onRadioConnectionState(state: RadioServiceConnectionState) { - // sleep now disabled by default on ESP32, permanent is true unless isPowerSaving enabled - val lsEnabled = localConfig.power?.isPowerSaving ?: false + // sleep now disabled by default on ESP32, permanent is true unless light sleep enabled + val isRouter = localConfig.device.role == ConfigProtos.Config.DeviceConfig.Role.ROUTER + val lsEnabled = localConfig.power.isPowerSaving || isRouter val connected = state.isConnected val permanent = state.isPermanent || !lsEnabled onConnectionChanged( From bf2cf7bd3b21a33881d5fd882e384ec4817b6d41 Mon Sep 17 00:00:00 2001 From: andrekir Date: Wed, 5 Oct 2022 22:09:00 -0300 Subject: [PATCH 6/7] bump minDeviceVersion to 1.3.41 --- app/src/main/java/com/geeksville/mesh/service/MeshService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d167ad368..394b8c329 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshService.kt @@ -117,7 +117,7 @@ class MeshService : Service(), Logging { /** The minimmum firmware version we know how to talk to. We'll still be able to talk to 1.0 firmwares but only well enough to ask them to firmware update */ - val minDeviceVersion = DeviceVersion("1.3.0") + val minDeviceVersion = DeviceVersion("1.3.41") } enum class ConnectionState { From 840fa8c6976cca6fd3c0f67e5cd78d2b9b585c29 Mon Sep 17 00:00:00 2001 From: andrekir Date: Thu, 6 Oct 2022 18:14:08 -0300 Subject: [PATCH 7/7] 1.3.42 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1d15d8b46..dffbc1403 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,8 +43,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 30 - versionCode 20341 // format is Mmmss (where M is 1+the numeric major number - versionName "1.3.41" + versionCode 20342 // format is Mmmss (where M is 1+the numeric major number + versionName "1.3.42" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio