Polish new IME API for L part 2: CursorAnchorInfo

This CL addresses feedbacks from internal customers for new
input method APIs that are mainly used for physical keyboard
support in L.

For performance reasons, #onUpdateCursorAnchorInfo is not called
back by default and each input method has to enable this
event notification explicitly whenever fine-grained character
locations are needed.

In L-preview, InputMethodSession#setCursorAnchorMonitorMode was
introduced for this purpose.  However, we got several feedbacks
to be addressed.
- The effect of #setCursorAnchorMonitorMode is not preserved
  during focus change.  IMEs need to call
  #setCursorAnchorMonitorMode every time when #onStartInput is
  called.  This is tricky and hard to understand.
- As #onUpdateCursorAnchorInfo is a new API, not all
  applications/text editors have supported it. Therefore IMEs
  can't always rely on it. However, there is no way to query
  if the attached target is supporting this new API or not.
  It would helpful for IME authors if we can provide a
  reliable way to query if the attached input target is
  supporting the new API or not.

In order to address these issues, the triggering method has
moved from InputMethodSession to InputConnection in this CL,
as an analogy of existing InputConnection#getExtractedText API,
which has provided similar functionality including optional
reactive event callbacks from the application to the IME.

BUG: 15812658
BUG: 16118603
Change-Id: I3c6b69bd9d79b199afe68d838f25effa6048e5cc
18 files changed