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

Commit 085419b1 authored by Roozbeh Pournader's avatar Roozbeh Pournader
Browse files

Remove TextUtils.join(Iterable<CharSequence>).

The method was deprecated and had only one caller, which is being
replaced with an inline copy of this at the same time.

Bug: 6823087
Change-Id: I7c5b9840ba50c1a9f167102966de63ef1040ab88
parent 2b8ca04d
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -18,9 +18,7 @@ package android.text;

import android.annotation.Nullable;
import android.content.res.Resources;
import android.icu.impl.ICUResourceBundle;
import android.icu.util.ULocale;
import android.icu.util.UResourceBundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemProperties;
@@ -285,27 +283,6 @@ public class TextUtils {
        return ret;
    }

    /**
     * @deprecated use {@link android.icu.text.ListFormatter} instead.
     *
     * @hide
     */
    @Deprecated
    public static CharSequence join(Iterable<CharSequence> list) {
        final ICUResourceBundle icuBundle = (ICUResourceBundle) UResourceBundle.
                getBundleInstance(ICUResourceBundle.ICU_BASE_NAME);
        final String listMiddlePattern =
                icuBundle.getStringWithFallback("listPattern/standard/middle");
        // The returned pattern is something like "{0}, {1}", from which we want
        // to extract the ", " part.
        final int firstClosingBrace = listMiddlePattern.indexOf('}');
        final int lastOpeningBrace = listMiddlePattern.lastIndexOf('{');
        final CharSequence delimiter = listMiddlePattern.substring(
                firstClosingBrace+1, lastOpeningBrace);

        return join(delimiter, list);
    }

    /**
     * Returns a string containing the tokens joined by delimiters.
     * @param tokens an array objects to be joined. Strings will be formed from