mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Cleanup
This commit is contained in:
parent
80b155e042
commit
e073563a67
4 changed files with 7 additions and 7 deletions
|
@ -81,7 +81,6 @@ import javax.inject.Provider
|
|||
@SessionScope
|
||||
internal class DefaultSession @Inject constructor(
|
||||
override val sessionParams: SessionParams,
|
||||
private val sessionCoroutineScopeHolder: SessionCoroutineScopeHolder,
|
||||
private val workManagerProvider: WorkManagerProvider,
|
||||
private val globalErrorHandler: GlobalErrorHandler,
|
||||
@SessionId
|
||||
|
@ -165,7 +164,9 @@ internal class DefaultSession @Inject constructor(
|
|||
isOpen = true
|
||||
cryptoService.get().ensureDevice()
|
||||
uiHandler.post {
|
||||
lifecycleObservers.forEach { it.onSessionStarted(this) }
|
||||
lifecycleObservers.forEach {
|
||||
it.onSessionStarted(this)
|
||||
}
|
||||
sessionListeners.dispatch {
|
||||
it.onSessionStarted(this)
|
||||
}
|
||||
|
@ -237,7 +238,9 @@ internal class DefaultSession @Inject constructor(
|
|||
stopSync()
|
||||
stopAnyBackgroundSync()
|
||||
uiHandler.post {
|
||||
lifecycleObservers.forEach { it.onClearCache(this) }
|
||||
lifecycleObservers.forEach {
|
||||
it.onClearCache(this)
|
||||
}
|
||||
sessionListeners.dispatch {
|
||||
it.onClearCache(this)
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ internal class SessionCoroutineScopeHolder @Inject constructor(): SessionLifecyc
|
|||
scope.cancelChildren()
|
||||
}
|
||||
|
||||
private fun CoroutineScope.cancelChildren(){
|
||||
private fun CoroutineScope.cancelChildren() {
|
||||
coroutineContext.cancelChildren(CancellationException("Closing session"))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1745,7 +1745,6 @@ class RoomDetailFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun onSaveActionClicked(action: EventSharedAction.Save) {
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
|
||||
&& !checkPermissions(PERMISSIONS_FOR_WRITING_FILES, requireActivity(), saveActionActivityResultLauncher)) {
|
||||
sharedActionViewModel.pendingAction = action
|
||||
|
|
|
@ -44,5 +44,4 @@ class SessionListener @Inject constructor() : Session.Listener {
|
|||
override fun onClearCache(session: Session) {
|
||||
session.coroutineScope.coroutineContext.cancelChildren()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue