Prevent crash for Span change events
For some spans, SpannableStringBuilder cannot determine the previous start and previous end values correctly. In some cases, previous end value is smaller than previous start value, and this causes DynamicLayout to access negative index values. This CL updates DynamicLayout to reflow from index 0 if such a case occurs. Test: Added a CTS test Test: bit CtsTextTestCases:android.text.cts.DynamicLayoutTest#testReflow_afterSpanChangedShouldNotThrowException Bug: 67926915 Change-Id: Ibc55edfd5e49a7782cdd807e2465f4f21577b68d
Loading
Please register or sign in to comment