From 6b7ed17ccc3158871aef80f9ee68e2330f6c7164 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 25 May 2021 15:16:19 +0200 Subject: [PATCH] Filter exception --- app/src/main/java/eu/faircode/email/Log.java | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 7dd848f47b..e876ddec94 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -1098,6 +1098,30 @@ public class Log { */ } + if (ex instanceof StringIndexOutOfBoundsException) { + for (StackTraceElement ste : stack) + if ("android.widget.Editor$SuggestionsPopupWindow".equals(ste.getClassName()) && + "highlightTextDifferences".equals(ste.getMethodName())) + return false; + /* + Android 7.0 Samsung + java.lang.StringIndexOutOfBoundsException: length=175; regionStart=174; regionLength=7 + at java.lang.String.substring(String.java:1931) + at android.widget.Editor$SuggestionsPopupWindow.highlightTextDifferences(Editor.java:4002) + at android.widget.Editor$SuggestionsPopupWindow.updateSuggestions(Editor.java:3933) + at android.widget.Editor$SuggestionsPopupWindow.show(Editor.java:3836) + at android.widget.Editor.replace(Editor.java:428) + at android.widget.Editor$3.run(Editor.java:2362) + at android.os.Handler.handleCallback(Handler.java:751) + at android.os.Handler.dispatchMessage(Handler.java:95) + at android.os.Looper.loop(Looper.java:154) + at android.app.ActivityThread.main(ActivityThread.java:6780) + at java.lang.reflect.Method.invoke(Native Method) + at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500) + at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390) + */ + } + if (ex instanceof IllegalArgumentException && stack.length > 0 && "android.text.method.WordIterator".equals(stack[0].getClassName()) &&