From 64c0b5fa9556581ea81a99ec3fa0814a2598c16f Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 14 Jun 2022 07:02:38 +0200 Subject: [PATCH] Revert "Attempt to workaround Android 8 block index bug" This reverts commit 388af6e7c57e7af8424c01ea15cbe7d0a315b664. --- .../java/eu/faircode/email/FixedEditText.java | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FixedEditText.java b/app/src/main/java/eu/faircode/email/FixedEditText.java index 039a0199f8..03f482be68 100644 --- a/app/src/main/java/eu/faircode/email/FixedEditText.java +++ b/app/src/main/java/eu/faircode/email/FixedEditText.java @@ -25,7 +25,6 @@ import android.os.Build; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; -import android.view.View; import android.view.textclassifier.TextClassifier; import androidx.annotation.NonNull; @@ -124,24 +123,16 @@ public class FixedEditText extends AppCompatEditText { super.onDraw(canvas); } catch (Throwable ex) { Log.w(ex); - if (ex instanceof ArrayIndexOutOfBoundsException) - try { - /* - java.lang.ArrayIndexOutOfBoundsException: length=39; index=-3 - at android.text.DynamicLayout.getBlockIndex(DynamicLayout.java:648) - at android.widget.Editor.drawHardwareAccelerated(Editor.java:1703) - at android.widget.Editor.onDraw(Editor.java:1672) - at android.widget.TextView.onDraw(TextView.java:6914) - at android.view.View.draw(View.java:19200) - - Fixed in Android 9: - https://android-review.googlesource.com/c/platform/frameworks/base/+/634929 - */ - setLayerType(View.LAYER_TYPE_SOFTWARE, null); - super.onDraw(canvas); - } catch (Throwable exex) { - Log.w(exex); - } + /* + java.lang.ArrayIndexOutOfBoundsException: length=39; index=-3 + at android.text.DynamicLayout.getBlockIndex(DynamicLayout.java:648) + at android.widget.Editor.drawHardwareAccelerated(Editor.java:1703) + at android.widget.Editor.onDraw(Editor.java:1672) + at android.widget.TextView.onDraw(TextView.java:6914) + at android.view.View.draw(View.java:19200) + Fixed in Android 9: + https://android-review.googlesource.com/c/platform/frameworks/base/+/634929 + */ } }