Skip to content

Commit

Permalink
chore: add more debug information for sync #WPB-11603 (#3523)
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-kaczmarek authored Oct 25, 2024
1 parent 669d39a commit 504f25e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/src/main/kotlin/com/wire/android/WireApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ class WireApplication : BaseApp() {
override fun onActivityStarted(activity: Activity) {
globalAnalyticsManager.onStart(activity)
}

override fun onActivityResumed(activity: Activity) {}
override fun onActivityPaused(activity: Activity) {}
override fun onActivityStopped(activity: Activity) {
globalAnalyticsManager.onStop(activity)
}

override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
})
Expand Down Expand Up @@ -278,7 +280,7 @@ class WireApplication : BaseApp() {

companion object {
fun byLevel(value: Int) =
values().firstOrNull { it.level == value } ?: TRIM_MEMORY_UNKNOWN
entries.firstOrNull { it.level == value } ?: TRIM_MEMORY_UNKNOWN
}
}

Expand Down
24 changes: 22 additions & 2 deletions app/src/main/kotlin/com/wire/android/util/CurrentScreenManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class CurrentScreenManager @Inject constructor(

override fun onStart(owner: LifecycleOwner) {
super.onStart(owner)
appLogger.i("${TAG}: onStart called")
appLogger.i("${TAG}: app onStart called")
visibilityCount.getAndUpdate { currentValue ->
val newValue = maxOf(0, currentValue + 1)
isApplicationVisibleFlow.value = newValue > 0
Expand All @@ -114,7 +114,7 @@ class CurrentScreenManager @Inject constructor(

override fun onStop(owner: LifecycleOwner) {
super.onStop(owner)
appLogger.i("${TAG}: onStop called")
appLogger.i("${TAG}: app onStop called")
visibilityCount.getAndUpdate { currentValue ->
val newValue = maxOf(0, currentValue - 1)
isApplicationVisibleFlow.value = newValue > 0
Expand All @@ -136,6 +136,26 @@ class CurrentScreenManager @Inject constructor(
AnonymousAnalyticsManagerImpl.recordView(newView)
}

override fun onCreate(owner: LifecycleOwner) {
super.onCreate(owner)
appLogger.i("$TAG app onCreate called")
}

override fun onResume(owner: LifecycleOwner) {
super.onResume(owner)
appLogger.i("$TAG app onResume called")
}

override fun onPause(owner: LifecycleOwner) {
super.onPause(owner)
appLogger.i("$TAG app onPause called")
}

override fun onDestroy(owner: LifecycleOwner) {
super.onDestroy(owner)
appLogger.i("$TAG app onDestroy called")
}

companion object {
private const val TAG = "CurrentScreenManager"
}
Expand Down

0 comments on commit 504f25e

Please sign in to comment.