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

Commit 9247c773 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Regional: Customize hyphen feature"

parents 496d1046 c3a1b542
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +22,7 @@ package android.telephony;
import com.android.i18n.phonenumbers.AsYouTypeFormatter;
import com.android.i18n.phonenumbers.PhoneNumberUtil;

import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.Selection;
@@ -152,8 +156,13 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
    }

    private String getFormattedNumber(char lastNonSeparator, boolean hasCursor) {
        return hasCursor ? mFormatter.inputDigitAndRememberPosition(lastNonSeparator)
        String formattedNum = hasCursor ? mFormatter
                .inputDigitAndRememberPosition(lastNonSeparator)
                : mFormatter.inputDigit(lastNonSeparator);
        if (!SystemProperties.getBoolean("persist.env.sys.hypenenable", true)) {
            return formattedNum.replace("-", "");
        }
        return formattedNum;
    }

    private void stopFormatting() {