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

Commit 88c0ce8c authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Update docs for PhoneNumberFormattingTextWatcher.

1. Deprecate this; it is not maintained and it is a thin wrapper on the
`AsYouTypeFormatter`.
2. Update constructor docs to add WorkerThread annotation since this loads
data from the file system and could cause an ANR.

Flag: Docs only change.
Test: Docs only change.
Fixes: 267915881
Change-Id: I6fa7042010b4d6b2641c06d3d9225fc411a33794
parent 02e572ad
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -44355,12 +44355,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);