diff options
| author | JosJuice <josjuice@gmail.com> | 2025-04-26 10:45:56 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2025-04-26 10:45:56 +0200 |
| commit | 3ed3fb05afc79d14ba1ea94eaf83b9bf70addb6f (patch) | |
| tree | 80b269f9f17675382f647290baa20fe5f7a2539a /Source/Android | |
| parent | 805307f432dba079caf7339122a07de5b90c4b47 (diff) | |
Android: Allow reporting start to analytics for non-main activity
a1691a4 made it so analytics start events can only be generated when
starting the main activity. However, some users launch Dolphin's
emulation activity from a separate frontend application, bypassing
Dolphin's main activity. This change adjusts the logic so that start
events can be generated if any activity is started after 6 hours of
inactivity. This more closely matches the behavior we had before
a1691a4, while still ensuring duplicate start events aren't generated.
I've also fixed the inconsistent indentation in ActivityTracker.kt.
Diffstat (limited to 'Source/Android')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ActivityTracker.kt | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ActivityTracker.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ActivityTracker.kt index 83a34e3e8c..f4423c6d36 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ActivityTracker.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ActivityTracker.kt @@ -11,20 +11,18 @@ class ActivityTracker : ActivityLifecycleCallbacks { private var firstStart = true private fun isMainActivity(activity: Activity): Boolean { - return activity is MainView + return activity is MainView } override fun onActivityCreated(activity: Activity, bundle: Bundle?) { - if (isMainActivity(activity)) { - firstStart = bundle == null - } + if (isMainActivity(activity)) { + firstStart = bundle == null + } } override fun onActivityStarted(activity: Activity) { - if (isMainActivity(activity)) { StartupHandler.reportStartToAnalytics(activity.applicationContext, firstStart) firstStart = false - } } override fun onActivityResumed(activity: Activity) { @@ -44,9 +42,9 @@ class ActivityTracker : ActivityLifecycleCallbacks { } override fun onActivityStopped(activity: Activity) { - if (isMainActivity(activity)) { - StartupHandler.updateSessionTimestamp(activity.applicationContext) - } + if (isMainActivity(activity)) { + StartupHandler.updateSessionTimestamp(activity.applicationContext) + } } override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {} |
