List of usage examples for android.telephony PhoneNumberUtils extractNetworkPortion
public static String extractNetworkPortion(String phoneNumber)
From source file:com.android.mms.ui.MessageUtils.java
/** M: Code analyze 022, For fix bug ALPS00281094, Can not send and receive Sms. * Return true iff the network portion of <code>address</code> is, * as far as we can tell on the device, suitable for use as an SMS * destination address./* w w w . j av a 2s.c o m*/ */ public static boolean isWellFormedSmsAddress(String address) { // MTK-START [mtk04070][120104][ALPS00109412]Solve // "can't send MMS with MSISDN in international format" // Merge from ALPS00089029 if (!isDialable(address)) { return false; } // MTK-END [mtk04070][120104][ALPS00109412]Solve // "can't send MMS with MSISDN in international format" String networkPortion = PhoneNumberUtils.extractNetworkPortion(address); return (!(networkPortion.equals("+") || TextUtils.isEmpty(networkPortion))) && isDialable(networkPortion); }