From 60d75ff8e2104c2e5b2fb004920a20f6a37af4cc Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 10 Nov 2021 18:55:34 +0100 Subject: [PATCH] Fix crash on Android 12. I guess we accept only images coming from the keyboard. --- .../app/features/home/room/detail/composer/ComposerEditText.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt index d5fb3a4d91..03107fd3f7 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/ComposerEditText.kt @@ -46,7 +46,7 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? { var ic = super.onCreateInputConnection(editorInfo) ?: return null - val mimeTypes = ViewCompat.getOnReceiveContentMimeTypes(this) ?: arrayOf("*/*") + val mimeTypes = ViewCompat.getOnReceiveContentMimeTypes(this) ?: arrayOf("image/*") EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes) ic = InputConnectionCompat.createWrapper(this, ic, editorInfo)