mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-15 10:48:54 +03:00
Fix crash on incoming share throwing SecurityException
Tested with org.mozilla.fennec_fdroid Version 103.1.0 (1031020) when sharing to quick contacts. Change-Id: Ie66e5945aa85fe309b1cfc42d7bad61675a1b4b8
This commit is contained in:
parent
772ac44994
commit
bd5f011c0e
1 changed files with 19 additions and 11 deletions
|
@ -40,6 +40,7 @@ import im.vector.app.features.attachments.ShareIntentHandler
|
|||
import im.vector.app.features.attachments.preview.AttachmentsPreviewActivity
|
||||
import im.vector.app.features.attachments.preview.AttachmentsPreviewArgs
|
||||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
|
@ -106,17 +107,24 @@ class IncomingShareFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun handleIncomingShareIntent(intent: Intent) = shareIntentHandler.handleIncomingShareIntent(
|
||||
intent,
|
||||
onFile = {
|
||||
val sharedData = SharedData.Attachments(it)
|
||||
viewModel.handle(IncomingShareAction.UpdateSharedData(sharedData))
|
||||
},
|
||||
onPlainText = {
|
||||
val sharedData = SharedData.Text(it)
|
||||
viewModel.handle(IncomingShareAction.UpdateSharedData(sharedData))
|
||||
}
|
||||
)
|
||||
private fun handleIncomingShareIntent(intent: Intent): Boolean {
|
||||
return try {
|
||||
shareIntentHandler.handleIncomingShareIntent(
|
||||
intent,
|
||||
onFile = {
|
||||
val sharedData = SharedData.Attachments(it)
|
||||
viewModel.handle(IncomingShareAction.UpdateSharedData(sharedData))
|
||||
},
|
||||
onPlainText = {
|
||||
val sharedData = SharedData.Text(it)
|
||||
viewModel.handle(IncomingShareAction.UpdateSharedData(sharedData))
|
||||
}
|
||||
)
|
||||
} catch (e: SecurityException) {
|
||||
Timber.e(e, "Security exception handling incoming share")
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleMultipleRoomsShareDone(viewEvent: IncomingShareViewEvents.MultipleRoomsShareDone) {
|
||||
requireActivity().let {
|
||||
|
|
Loading…
Add table
Reference in a new issue