OSDN Git Service

Fix crash during cursor moving on BiDi text
authorSeigo Nonaka <nona@google.com>
Thu, 19 Jul 2018 23:22:02 +0000 (16:22 -0700)
committerRyan Longair <rlongair@google.com>
Thu, 30 Aug 2018 20:35:48 +0000 (13:35 -0700)
commit0137b7e3d00b30e4d9b48a779d2ed8e69f9ac5e1
tree1e6240654e0da222020e9762ab760cf1ed30ce5a
parentb2f8ab8e21c12070d165a00adeb68cae5f38014b
Fix crash during cursor moving on BiDi text

The crash was introduced by Ib66ef392c19c937718e7101f6d48fac3abe51ad0
The root cause of the crashing is requesting out-of-line access for the
horizontal width. This invalid access is silently ignored by
TextLine#measure() method but new implementation end up with out of
bounds access.

To makes behavior as old implementation, calling getHorizontal instead
of accessing measured result array.

Bug: 78464361111580019
Test: Manually done
Change-Id: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit 960647d582911ae7ab8b9491097898e6c313aaf1)
Merged-In: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit d30c55e3ccf25668fcbccf29c94224fd1d2e67b6)
core/java/android/text/Layout.java