OSDN Git Service

Introduce SuggestionSpan#getLocaleObject().
authorYohei Yukawa <yukawa@google.com>
Thu, 14 Jan 2016 20:16:06 +0000 (12:16 -0800)
committerYohei Yukawa <yukawa@google.com>
Thu, 14 Jan 2016 20:16:06 +0000 (12:16 -0800)
commit60fbc8e3bbe55e8be655418cc8111354e17f6ea7
treefc63871ba0909b940bd5181c4bdf4032184b5dc0
parenta1dcb87565ab9a34ae14efebe4743701068cffad
Introduce SuggestionSpan#getLocaleObject().

This is a series of CLs to promote Java Locale object as a primary data
object to represent locale information in Android APIs.

With this CL, developers can get Locale information from SuggestionSpan
without semantically losing the original data.  Possible use cases would
be:
 - Emoji subtag (CLDR Ticket #9063)
 - Stable and reliable 3-letter country codes handling
 - Custom attributes based on private extensions.

Note that this CL does not change the current behavior of
SuggestionSpan#getLocale() as is, even if it is created with a malformed
Locale object:

  new SuggestionSpan(new Locale(" a ", " b c ", " e"), new String[0], 0)
          .getLocale() -> " a  b c  e".

Bug: 22858221
Change-Id: I96dfd4f819a236ee2e6dbd3e12903d1214223cb0
api/current.txt
api/system-current.txt
api/test-current.txt
core/java/android/text/style/SuggestionSpan.java