mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
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 beforea1691a4
, while still ensuring duplicate start events aren't generated. I've also fixed the inconsistent indentation in ActivityTracker.kt.
This commit is contained in:
@ -11,20 +11,18 @@ class ActivityTracker : ActivityLifecycleCallbacks {
|
|||||||
private var firstStart = true
|
private var firstStart = true
|
||||||
|
|
||||||
private fun isMainActivity(activity: Activity): Boolean {
|
private fun isMainActivity(activity: Activity): Boolean {
|
||||||
return activity is MainView
|
return activity is MainView
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityCreated(activity: Activity, bundle: Bundle?) {
|
override fun onActivityCreated(activity: Activity, bundle: Bundle?) {
|
||||||
if (isMainActivity(activity)) {
|
if (isMainActivity(activity)) {
|
||||||
firstStart = bundle == null
|
firstStart = bundle == null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityStarted(activity: Activity) {
|
override fun onActivityStarted(activity: Activity) {
|
||||||
if (isMainActivity(activity)) {
|
|
||||||
StartupHandler.reportStartToAnalytics(activity.applicationContext, firstStart)
|
StartupHandler.reportStartToAnalytics(activity.applicationContext, firstStart)
|
||||||
firstStart = false
|
firstStart = false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResumed(activity: Activity) {
|
override fun onActivityResumed(activity: Activity) {
|
||||||
@ -44,9 +42,9 @@ class ActivityTracker : ActivityLifecycleCallbacks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityStopped(activity: Activity) {
|
override fun onActivityStopped(activity: Activity) {
|
||||||
if (isMainActivity(activity)) {
|
if (isMainActivity(activity)) {
|
||||||
StartupHandler.updateSessionTimestamp(activity.applicationContext)
|
StartupHandler.updateSessionTimestamp(activity.applicationContext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {}
|
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {}
|
||||||
|
Reference in New Issue
Block a user