From f1dff33dc22d18578fe49a82118b006226f1b316 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 20 Dec 2021 10:09:17 +0000 Subject: [PATCH 1/2] removing android version bypass for using text futures - the emoji span changes affect all android versions --- .../java/im/vector/app/features/html/SpanUtils.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt index e668f29a6a..6e2485071a 100644 --- a/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt +++ b/vector/src/main/java/im/vector/app/features/html/SpanUtils.kt @@ -16,7 +16,6 @@ package im.vector.app.features.html -import android.os.Build import android.text.Spanned import android.text.style.MetricAffectingSpan import android.text.style.StrikethroughSpan @@ -41,13 +40,11 @@ class SpanUtils @Inject constructor( ) } - // Workaround for https://issuetracker.google.com/issues/188454876 + /** + * TextFutures do not support StrikethroughSpan, UnderlineSpan or MetricAffectingSpan + * Workaround for https://issuetracker.google.com/issues/188454876 + */ private fun canUseTextFuture(spanned: Spanned): Boolean { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { - // On old devices, it works correctly - return true - } - return spanned .getSpans(0, spanned.length, Any::class.java) .all { it !is StrikethroughSpan && it !is UnderlineSpan && it !is MetricAffectingSpan } From 18df540487a28e58a7b1729e1207941a4ab34533 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 20 Dec 2021 10:10:07 +0000 Subject: [PATCH 2/2] adding changelog entry --- changelog.d/4769.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4769.bugfix diff --git a/changelog.d/4769.bugfix b/changelog.d/4769.bugfix new file mode 100644 index 0000000000..ec4fc96994 --- /dev/null +++ b/changelog.d/4769.bugfix @@ -0,0 +1 @@ +Fixing emoji related crashes on android 8.1.1 and below \ No newline at end of file