Fix / add close to IncomingRequestManager
This commit is contained in:
parent
bb000f77f8
commit
5a111af2fe
|
@ -386,7 +386,7 @@ internal class DefaultCryptoService @Inject constructor(
|
||||||
*/
|
*/
|
||||||
fun close() = runBlocking(coroutineDispatchers.crypto) {
|
fun close() = runBlocking(coroutineDispatchers.crypto) {
|
||||||
cryptoCoroutineScope.coroutineContext.cancelChildren(CancellationException("Closing crypto module"))
|
cryptoCoroutineScope.coroutineContext.cancelChildren(CancellationException("Closing crypto module"))
|
||||||
|
incomingGossipingRequestManager.close()
|
||||||
olmDevice.release()
|
olmDevice.release()
|
||||||
cryptoStore.close()
|
cryptoStore.close()
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,10 @@ internal class IncomingGossipingRequestManager @Inject constructor(
|
||||||
receivedGossipingRequests.addAll(cryptoStore.getPendingIncomingGossipingRequests())
|
receivedGossipingRequests.addAll(cryptoStore.getPendingIncomingGossipingRequests())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun close() {
|
||||||
|
executor.shutdownNow()
|
||||||
|
}
|
||||||
|
|
||||||
// Recently verified devices (map of deviceId and timestamp)
|
// Recently verified devices (map of deviceId and timestamp)
|
||||||
private val recentlyVerifiedDevices = HashMap<String, Long>()
|
private val recentlyVerifiedDevices = HashMap<String, Long>()
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.lifecycle.Lifecycle
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.core.di.ActiveSessionHolder
|
import im.vector.app.core.di.ActiveSessionHolder
|
||||||
|
@ -205,6 +206,7 @@ class MainActivity : VectorBaseActivity(), UnlockedActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun displayError(failure: Throwable) {
|
private fun displayError(failure: Throwable) {
|
||||||
|
if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||||
AlertDialog.Builder(this)
|
AlertDialog.Builder(this)
|
||||||
.setTitle(R.string.dialog_title_error)
|
.setTitle(R.string.dialog_title_error)
|
||||||
.setMessage(errorFormatter.toHumanReadable(failure))
|
.setMessage(errorFormatter.toHumanReadable(failure))
|
||||||
|
@ -213,6 +215,7 @@ class MainActivity : VectorBaseActivity(), UnlockedActivity {
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun startNextActivityAndFinish() {
|
private fun startNextActivityAndFinish() {
|
||||||
val intent = when {
|
val intent = when {
|
||||||
|
|
Loading…
Reference in New Issue