OSDN Git Service

Handle undo in TextView fields with no cursor
authorJames Cook <jamescook@google.com>
Tue, 10 Mar 2015 16:48:11 +0000 (09:48 -0700)
committerJames Cook <jamescook@google.com>
Tue, 10 Mar 2015 17:25:26 +0000 (10:25 -0700)
commit900185d00359661e185c3b328f40a4d572ae03f9
tree79713b1eea9187b3429f2c8f54cded5e4429eb5d
parentba4df962972ee271e204d157aa785cb7d0b5d968
Handle undo in TextView fields with no cursor

This fixes a rare crash in the undo system. In particular, if the
TextView did not have a cursor and the first operation was a
programmatic insert/append the "old cursor position" would be -1.
Attempting to undo would try to restore the cursor to -1 and crash.

Test will land separately in CTS.

Bug: 19332904
Change-Id: I9aa18c1e3621b99d13ac707e483154382effb81c
core/java/android/widget/Editor.java