mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Inject PlatformAnalytics directly (#3358)
This commit is contained in:
parent
95ec4877df
commit
1fb79d8887
7 changed files with 29 additions and 30 deletions
|
|
@ -19,9 +19,7 @@ package com.geeksville.mesh
|
|||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
import org.meshtastic.core.analytics.platform.PlatformAnalytics
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
* The main application class for Meshtastic.
|
||||
|
|
@ -30,26 +28,7 @@ import javax.inject.Inject
|
|||
* application components, including analytics and platform-specific helpers, and manages analytics consent based on
|
||||
* user preferences.
|
||||
*/
|
||||
@HiltAndroidApp
|
||||
class MeshUtilApplication : Application() {
|
||||
|
||||
@Inject lateinit var platformAnalytics: PlatformAnalytics
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Provides access to the platform-specific analytics provider. Initialized via the injected [PlatformAnalytics]
|
||||
* during [onCreate].
|
||||
*/
|
||||
lateinit var analytics: PlatformAnalytics
|
||||
private set
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
// Initialize platform-specific features (analytics, crash reporting, etc.)
|
||||
analytics = platformAnalytics
|
||||
}
|
||||
}
|
||||
@HiltAndroidApp class MeshUtilApplication : Application()
|
||||
|
||||
fun logAssert(executeReliableWrite: Boolean) {
|
||||
if (!executeReliableWrite) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue