Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c29bc443 authored by Raph Levien's avatar Raph Levien Committed by android-build-merger
Browse files

Merge "Make LocaleList constructor non-nullable" into nyc-dev

am: 4d826831

* commit '4d826831':
  Make LocaleList constructor non-nullable

Change-Id: I1c11cd8e95ad41c37362ae61113a64d01de25d98
parents d312775e 4d826831
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -744,7 +744,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
    private void fixUpLocaleList() {
        if ((locale == null && !mLocaleList.isEmpty()) ||
                (locale != null && !locale.equals(mLocaleList.get(0)))) {
            mLocaleList = new LocaleList(locale);
            mLocaleList = locale == null ? LocaleList.getEmptyLocaleList() : new LocaleList(locale);
        }
    }

@@ -1481,7 +1481,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     * @param loc The locale. Can be null.
     */
    public void setLocale(@Nullable Locale loc) {
        setLocales(new LocaleList(loc));
        setLocales(loc == null ? LocaleList.getEmptyLocaleList() : new LocaleList(loc));
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ public class LocaleSpan extends MetricAffectingSpan implements ParcelableSpan {
     * @see #LocaleSpan(LocaleList)
     */
    public LocaleSpan(@Nullable Locale locale) {
        mLocales = new LocaleList(locale);
        mLocales = locale == null ? LocaleList.getEmptyLocaleList() : new LocaleList(locale);
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -169,8 +169,8 @@ public final class LocaleList implements Parcelable {
     * @throws NullPointerException if any of the input locales is <code>null</code>.
     * @throws IllegalArgumentException if any of the input locales repeat.
     */
    public LocaleList(@Nullable Locale... list) {
        if (list == null || list.length == 0) {
    public LocaleList(@NonNull Locale... list) {
        if (list.length == 0) {
            mList = sEmptyList;
            mStringRepresentation = "";
        } else {