AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

Large text ANR when call refreshText

Open liufsd opened this issue 7 years ago • 0 comments

Expected

support show large text.

Observed

show large text content ,when call refreshText such as audio/video update. it will ANR.

 DALVIK THREADS (166):
"main" prio=5 tid=1 Suspended
  | group="main" sCount=1 dsCount=0 obj=0x7401b170 self=0xb7b26ff0
  | sysTid=14015 nice=-4 cgrp=top_visible sched=0/0 handle=0xb6f0cbec
  | state=S schedstat=( 97086069392 2645848816 27032 ) utm=9382 stm=326 core=5 HZ=100
  | stack=0xbe781000-0xbe783000 stackSize=8MB
  | held mutexes=
  at kotlin.ranges.IntProgressionIterator.nextInt(ProgressionIterators.kt:63)
  at org.wordpress.aztec.formatting.LineBlockFormatter.containsHeading(LineBlockFormatter.kt:199)
  at org.wordpress.aztec.AztecText.contains(AztecText.kt:861)
  at org.wordpress.aztec.AztecText.getAppliedStyles(AztecText.kt:786)
  at org.wordpress.aztec.AztecText.onSelectionChanged(AztecText.kt:748)
  at android.widget.TextView.spanChange(TextView.java:7883)
  at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:9618)
  at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:985)
  at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:694)
  at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:611)
  at android.text.Selection.setSelection(Selection.java:78)
  at android.text.Selection.setSelection(Selection.java:87)
  at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:318)
  at android.widget.TextView.setText(TextView.java:4097)
  at android.widget.TextView.setText(TextView.java:3967)
  at android.widget.EditText.setText(EditText.java:85)
  at android.widget.TextView.setText(TextView.java:3942)
  at org.wordpress.aztec.AztecText.refreshText(AztecText.kt:1263)
  at com.hujiang.cctalk.richtexteditor.SimpleAudioTappedImpl.update(SimpleAudioTappedImpl.kt:332)
  at com.hujiang.cctalk.richtexteditor.SimpleAudioTappedImpl.access$update(SimpleAudioTappedImpl.kt:24)
  at com.hujiang.cctalk.richtexteditor.SimpleAudioTappedImpl$downloadAudio$2$1.invoke(SimpleAudioTappedImpl.kt:242)
  at com.hujiang.cctalk.richtexteditor.SimpleAudioTappedImpl$downloadAudio$2$1.invoke(SimpleAudioTappedImpl.kt:24)
  at com.hujiang.cctalk.richtexteditor.SimpleAudioTappedImpl$onMainUIThread$1.run(SimpleAudioTappedImpl.kt:349)
  at com.badoo.mobile.util.WeakHandler$WeakRunnable.run(WeakHandler.java:443)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:137)
  at android.app.ActivityThread.main(ActivityThread.java:5595)
  at java.lang.reflect.Method.invoke!(Native method)
  at java.lang.reflect.Method.invoke(Method.java:372)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Reproduced

  1. run demo app
  2. paste large text ,such as this html: https://www.cctalk.com/m/topic/418028231327212
  3. call refresh text. it will crash .(i have custom audio span, like above html showed. it will show playing progress.)

Tested

android 5.0

liufsd avatar Aug 16 '18 07:08 liufsd