Cleanup
This commit is contained in:
parent
80b155e042
commit
e073563a67
|
@ -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 New Issue