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

Commit 102e6b90 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Update docs for PhoneNumberFormattingTextWatcher." into main

parents aaf96093 88c0ce8c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -44723,12 +44723,12 @@ package android.telephony {
    field public static final int SCAN_TYPE_PERIODIC = 1; // 0x1
  }
  public class PhoneNumberFormattingTextWatcher implements android.text.TextWatcher {
    ctor public PhoneNumberFormattingTextWatcher();
    ctor public PhoneNumberFormattingTextWatcher(String);
    method public void afterTextChanged(android.text.Editable);
    method public void beforeTextChanged(CharSequence, int, int, int);
    method public void onTextChanged(CharSequence, int, int, int);
  @Deprecated public class PhoneNumberFormattingTextWatcher implements android.text.TextWatcher {
    ctor @Deprecated public PhoneNumberFormattingTextWatcher();
    ctor @Deprecated @WorkerThread public PhoneNumberFormattingTextWatcher(String);
    method @Deprecated public void afterTextChanged(android.text.Editable);
    method @Deprecated public void beforeTextChanged(CharSequence, int, int, int);
    method @Deprecated public void onTextChanged(CharSequence, int, int, int);
  }
  public class PhoneNumberUtils {
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.telephony;

import android.annotation.WorkerThread;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.text.Editable;
@@ -39,6 +40,9 @@ import java.util.Locale;
 * </ul>
 * <p>
 * The formatting will be restarted once the text is cleared.
 *
 * @deprecated This is a thin wrapper on a `libphonenumber` `AsYouTypeFormatter`; it is recommended
 * to use that instead.
 */
public class PhoneNumberFormattingTextWatcher implements TextWatcher {

@@ -69,6 +73,7 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
     * @param countryCode the ISO 3166-1 two-letter country code that indicates the country/region
     * where the phone number is being entered.
     */
    @WorkerThread
    public PhoneNumberFormattingTextWatcher(String countryCode) {
        if (countryCode == null) throw new IllegalArgumentException();
        mFormatter = PhoneNumberUtil.getInstance().getAsYouTypeFormatter(countryCode);