Skip to content

Commit 721bf4f

Browse files
authored
Merge pull request #4770 from vector-im/feature/adm/emoji-27-and-below-crash
Fixing Android 8.1.1 / 27 and below emoji crash
2 parents c6a118f + 18df540 commit 721bf4f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

changelog.d/4769.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixing emoji related crashes on android 8.1.1 and below

vector/src/main/java/im/vector/app/features/html/SpanUtils.kt

+4-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package im.vector.app.features.html
1818

19-
import android.os.Build
2019
import android.text.Spanned
2120
import android.text.style.MetricAffectingSpan
2221
import android.text.style.StrikethroughSpan
@@ -41,13 +40,11 @@ class SpanUtils @Inject constructor(
4140
)
4241
}
4342

44-
// Workaround for https://issuetracker.google.com/issues/188454876
43+
/**
44+
* TextFutures do not support StrikethroughSpan, UnderlineSpan or MetricAffectingSpan
45+
* Workaround for https://issuetracker.google.com/issues/188454876
46+
*/
4547
private fun canUseTextFuture(spanned: Spanned): Boolean {
46-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
47-
// On old devices, it works correctly
48-
return true
49-
}
50-
5148
return spanned
5249
.getSpans(0, spanned.length, Any::class.java)
5350
.all { it !is StrikethroughSpan && it !is UnderlineSpan && it !is MetricAffectingSpan }

0 commit comments

Comments
 (0)