mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Merge branch 'meshtastic:master' into osmdroid-phase2
This commit is contained in:
commit
ec61d0c66e
8 changed files with 40 additions and 58 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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<Application>.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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue