Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD

Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
This commit is contained in:
The Android Open Source Project
2013-12-05 13:10:46 -08:00
1466 changed files with 168650 additions and 14047 deletions

View File

@@ -1956,6 +1956,27 @@ public class PhoneNumberUtils
return dialStr;
}
/**
* Process phone number for CDMA, converting plus code using the home network number format.
* This is used for outgoing SMS messages.
*
* @param dialStr the original dial string
* @return the converted dial string
* @hide for internal use
*/
public static String cdmaCheckAndProcessPlusCodeForSms(String dialStr) {
if (!TextUtils.isEmpty(dialStr)) {
if (isReallyDialable(dialStr.charAt(0)) && isNonSeparator(dialStr)) {
String defaultIso = SystemProperties.get(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, "");
if (!TextUtils.isEmpty(defaultIso)) {
int format = getFormatTypeFromCountryCode(defaultIso);
return cdmaCheckAndProcessPlusCodeByNumberFormat(dialStr, format, format);
}
}
}
return dialStr;
}
/**
* This function should be called from checkAndProcessPlusCode only
* And it is used for test purpose also.

View File

@@ -581,6 +581,10 @@ public class CallerInfo {
return countryIso;
}
protected static String getCurrentCountryIso(Context context) {
return getCurrentCountryIso(context, Locale.getDefault());
}
/**
* @return a string debug representation of this instance.
*/

View File

@@ -20,7 +20,6 @@ import android.content.AsyncQueryHandler;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.location.CountryDetector;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
@@ -271,11 +270,9 @@ public class CallerInfoAsyncQuery {
// Use the number entered by the user for display.
if (!TextUtils.isEmpty(cw.number)) {
CountryDetector detector = (CountryDetector) mQueryContext.getSystemService(
Context.COUNTRY_DETECTOR);
mCallerInfo.phoneNumber = PhoneNumberUtils.formatNumber(cw.number,
mCallerInfo.normalizedNumber,
detector.detectCountry().getCountryIso());
CallerInfo.getCurrentCountryIso(mQueryContext));
}
}

View File

@@ -154,6 +154,26 @@ interface ITelephony {
*/
boolean supplyPuk(String puk, String pin);
/**
* Supply a pin to unlock the SIM. Blocks until a result is determined.
* Returns a specific success/error code.
* @param pin The pin to check.
* @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
* retValue[1] = number of attempts remaining if known otherwise -1
*/
int[] supplyPinReportResult(String pin);
/**
* Supply puk to unlock the SIM and set SIM pin to new pin.
* Blocks until a result is determined.
* Returns a specific success/error code
* @param puk The puk to check
* pin The pin to check.
* @return retValue[0] = Phone.PIN_RESULT_SUCCESS on success. Otherwise error code
* retValue[1] = number of attempts remaining if known otherwise -1
*/
int[] supplyPukReportResult(String puk, String pin);
/**
* Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
* without SEND (so <code>dial</code> is not appropriate).

View File

@@ -85,6 +85,14 @@ public class PhoneConstants {
public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged";
/**
* Return codes for supplyPinReturnResult and
* supplyPukReturnResult APIs
*/
public static final int PIN_RESULT_SUCCESS = 0;
public static final int PIN_PASSWORD_INCORRECT = 1;
public static final int PIN_GENERAL_FAILURE = 2;
/**
* Return codes for <code>enableApnType()</code>
*/