kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Merge branch 'meshtastic:master' into osmdroid-phase2
commit
ec61d0c66e
|
@ -24,18 +24,15 @@ jobs:
|
||||||
cp ./app/special/curfirmwareversion.xml ./app/src/main/res/values/
|
cp ./app/special/curfirmwareversion.xml ./app/src/main/res/values/
|
||||||
|
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: '11'
|
||||||
distribution: 'adopt'
|
distribution: 'temurin'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
|
||||||
- name: Validate Gradle wrapper
|
- name: Validate Gradle wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
- name: Integration test
|
|
||||||
run: ./gradlew test --stacktrace
|
|
||||||
|
|
||||||
- name: Build debug APK
|
- name: Build debug APK
|
||||||
run: ./gradlew assembleDebug
|
run: ./gradlew assembleDebug
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ jobs:
|
||||||
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
||||||
|
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: '11'
|
||||||
distribution: 'adopt'
|
distribution: 'temurin'
|
||||||
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
|
# 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
|
- name: Find firmware release tag
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
apply plugin: 'com.android.application'
|
plugins {
|
||||||
apply plugin: 'kotlin-android'
|
id 'com.android.application'
|
||||||
apply plugin: 'kotlin-parcelize'
|
id 'kotlin-android'
|
||||||
apply plugin: 'kotlinx-serialization'
|
id 'kotlin-kapt'
|
||||||
apply plugin: 'dagger.hilt.android.plugin'
|
id 'kotlin-parcelize'
|
||||||
apply plugin: 'com.github.triplet.play'
|
id 'kotlinx-serialization'
|
||||||
apply plugin: 'de.mobilej.unmock'
|
id 'dagger.hilt.android.plugin'
|
||||||
// apply plugin: "app.brant.amazonappstorepublisher"
|
id 'com.github.triplet.play'
|
||||||
|
id 'de.mobilej.unmock'
|
||||||
|
// id "app.brant.amazonappstorepublisher"
|
||||||
|
|
||||||
// Firebase Crashlytics
|
// protobufs
|
||||||
apply plugin: 'com.google.gms.google-services'
|
id 'com.google.protobuf'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
|
||||||
|
|
||||||
// protobuf
|
// Firebase Crashlytics
|
||||||
apply plugin: 'com.google.protobuf'
|
id 'com.google.gms.google-services'
|
||||||
|
id 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-kapt'
|
}
|
||||||
|
|
||||||
unMock {
|
unMock {
|
||||||
keep "android.net.Uri"
|
keep "android.net.Uri"
|
||||||
|
@ -42,8 +43,8 @@ android {
|
||||||
applicationId "com.geeksville.mesh"
|
applicationId "com.geeksville.mesh"
|
||||||
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
|
minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works)
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 20341 // format is Mmmss (where M is 1+the numeric major number
|
versionCode 20342 // format is Mmmss (where M is 1+the numeric major number
|
||||||
versionName "1.3.41"
|
versionName "1.3.42"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
// per https://developer.android.com/studio/write/vector-asset-studio
|
// per https://developer.android.com/studio/write/vector-asset-studio
|
||||||
|
|
|
@ -9,11 +9,8 @@ import com.geeksville.mesh.util.Exceptions
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||||
import dagger.hilt.android.HiltAndroidApp
|
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
|
@HiltAndroidApp
|
||||||
class MeshUtilApplication : GeeksvilleApplicationWrapper() {
|
class MeshUtilApplication : GeeksvilleApplication() {
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.app.Activity
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.net.ConnectivityManager
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
|
@ -23,11 +22,7 @@ fun isGooglePlayAvailable(context: Context): Boolean {
|
||||||
* Created by kevinh on 1/4/15.
|
* Created by kevinh on 1/4/15.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
open class GeeksvilleApplication(
|
open class GeeksvilleApplication : Application(), Logging {
|
||||||
val splunkKey: String? = null,
|
|
||||||
val mixpanelKey: String? = null,
|
|
||||||
val pushKey: String? = null
|
|
||||||
) : Application(), Logging {
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
lateinit var analytics: AnalyticsProvider
|
lateinit var analytics: AnalyticsProvider
|
||||||
|
@ -88,7 +83,7 @@ open class GeeksvilleApplication(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super<Application>.onCreate()
|
super.onCreate()
|
||||||
|
|
||||||
val googleAnalytics = com.geeksville.mesh.analytics.GoogleAnalytics(this)
|
val googleAnalytics = com.geeksville.mesh.analytics.GoogleAnalytics(this)
|
||||||
analytics = googleAnalytics
|
analytics = googleAnalytics
|
||||||
|
@ -98,15 +93,4 @@ open class GeeksvilleApplication(
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(lifecycleCallbacks)
|
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
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
/** 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 {
|
enum class ConnectionState {
|
||||||
|
@ -1116,8 +1116,9 @@ class MeshService : Service(), Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onRadioConnectionState(state: RadioServiceConnectionState) {
|
private fun onRadioConnectionState(state: RadioServiceConnectionState) {
|
||||||
// sleep now disabled by default on ESP32, permanent is true unless isPowerSaving enabled
|
// sleep now disabled by default on ESP32, permanent is true unless light sleep enabled
|
||||||
val lsEnabled = localConfig.power?.isPowerSaving ?: false
|
val isRouter = localConfig.device.role == ConfigProtos.Config.DeviceConfig.Role.ROUTER
|
||||||
|
val lsEnabled = localConfig.power.isPowerSaving || isRouter
|
||||||
val connected = state.isConnected
|
val connected = state.isConnected
|
||||||
val permanent = state.isPermanent || !lsEnabled
|
val permanent = state.isPermanent || !lsEnabled
|
||||||
onConnectionChanged(
|
onConnectionChanged(
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0328a5269f8368f1eaa617d0e39f886d03d44c76
|
Subproject commit d3375fe599da1dd48572354325d3186eccf6f449
|
12
build.gradle
12
build.gradle
|
@ -1,11 +1,13 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.6.21'
|
ext {
|
||||||
ext.coroutines_version = '1.6.0'
|
kotlin_version = '1.6.21'
|
||||||
ext.room_version = '2.4.3'
|
coroutines_version = '1.6.0'
|
||||||
ext.hilt_version = '2.40.5'
|
room_version = '2.4.3'
|
||||||
ext.datastore_version = '1.0.0'
|
hilt_version = '2.40.5'
|
||||||
|
datastore_version = '1.0.0'
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
|
Ładowanie…
Reference in New Issue