From 85c6ed61bbebe40cd4418b515ab71709aea99448 Mon Sep 17 00:00:00 2001
From: James Rich <2199651+jamesarich@users.noreply.github.com>
Date: Wed, 25 Feb 2026 20:44:13 -0600
Subject: [PATCH] refactor(analytics): reduce tracking footprint (#4649)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
---
app/src/main/AndroidManifest.xml | 15 ++
.../LocalStatsWidgetStateProviderTest.kt | 119 ---------------
.../platform/GooglePlatformAnalytics.kt | 136 ++++++++++++------
.../core/prefs/analytics/AnalyticsPrefs.kt | 2 +-
4 files changed, 109 insertions(+), 163 deletions(-)
delete mode 100644 app/src/test/java/com/geeksville/mesh/widget/LocalStatsWidgetStateProviderTest.kt
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 64d43a759..90a786cb1 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -135,6 +135,21 @@
android:name="google_analytics_default_allow_ad_personalization_signals"
android:value="false" />
+
+
+
+
+
+
+
+
+
.
- */
-package com.geeksville.mesh.widget
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import io.mockk.coEvery
-import io.mockk.every
-import io.mockk.mockk
-import io.mockk.mockkStatic
-import io.mockk.unmockkAll
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.first
-import kotlinx.coroutines.test.runTest
-import org.junit.After
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertFalse
-import org.junit.Assert.assertTrue
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.meshtastic.core.data.repository.NodeRepository
-import org.meshtastic.core.database.model.Node
-import org.meshtastic.core.model.util.onlineTimeThreshold
-import org.meshtastic.core.resources.getStringSuspend
-import org.meshtastic.core.service.ConnectionState
-import org.meshtastic.core.service.ServiceRepository
-import org.meshtastic.proto.DeviceMetrics
-import org.meshtastic.proto.LocalStats
-import org.meshtastic.proto.User
-import org.robolectric.annotation.Config
-
-@RunWith(AndroidJUnit4::class)
-@Config(sdk = [34])
-@OptIn(ExperimentalCoroutinesApi::class)
-class LocalStatsWidgetStateProviderTest {
-
- private val connectionStateFlow = MutableStateFlow(ConnectionState.Disconnected)
- private val nodeDbFlow = MutableStateFlow