Skip to content

Commit d09df1b

Browse files
committed
Use LoggerTag.
1 parent ea32b39 commit d09df1b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ import io.element.android.features.call.impl.pip.PipView
4545
import io.element.android.features.call.impl.services.CallForegroundService
4646
import io.element.android.features.call.impl.utils.CallIntentDataParser
4747
import io.element.android.libraries.architecture.bindings
48+
import io.element.android.libraries.core.log.logger.LoggerTag
4849
import io.element.android.libraries.designsystem.theme.ElementThemeApp
4950
import io.element.android.libraries.preferences.api.store.AppPreferencesStore
5051
import timber.log.Timber
5152
import javax.inject.Inject
5253

53-
private const val loggerTag = "ElementCallActivity"
54+
private val loggerTag = LoggerTag("ElementCallActivity")
5455

5556
class ElementCallActivity :
5657
AppCompatActivity(),
@@ -135,7 +136,7 @@ class ElementCallActivity :
135136
DisposableEffect(Unit) {
136137
val listener = Runnable {
137138
if (requestPermissionCallback != null) {
138-
Timber.tag(loggerTag).w("Ignoring onUserLeaveHint event because user is asked to grant permissions")
139+
Timber.tag(loggerTag.value).w("Ignoring onUserLeaveHint event because user is asked to grant permissions")
139140
} else {
140141
pipEventSink(PictureInPictureEvents.EnterPictureInPicture)
141142
}
@@ -149,7 +150,7 @@ class ElementCallActivity :
149150
val onPictureInPictureModeChangedListener = Consumer { _: PictureInPictureModeChangedInfo ->
150151
pipEventSink(PictureInPictureEvents.OnPictureInPictureModeChanged(isInPictureInPictureMode))
151152
if (!isInPictureInPictureMode && !lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
152-
Timber.tag(loggerTag).d("Exiting PiP mode: Hangup the call")
153+
Timber.tag(loggerTag.value).d("Exiting PiP mode: Hangup the call")
153154
eventSink?.invoke(CallScreenEvents.Hangup)
154155
}
155156
}
@@ -193,18 +194,18 @@ class ElementCallActivity :
193194
}
194195
val currentCallType = webViewTarget.value
195196
if (currentCallType == null && callType == null) {
196-
Timber.tag(loggerTag).d("Re-opened the activity but we have no url to load or a cached one, finish the activity")
197+
Timber.tag(loggerTag.value).d("Re-opened the activity but we have no url to load or a cached one, finish the activity")
197198
finish()
198199
} else if (currentCallType == null) {
199-
Timber.tag(loggerTag).d("Set the call type and create the presenter")
200+
Timber.tag(loggerTag.value).d("Set the call type and create the presenter")
200201
webViewTarget.value = callType
201202
presenter = presenterFactory.create(callType!!, this)
202203
} else if (callType != currentCallType) {
203-
Timber.tag(loggerTag).d("User starts another call, restart the Activity")
204+
Timber.tag(loggerTag.value).d("User starts another call, restart the Activity")
204205
setIntent(intent)
205206
recreate()
206207
} else {
207-
Timber.tag(loggerTag).d("Coming back from notification, do nothing")
208+
Timber.tag(loggerTag.value).d("Coming back from notification, do nothing")
208209
}
209210
}
210211

0 commit comments

Comments
 (0)