Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Interval tree for SpannableStringBuilder
Browse files Browse the repository at this point in the history
This CL greatly improves the speed of SpannableStringBuilder by storing
the spans as an interval tree with binary search.

Bug: 7404182
Change-Id: I2540b2cfe8aef128337e63829479660ba51e62b5
  • Loading branch information
raphlinus committed Feb 12, 2015
1 parent c911612 commit d7c020e
Showing 1 changed file with 361 additions and 189 deletions.
Loading

1 comment on commit d7c020e

@tibot
Copy link

@tibot tibot commented on d7c020e Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

We currently have a framework bug probably caused by this revision.
Below you will find ly stack trace :

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tetra4d.pdf3dviewer, PID: 23172
java.lang.ArrayIndexOutOfBoundsException: length=9; index=-1
at android.text.SpannableStringBuilder.getSpanFlags(SpannableStringBuilder.java:808)
at android.view.inputmethod.BaseInputConnection.removeComposingSpans(BaseInputConnection.java:82)
at android.view.inputmethod.BaseInputConnection.finishComposingText(BaseInputConnection.java:272)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:362)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/GAv4: Successfully bound to service but never got onServiceConnected callback
I/Process: Sending signal. PID: 23172 SIG: 9
Application terminated.

I can reproduce the problem evrytime I create Spannable objects.
Is there a workaround overide the default class? How is it possible to broke the framework and obtaining this kind of bug?

Thanks for your answer

Thibault Tournier
Tetra4D engineering team

Please sign in to comment.