summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/android/telephony/CarrierConfigManager.java4
-rw-r--r--telephony/java/android/telephony/DisconnectCause.java66
-rw-r--r--telephony/java/android/telephony/PhoneNumberUtils.java119
-rwxr-xr-x[-rw-r--r--]telephony/java/android/telephony/RadioAccessFamily.java24
-rw-r--r--telephony/java/android/telephony/ServiceState.java19
-rw-r--r--telephony/java/android/telephony/SignalStrength.java31
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java116
-rw-r--r--telephony/java/com/android/ims/ImsCallProfile.java1
-rw-r--r--telephony/java/com/android/ims/ImsReasonInfo.java15
-rw-r--r--telephony/java/com/android/ims/ImsStreamMediaProfile.java12
-rw-r--r--telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl29
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfo.java4
-rw-r--r--telephony/java/com/android/internal/telephony/IExtTelephony.aidl119
-rw-r--r--telephony/java/com/android/internal/telephony/ISms.aidl100
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl117
-rw-r--r--telephony/java/com/android/internal/telephony/OperatorInfo.java17
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/RILConstants.java5
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyProperties.java45
18 files changed, 789 insertions, 54 deletions
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index aa4da4b..94bf4eb 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -502,7 +502,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
sDefaults.putBoolean(KEY_PREFER_2G_BOOL, true);
sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false);
- sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false);
+ sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, true);
sDefaults.putBoolean(KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL, true);
sDefaults.putBoolean(KEY_SIM_NETWORK_UNLOCK_ALLOW_DISMISS_BOOL, true);
sDefaults.putBoolean(KEY_SUPPORT_PAUSE_IMS_VIDEO_CALLS_BOOL, true);
@@ -511,7 +511,7 @@ public class CarrierConfigManager {
sDefaults.putBoolean(KEY_USE_OTASP_FOR_PROVISIONING_BOOL, false);
sDefaults.putBoolean(KEY_VOICEMAIL_NOTIFICATION_PERSISTENT_BOOL, false);
sDefaults.putBoolean(KEY_VOICE_PRIVACY_DISABLE_UI_BOOL, false);
- sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, false);
+ sDefaults.putBoolean(KEY_WORLD_PHONE_BOOL, true);
sDefaults.putBoolean(KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL, true);
sDefaults.putInt(KEY_VOLTE_REPLACEMENT_RAT_INT, 0);
sDefaults.putString(KEY_DEFAULT_SIM_CALL_MANAGER_STRING, "");
diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java
index 8443490..e2e8326 100644
--- a/telephony/java/android/telephony/DisconnectCause.java
+++ b/telephony/java/android/telephony/DisconnectCause.java
@@ -187,6 +187,15 @@ public class DisconnectCause {
*/
public static final int CDMA_ALREADY_ACTIVATED = 49;
+ /** call failed due to LTE to 3G/2G handover not feasible */
+ public static final int HO_NOT_FEASIBLE = 50;
+
+ /**
+ * Call was rejected due to number being blacklisted by user.
+ * {@@hide}
+ */
+ public static final int CALL_BLACKLISTED = 400;
+
//*********************************************************************************************
// When adding a disconnect type:
// 1) Please assign the new type the next id value below.
@@ -195,14 +204,63 @@ public class DisconnectCause {
// 4) Update toString() with the newly added disconnect type.
// 5) Update android.telecom.DisconnectCauseUtil with any mappings to a telecom.DisconnectCause.
//
- // NextId: 50
+ // NextId: 51
//*********************************************************************************************
/** Smallest valid value for call disconnect codes. */
public static final int MINIMUM_VALID_VALUE = NOT_DISCONNECTED;
/** Largest valid value for call disconnect codes. */
- public static final int MAXIMUM_VALID_VALUE = CDMA_ALREADY_ACTIVATED;
+ public static final int MAXIMUM_VALID_VALUE = HO_NOT_FEASIBLE;
+ public static final int NO_CIRCUIT_AVAIL = 48;
+ public static final int NO_ROUTE_TO_DESTINAON = 49;
+ public static final int OPERATOR_DETERMINED_BARRING = 50;
+ public static final int CALL_FAIL_NO_USER_RESPONDING = 51;
+ public static final int CALL_FAIL_NO_ANSWER_FROM_USER = 52;
+ public static final int CALL_FAIL_DESTINATION_OUT_OF_ORDER = 53;
+ public static final int BEARER_CAPABILITY_NOT_AUTHORIZED = 54;
+ public static final int CHANNEL_UNACCEPTABLE = 55;
+ public static final int CALL_REJECTED = 56;
+ public static final int NUMBER_CHANGED = 57;
+ public static final int PREEMPTION = 58;
+ public static final int FACILITY_REJECTED = 59;
+ public static final int RESP_TO_STATUS_ENQUIRY = 60;
+ public static final int NORMAL_UNSPECIFIED = 61;
+ public static final int NETWORK_OUT_OF_ORDER = 62;
+ public static final int TEMPORARY_FAILURE = 63;
+ public static final int SWITCHING_EQUIPMENT_CONGESTION = 64;
+ public static final int ACCESS_INFORMATION_DISCARDED = 65;
+ public static final int REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 66;
+ public static final int RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 67;
+ public static final int QOS_UNAVAILABLE = 68;
+ public static final int REQUESTED_FACILITY_NOT_SUBSCRIBED = 69;
+ public static final int INCOMING_CALLS_BARRED_WITHIN_CUG = 70;
+ public static final int BEARER_CAPABILITY_UNAVAILABLE = 71;
+ public static final int SERVICE_OPTION_NOT_AVAILABLE = 72;
+ public static final int BEARER_SERVICE_NOT_IMPLEMENTED = 73;
+ public static final int REQUESTED_FACILITY_NOT_IMPLEMENTED = 74;
+ public static final int ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 75;
+ public static final int SERVICE_OR_OPTION_NOT_IMPLEMENTED = 76;
+ public static final int INVALID_TRANSACTION_IDENTIFIER = 77;
+ public static final int USER_NOT_MEMBER_OF_CUG = 78;
+ public static final int INCOMPATIBLE_DESTINATION = 79;
+ public static final int INVALID_TRANSIT_NW_SELECTION = 80;
+ public static final int SEMANTICALLY_INCORRECT_MESSAGE = 81;
+ public static final int INVALID_MANDATORY_INFORMATION = 82;
+ public static final int MESSAGE_TYPE_NON_IMPLEMENTED = 83;
+ public static final int MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 84;
+ public static final int INFORMATION_ELEMENT_NON_EXISTENT = 85;
+ public static final int CONDITIONAL_IE_ERROR = 86;
+ public static final int MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 87;
+ public static final int RECOVERY_ON_TIMER_EXPIRED = 88;
+ public static final int PROTOCOL_ERROR_UNSPECIFIED = 89;
+ public static final int INTERWORKING_UNSPECIFIED = 90;
+ public static final int LOCAL_LOW_BATTERY = 91;
+ public static final int LOW_BATTERY = 92;
+ /** EMERGENCY call failed with temporary fail cause */
+ public static final int EMERGENCY_TEMP_FAILURE = 93;
+ /** EMERGENCY call failed with permanent fail cause */
+ public static final int EMERGENCY_PERM_FAILURE = 94;
/** Private constructor to avoid class instantiation. */
private DisconnectCause() {
@@ -310,6 +368,10 @@ public class DisconnectCause {
return "IMS_MERGED_SUCCESSFULLY";
case CDMA_ALREADY_ACTIVATED:
return "CDMA_ALREADY_ACTIVATED";
+ case HO_NOT_FEASIBLE:
+ return "HO_NOT_FEASIBLE";
+ case CALL_BLACKLISTED:
+ return "CALL_BLACKLISTED";
default:
return "INVALID: " + cause;
}
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java
index b430340..4b37cdb 100644
--- a/telephony/java/android/telephony/PhoneNumberUtils.java
+++ b/telephony/java/android/telephony/PhoneNumberUtils.java
@@ -16,6 +16,7 @@
package android.telephony;
+import android.util.SparseArray;
import com.android.i18n.phonenumbers.NumberParseException;
import com.android.i18n.phonenumbers.PhoneNumberUtil;
import com.android.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat;
@@ -25,6 +26,7 @@ import com.android.i18n.phonenumbers.ShortNumberUtil;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
+import android.location.Country;
import android.location.CountryDetector;
import android.net.Uri;
import android.os.SystemProperties;
@@ -77,6 +79,7 @@ public class PhoneNumberUtils
static final String LOG_TAG = "PhoneNumberUtils";
private static final boolean DBG = false;
+ private static Country sCountryDetector = null;
/*
* global-phone-number = ["+"] 1*( DIGIT / written-sep )
* written-sep = ("-"/".")
@@ -139,6 +142,55 @@ public class PhoneNumberUtils
return !isDialable(ch) && !(('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z'));
}
+ /**
+ * On some CDMA networks +COUNTRYCODE must be rewritten to 0 when making a local
+ * call from within the user's home network. We maintain a white list of
+ * (country code prefix) -> (rewrite rule) to perform this substitution.
+ *
+ * Since country codes are variable length it is easiest to compile a regex
+ */
+ private static SparseArray<RewriteRule> sCdmaLocalRewriteWhitelist;
+ private static Pattern sCdmaLocalRewritePattern;
+ static {
+ sCdmaLocalRewriteWhitelist = new SparseArray<RewriteRule>();
+ addRewriteRule(62, "ID", "0"); // indonesia
+ addRewriteRule(380, "UA", "0"); // ukraine
+
+ StringBuffer regex = new StringBuffer();
+ regex.append("[+](");
+ for (int i=0; i < sCdmaLocalRewriteWhitelist.size(); ++i) {
+ int countryCode = sCdmaLocalRewriteWhitelist.keyAt(i);
+ if (i > 0) {
+ regex.append("|");
+ }
+ regex.append(countryCode);
+ }
+ regex.append(")");
+ sCdmaLocalRewritePattern = Pattern.compile(regex.toString());
+ }
+
+ private static class RewriteRule {
+ public int countryCodePrefix;
+ public String isoCountryCode;
+ public String replacement;
+
+ public RewriteRule(int countryCodePrefix, String isoCountryCode, String replacement) {
+ this.countryCodePrefix = countryCodePrefix;
+ this.isoCountryCode = isoCountryCode;
+ this.replacement = replacement;
+ }
+
+ public String apply(String dialStr) {
+ return dialStr.replaceFirst("[+]" + countryCodePrefix, replacement);
+ }
+ }
+
+ private static void addRewriteRule(int countryCodePrefix,
+ String isoCountryCode, String replacement) {
+ sCdmaLocalRewriteWhitelist.put(countryCodePrefix,
+ new RewriteRule(countryCodePrefix, isoCountryCode, replacement));
+ }
+
/** Extracts the phone number from an Intent.
*
* @param intent the intent to get the number of
@@ -148,6 +200,7 @@ public class PhoneNumberUtils
* <code>null</code> if the number cannot be found.
*/
public static String getNumberFromIntent(Intent intent, Context context) {
+ android.util.SeempLog.record(12);
String number = null;
Uri uri = intent.getData();
@@ -2057,12 +2110,9 @@ public class PhoneNumberUtils
private static boolean isLocalEmergencyNumberInternal(int subId, String number,
Context context,
boolean useExactMatch) {
- String countryIso;
- CountryDetector detector = (CountryDetector) context.getSystemService(
- Context.COUNTRY_DETECTOR);
- if (detector != null && detector.detectCountry() != null) {
- countryIso = detector.detectCountry().getCountryIso();
- } else {
+ String countryIso = getCountryIso(context);
+ Rlog.w(LOG_TAG, "isLocalEmergencyNumberInternal" + countryIso);
+ if (countryIso == null) {
Locale locale = context.getResources().getConfiguration().locale;
countryIso = locale.getCountry();
Rlog.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: "
@@ -2071,6 +2121,28 @@ public class PhoneNumberUtils
return isEmergencyNumberInternal(subId, number, countryIso, useExactMatch);
}
+ private static String getCountryIso(Context context) {
+ Rlog.w(LOG_TAG, "getCountryIso " + sCountryDetector);
+ if (sCountryDetector == null) {
+ CountryDetector detector = (CountryDetector) context.getSystemService(
+ Context.COUNTRY_DETECTOR);
+ if (detector != null) {
+ sCountryDetector = detector.detectCountry();
+ }
+ }
+
+ if (sCountryDetector == null) {
+ return null;
+ } else {
+ return sCountryDetector.getCountryIso();
+ }
+ }
+
+ /** @hide */
+ public static void resetCountryDetectorInfo() {
+ sCountryDetector = null;
+ }
+
/**
* isVoiceMailNumber: checks a given number against the voicemail
* number provided by the RIL and SIM card. The caller must have
@@ -2560,6 +2632,29 @@ public class PhoneNumberUtils
}
/**
+ * Returns a rewrite rule for the country code prefix if the dial string matches the
+ * whitelist and the user is in their home network
+ *
+ * @param dialStr number being dialed
+ * @param currIso ISO code of currently attached network
+ * @param defaultIso ISO code of user's sim
+ * @return RewriteRule or null if conditions fail
+ */
+ private static RewriteRule getCdmaLocalRewriteRule(String dialStr,
+ String currIso, String defaultIso) {
+ Matcher m = sCdmaLocalRewritePattern.matcher(dialStr);
+ if (m.find()) {
+ String dialPrefix = m.group(1);
+ RewriteRule rule = sCdmaLocalRewriteWhitelist.get(Integer.valueOf(dialPrefix));
+ if (currIso.equalsIgnoreCase(defaultIso) &&
+ currIso.equalsIgnoreCase(rule.isoCountryCode)) {
+ return rule;
+ }
+ }
+ return null;
+ }
+
+ /**
* Determines if the specified number is actually a URI
* (i.e. a SIP address) rather than a regular PSTN phone number,
* based on whether or not the number contains an "@" character.
@@ -2622,8 +2717,16 @@ public class PhoneNumberUtils
// Remove the leading plus sign
retStr = newStr;
} else {
- // Replaces the plus sign with the default IDP
- retStr = networkDialStr.replaceFirst("[+]", getCurrentIdp(useNanp));
+ RewriteRule rewriteRule =
+ getCdmaLocalRewriteRule(networkDialStr,
+ TelephonyManager.getDefault().getNetworkCountryIso(),
+ TelephonyManager.getDefault().getSimCountryIso());
+ if (rewriteRule != null) {
+ retStr = rewriteRule.apply(networkDialStr);
+ } else {
+ // Replaces the plus sign with the default IDP
+ retStr = networkDialStr.replaceFirst("[+]", getCurrentIdp(useNanp));
+ }
}
}
if (DBG) log("processPlusCode, retStr=" + retStr);
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java
index 2bfaf1b..2906a2d 100644..100755
--- a/telephony/java/android/telephony/RadioAccessFamily.java
+++ b/telephony/java/android/telephony/RadioAccessFamily.java
@@ -47,6 +47,7 @@ public class RadioAccessFamily implements Parcelable {
public static final int RAF_HSPAP = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_HSPAP);
public static final int RAF_GSM = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_GSM);
public static final int RAF_TD_SCDMA = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_TD_SCDMA);
+ public static final int RAF_LTE_CA = (1 << ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA);
// Grouping of RAFs
private static final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE;
@@ -54,6 +55,7 @@ public class RadioAccessFamily implements Parcelable {
private static final int CDMA = RAF_IS95A | RAF_IS95B | RAF_1xRTT;
private static final int EVDO = RAF_EVDO_0 | RAF_EVDO_A | RAF_EVDO_B | RAF_EHRPD;
private static final int WCDMA = HS | RAF_UMTS;
+ private static final int LTE = RAF_LTE | RAF_LTE_CA;
/* Phone ID of phone */
private int mPhoneId;
@@ -162,19 +164,19 @@ public class RadioAccessFamily implements Parcelable {
raf = CDMA | EVDO;
break;
case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO:
- raf = RAF_LTE | CDMA | EVDO;
+ raf = LTE | CDMA | EVDO;
break;
case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
- raf = RAF_LTE | GSM | WCDMA;
+ raf = LTE | GSM | WCDMA;
break;
case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
- raf = RAF_LTE | CDMA | EVDO | GSM | WCDMA;
+ raf = LTE | CDMA | EVDO | GSM | WCDMA;
break;
case RILConstants.NETWORK_MODE_LTE_ONLY:
- raf = RAF_LTE;
+ raf = LTE;
break;
case RILConstants.NETWORK_MODE_LTE_WCDMA:
- raf = RAF_LTE | WCDMA;
+ raf = LTE | WCDMA;
break;
case RILConstants.NETWORK_MODE_CDMA_NO_EVDO:
raf = CDMA;
@@ -232,6 +234,7 @@ public class RadioAccessFamily implements Parcelable {
raf = ((WCDMA & raf) > 0) ? (WCDMA | raf) : raf;
raf = ((CDMA & raf) > 0) ? (CDMA | raf) : raf;
raf = ((EVDO & raf) > 0) ? (EVDO | raf) : raf;
+ raf = ((LTE & raf) > 0) ? (LTE | raf) : raf;
return raf;
}
@@ -254,19 +257,19 @@ public class RadioAccessFamily implements Parcelable {
case (CDMA | EVDO):
type = RILConstants.NETWORK_MODE_CDMA;
break;
- case (RAF_LTE | CDMA | EVDO):
+ case (LTE | CDMA | EVDO):
type = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO;
break;
- case (RAF_LTE | GSM | WCDMA):
+ case (LTE | GSM | WCDMA):
type = RILConstants.NETWORK_MODE_LTE_GSM_WCDMA;
break;
- case (RAF_LTE | CDMA | EVDO | GSM | WCDMA):
+ case (LTE | CDMA | EVDO | GSM | WCDMA):
type = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA;
break;
- case RAF_LTE:
+ case LTE:
type = RILConstants.NETWORK_MODE_LTE_ONLY;
break;
- case (RAF_LTE | WCDMA):
+ case (LTE | WCDMA):
type = RILConstants.NETWORK_MODE_LTE_WCDMA;
break;
case CDMA:
@@ -339,6 +342,7 @@ public class RadioAccessFamily implements Parcelable {
case "CDMA": return CDMA;
case "EVDO": return EVDO;
case "WCDMA": return WCDMA;
+ case "LTE_CA": return RAF_LTE_CA;
default: return RAF_UNKNOWN;
}
}
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 1337487..d411376 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -154,6 +154,12 @@ public class ServiceState implements Parcelable {
*/
public static final int RIL_RADIO_TECHNOLOGY_IWLAN = 18;
/**
+ * LTE_CA
+ * @hide
+ */
+ public static final int RIL_RADIO_TECHNOLOGY_LTE_CA = 19;
+
+ /**
* Available registration states for GSM, UMTS and CDMA.
*/
/** @hide */
@@ -728,11 +734,14 @@ public class ServiceState implements Parcelable {
case RIL_RADIO_TECHNOLOGY_GSM:
rtString = "GSM";
break;
+ case RIL_RADIO_TECHNOLOGY_TD_SCDMA:
+ rtString = "TD-SCDMA";
+ break;
case RIL_RADIO_TECHNOLOGY_IWLAN:
rtString = "IWLAN";
break;
- case RIL_RADIO_TECHNOLOGY_TD_SCDMA:
- rtString = "TD-SCDMA";
+ case RIL_RADIO_TECHNOLOGY_LTE_CA:
+ rtString = "LTE_CA";
break;
default:
rtString = "Unexpected";
@@ -1075,6 +1084,8 @@ public class ServiceState implements Parcelable {
return TelephonyManager.NETWORK_TYPE_TD_SCDMA;
case ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN:
return TelephonyManager.NETWORK_TYPE_IWLAN;
+ case ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA:
+ return TelephonyManager.NETWORK_TYPE_LTE_CA;
default:
return TelephonyManager.NETWORK_TYPE_UNKNOWN;
}
@@ -1126,7 +1137,9 @@ public class ServiceState implements Parcelable {
|| radioTechnology == RIL_RADIO_TECHNOLOGY_HSPAP
|| radioTechnology == RIL_RADIO_TECHNOLOGY_GSM
|| radioTechnology == RIL_RADIO_TECHNOLOGY_TD_SCDMA
- || radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN;
+ || radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN
+ || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA;
+
}
/** @hide */
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index f535e5d..c941a28 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -19,6 +19,7 @@ package android.telephony;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemProperties;
import android.telephony.Rlog;
import android.content.res.Resources;
@@ -146,11 +147,10 @@ public class SignalStrength implements Parcelable {
int cdmaDbm, int cdmaEcio,
int evdoDbm, int evdoEcio, int evdoSnr,
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
- int tdScdmaRscp, boolean gsmFlag) {
+ boolean gsmFlag) {
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
lteRsrq, lteRssnr, lteCqi, gsmFlag);
- mTdScdmaRscp = tdScdmaRscp;
}
/**
@@ -162,10 +162,11 @@ public class SignalStrength implements Parcelable {
int cdmaDbm, int cdmaEcio,
int evdoDbm, int evdoEcio, int evdoSnr,
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
- boolean gsmFlag) {
+ int tdScdmaRscp, boolean gsmFlag) {
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
lteRsrq, lteRssnr, lteCqi, gsmFlag);
+ mTdScdmaRscp = tdScdmaRscp;
}
/**
@@ -398,11 +399,12 @@ public class SignalStrength implements Parcelable {
mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99;
mLteRsrp = ((mLteRsrp >= 44) && (mLteRsrp <= 140)) ? -mLteRsrp : SignalStrength.INVALID;
mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID;
- mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr
+ mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300) && !(mLteRsrq == SignalStrength.INVALID && mLteRssnr == -1)) ? mLteRssnr
: SignalStrength.INVALID;
mTdScdmaRscp = ((mTdScdmaRscp >= 25) && (mTdScdmaRscp <= 120))
? -mTdScdmaRscp : SignalStrength.INVALID;
+
// Cqi no change
if (DBG) log("Signal after validate=" + this);
}
@@ -494,6 +496,16 @@ public class SignalStrength implements Parcelable {
return mLteCqi;
}
+ /** @hide */
+ public boolean needsOldRilFeature(String feature) {
+ String[] features = SystemProperties.get("ro.telephony.ril.config", "").split(",");
+ for (String found: features) {
+ if (found.equals(feature))
+ return true;
+ }
+ return false;
+ }
+
/**
* Retrieve an abstract level value for the overall signal strength.
*
@@ -506,8 +518,9 @@ public class SignalStrength implements Parcelable {
int level = 0;
if (isGsm) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
level = getLteLevel();
- if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
+ if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
level = getTdScdmaLevel();
if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
level = getGsmLevel();
@@ -539,7 +552,8 @@ public class SignalStrength implements Parcelable {
public int getAsuLevel() {
int asuLevel = 0;
if (isGsm) {
- if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
+ if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
if (getTdScdmaLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
asuLevel = getGsmAsuLevel();
} else {
@@ -575,8 +589,9 @@ public class SignalStrength implements Parcelable {
int dBm = INVALID;
if(isGsm()) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
dBm = getLteDbm();
- if (dBm == INVALID) {
+ if (dBm == INVALID || oldRil) {
if (getTdScdmaLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
dBm = getGsmDbm();
} else {
@@ -933,7 +948,7 @@ public class SignalStrength implements Parcelable {
return tdScdmaAsuLevel;
}
- /**
+ /**
* @return hash code
*/
@Override
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 47f13c9..dd86830 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1,4 +1,7 @@
/*
+ * Copyright (c) 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");
@@ -18,10 +21,12 @@ package android.telephony;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.Manifest;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.ActivityThread;
import android.content.ContentResolver;
+import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
@@ -31,6 +36,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.telecom.PhoneAccount;
+import android.text.TextUtils;
import android.util.Log;
import com.android.internal.telecom.ITelecomService;
@@ -45,6 +51,7 @@ import com.android.internal.telephony.TelephonyProperties;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -699,6 +706,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getDeviceId() {
+ android.util.SeempLog.record(9);
try {
ITelephony telephony = getITelephony();
if (telephony == null)
@@ -721,6 +729,7 @@ public class TelephonyManager {
* @param slotId of which deviceID is returned
*/
public String getDeviceId(int slotId) {
+ android.util.SeempLog.record(9);
// FIXME this assumes phoneId == slotId
try {
IPhoneSubInfo info = getSubscriberInfo();
@@ -817,6 +826,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION}.
*/
public CellLocation getCellLocation() {
+ android.util.SeempLog.record(66);
try {
ITelephony telephony = getITelephony();
if (telephony == null) {
@@ -914,6 +924,7 @@ public class TelephonyManager {
*/
@Deprecated
public List<NeighboringCellInfo> getNeighboringCellInfo() {
+ android.util.SeempLog.record(67);
try {
ITelephony telephony = getITelephony();
if (telephony == null)
@@ -1164,6 +1175,15 @@ public class TelephonyManager {
return retVal;
}
+ /**
+ * Return if the current radio is LTE on GSM
+ * @hide
+ */
+ public static int getLteOnGsmModeStatic() {
+ return SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_GSM_DEVICE,
+ 0);
+ }
+
//
//
// Current Network
@@ -1340,11 +1360,12 @@ public class TelephonyManager {
public static final int NETWORK_TYPE_HSPAP = 15;
/** Current network is GSM {@hide} */
public static final int NETWORK_TYPE_GSM = 16;
- /** Current network is TD_SCDMA {@hide} */
+ /** Current network is TD_SCDMA {@hide} */
public static final int NETWORK_TYPE_TD_SCDMA = 17;
/** Current network is IWLAN {@hide} */
public static final int NETWORK_TYPE_IWLAN = 18;
-
+ /** Current network is LTE_CA {@hide} */
+ public static final int NETWORK_TYPE_LTE_CA = 19;
/**
* @return the NETWORK_TYPE_xxxx for current data connection.
*/
@@ -1389,10 +1410,12 @@ public class TelephonyManager {
* @see #NETWORK_TYPE_LTE
* @see #NETWORK_TYPE_EHRPD
* @see #NETWORK_TYPE_HSPAP
+ * @see #NETWORK_TYPE_TD_SCDMA
*
* <p>
* Requires Permission:
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ * @hide
*/
/** {@hide} */
public int getNetworkType(int subId) {
@@ -1512,6 +1535,21 @@ public class TelephonyManager {
}
}
+ /**
+ * Returns the icc operator numeric for a given subId
+ *
+ */
+ /** {@hide} */
+ public String getIccOperatorNumericForData(int subId) {
+ try{
+ return getITelephony().getIccOperatorNumericForData(subId);
+ } catch (RemoteException ex) {
+ return null;
+ } catch (NullPointerException ex) {
+ return null;
+ }
+ }
+
/** Unknown network class. {@hide} */
public static final int NETWORK_CLASS_UNKNOWN = 0;
/** Class of broadly defined "2G" networks. {@hide} */
@@ -1549,6 +1587,7 @@ public class TelephonyManager {
return NETWORK_CLASS_3_G;
case NETWORK_TYPE_LTE:
case NETWORK_TYPE_IWLAN:
+ case NETWORK_TYPE_LTE_CA:
return NETWORK_CLASS_4_G;
default:
return NETWORK_CLASS_UNKNOWN;
@@ -1612,6 +1651,8 @@ public class TelephonyManager {
return "TD_SCDMA";
case NETWORK_TYPE_IWLAN:
return "IWLAN";
+ case NETWORK_TYPE_LTE_CA:
+ return "LTE_CA";
default:
return "UNKNOWN";
}
@@ -1904,6 +1945,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getSimSerialNumber() {
+ android.util.SeempLog.record(10);
return getSimSerialNumber(getDefaultSubscription());
}
@@ -1917,6 +1959,7 @@ public class TelephonyManager {
*/
/** {@hide} */
public String getSimSerialNumber(int subId) {
+ android.util.SeempLog.record(10);
try {
IPhoneSubInfo info = getSubscriberInfo();
if (info == null)
@@ -1977,6 +2020,21 @@ public class TelephonyManager {
}
}
+ /**
+ * Return if the current radio is LTE on GSM
+ * @hide
+ */
+ public int getLteOnGsmMode() {
+ try {
+ return getITelephony().getLteOnGsmMode();
+ } catch (RemoteException ex) {
+ return 0;
+ } catch (NullPointerException ex) {
+ // This could happen before phone restarts due to crashing
+ return 0;
+ }
+ }
+
//
//
// Subscriber Info
@@ -1991,6 +2049,7 @@ public class TelephonyManager {
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
*/
public String getSubscriberId() {
+ android.util.SeempLog.record(114);
return getSubscriberId(getDefaultSubscription());
}
@@ -2006,6 +2065,7 @@ public class TelephonyManager {
*/
/** {@hide} */
public String getSubscriberId(int subId) {
+ android.util.SeempLog.record(114);
try {
IPhoneSubInfo info = getSubscriberInfo();
if (info == null)
@@ -2076,6 +2136,7 @@ public class TelephonyManager {
* The default SMS app can also use this.
*/
public String getLine1Number() {
+ android.util.SeempLog.record(11);
return getLine1NumberForSubscriber(getDefaultSubscription());
}
@@ -2888,6 +2949,40 @@ public class TelephonyManager {
}
/**
+ * Allows an application to add a protected sms address if the application has
+ * been granted the permission MODIFY_PROTECTED_SMS_LIST.
+ * @param address
+ * @hide
+ */
+ public void addProtectedSmsAddress(String address) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MODIFY_PROTECTED_SMS_LIST, null);
+ try {
+ getITelephony().addProtectedSmsAddress(address);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ }
+
+ /**
+ * Allows an application to revoke/remove a protected sms address if the application has been
+ * granted the permission MODIFY_PROTECTED_SMS_LIST.
+ * @param address
+ * @return true if address is successfully removed
+ * @hide
+ */
+ public boolean revokeProtectedSmsAddress(String address) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MODIFY_PROTECTED_SMS_LIST, null);
+ try {
+ return getITelephony().revokeProtectedSmsAddress(address);
+ } catch (RemoteException ex) {
+ } catch (NullPointerException ex) {
+ }
+ return false;
+ }
+
+ /**
* Returns the MMS user agent.
*/
public String getMmsUserAgent() {
@@ -3353,13 +3448,7 @@ public class TelephonyManager {
/** @hide */
public int getSimCount() {
- // FIXME Need to get it from Telephony Dev Controller when that gets implemented!
- // and then this method shouldn't be used at all!
- if(isMultiSimEnabled()) {
- return 2;
- } else {
- return 1;
- }
+ return getPhoneCount();
}
/**
@@ -4155,11 +4244,18 @@ public class TelephonyManager {
public void setDataEnabled(int subId, boolean enable) {
try {
Log.d(TAG, "setDataEnabled: enabled=" + enable);
+ AppOpsManager appOps = (AppOpsManager)mContext.getSystemService(Context.APP_OPS_SERVICE);
+ if (enable) {
+ if (appOps.noteOp(AppOpsManager.OP_DATA_CONNECT_CHANGE) != AppOpsManager.MODE_ALLOWED) {
+ Log.w(TAG, "Permission denied by user.");
+ return;
+ }
+ }
ITelephony telephony = getITelephony();
if (telephony != null)
telephony.setDataEnabled(subId, enable);
} catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelephony#setDataEnabled", e);
+ Log.e(TAG, "Error calling setDataEnabled", e);
}
}
diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java
index f263b4d..d73b2bd 100644
--- a/telephony/java/com/android/ims/ImsCallProfile.java
+++ b/telephony/java/com/android/ims/ImsCallProfile.java
@@ -187,6 +187,7 @@ public class ImsCallProfile implements Parcelable {
public static final String EXTRA_CODEC = "Codec";
public static final String EXTRA_DISPLAY_TEXT = "DisplayText";
public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo";
+ public static final String EXTRA_IS_CALL_PULL = "CallPull";
public int mServiceType;
public int mCallType;
diff --git a/telephony/java/com/android/ims/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java
index 2769a2b..3ab415c 100644
--- a/telephony/java/com/android/ims/ImsReasonInfo.java
+++ b/telephony/java/com/android/ims/ImsReasonInfo.java
@@ -84,6 +84,8 @@ public class ImsReasonInfo implements Parcelable {
public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147;
// IMS call is already terminated (in TERMINATED state)
public static final int CODE_LOCAL_CALL_TERMINATED = 148;
+ // Handover not feasible
+ public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149;
/**
* TIMEOUT (IMS -> Telephony)
@@ -153,6 +155,9 @@ public class ImsReasonInfo implements Parcelable {
public static final int CODE_SIP_USER_REJECTED = 361;
// Others
public static final int CODE_SIP_GLOBAL_ERROR = 362;
+ // Emergency failure
+ public static final int CODE_EMERGENCY_TEMP_FAILURE = 363;
+ public static final int CODE_EMERGENCY_PERM_FAILURE = 364;
/**
* MEDIA (IMS -> Telephony)
@@ -236,6 +241,16 @@ public class ImsReasonInfo implements Parcelable {
public static final int CODE_ANSWERED_ELSEWHERE = 1014;
/**
+ * For VICE - Call Pull request has failed
+ */
+ public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015;
+
+ /**
+ * For VICE - Call has been pulled from primary to secondary
+ */
+ public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016;
+
+ /**
* Network string error messages.
* mExtraMessage may have these values.
*/
diff --git a/telephony/java/com/android/ims/ImsStreamMediaProfile.java b/telephony/java/com/android/ims/ImsStreamMediaProfile.java
index 359b270..216cef5 100644
--- a/telephony/java/com/android/ims/ImsStreamMediaProfile.java
+++ b/telephony/java/com/android/ims/ImsStreamMediaProfile.java
@@ -51,6 +51,16 @@ public class ImsStreamMediaProfile implements Parcelable {
public static final int AUDIO_QUALITY_GSM_EFR = 8;
public static final int AUDIO_QUALITY_GSM_FR = 9;
public static final int AUDIO_QUALITY_GSM_HR = 10;
+ public static final int AUDIO_QUALITY_G711U = 11;
+ public static final int AUDIO_QUALITY_G723 = 12;
+ public static final int AUDIO_QUALITY_G711A = 13;
+ public static final int AUDIO_QUALITY_G722 = 14;
+ public static final int AUDIO_QUALITY_G711AB = 15;
+ public static final int AUDIO_QUALITY_G729 = 16;
+ public static final int AUDIO_QUALITY_EVS_NB = 17;
+ public static final int AUDIO_QUALITY_EVS_WB = 18;
+ public static final int AUDIO_QUALITY_EVS_SWB = 19;
+ public static final int AUDIO_QUALITY_EVS_FB = 20;
/**
* Video information
@@ -76,7 +86,7 @@ public class ImsStreamMediaProfile implements Parcelable {
}
public ImsStreamMediaProfile() {
- mAudioQuality = AUDIO_QUALITY_AMR_WB;
+ mAudioQuality = AUDIO_QUALITY_NONE;
mAudioDirection = DIRECTION_SEND_RECEIVE;
mVideoQuality = VIDEO_QUALITY_NONE;
mVideoDirection = DIRECTION_INVALID;
diff --git a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
index 23a69d1..507a293 100644
--- a/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
+++ b/telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
@@ -17,6 +17,7 @@
package com.android.ims.internal;
import com.android.ims.ImsReasonInfo;
+
/**
* A listener type for receiving notifications about the changes to
* the IMS connection(registration).
@@ -26,30 +27,36 @@ import com.android.ims.ImsReasonInfo;
interface IImsRegistrationListener {
/**
* Notifies the application when the device is connected to the IMS network.
+ *
+ * @param imsRadioTech the radio access technology. Valid values are {@code
+ * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}.
*/
- void registrationConnected();
+ void registrationConnected(int imsRadioTech) = 0;
/**
* Notifies the application when the device is trying to connect the IMS network.
+ *
+ * @param imsRadioTech the radio access technology. Valid values are {@code
+ * RIL_RADIO_TECHNOLOGY_*} defined in {@link ServiceState}.
*/
- void registrationProgressing();
+ void registrationProgressing(int imsRadioTech) = 1;
/**
* Notifies the application when the device is disconnected from the IMS network.
*/
- void registrationDisconnected(in ImsReasonInfo imsReasonInfo);
+ void registrationDisconnected(in ImsReasonInfo imsReasonInfo) = 2;
/**
* Notifies the application when its suspended IMS connection is resumed,
* meaning the connection now allows throughput.
*/
- void registrationResumed();
+ void registrationResumed() = 3;
/**
* Notifies the application when its current IMS connection is suspended,
* meaning there is no data throughput.
*/
- void registrationSuspended();
+ void registrationSuspended() = 4;
/**
* Notifies the application when its current IMS connection is updated
@@ -60,7 +67,7 @@ interface IImsRegistrationListener {
* If {@code event} is 0, meaning the specified service is removed from the IMS connection.
* Else ({@code event} is 1), meaning the specified service is added to the IMS connection.
*/
- void registrationServiceCapabilityChanged(int serviceClass, int event);
+ void registrationServiceCapabilityChanged(int serviceClass, int event) = 5;
/**
* Notifies the application when features on a particular service enabled or
@@ -71,11 +78,17 @@ interface IImsRegistrationListener {
* @param disabledFeatures features disabled as defined in com.android.ims.ImsConfig#FeatureConstants.
*/
void registrationFeatureCapabilityChanged(int serviceClass,
- in int[] enabledFeatures, in int[] disabledFeatures);
+ in int[] enabledFeatures, in int[] disabledFeatures) = 6;
/**
* Updates the application with the waiting voice message count.
* @param count The number of waiting voice messages.
*/
- void voiceMessageCountUpdate(int count);
+ void voiceMessageCountUpdate(int count) = 7;
+
+ /**
+ * Compatibility with AOSP
+ */
+ void registrationConnected() = 8;
+ void registrationProgressing() = 9;
}
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index be7e702..4e4ce5a 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -165,6 +165,7 @@ public class CallerInfo {
* number. The returned CallerInfo is null if no number is supplied.
*/
public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) {
+ android.util.SeempLog.record(15);
CallerInfo info = new CallerInfo();
info.photoResource = 0;
info.phoneLabel = null;
@@ -283,6 +284,7 @@ public class CallerInfo {
* number. The returned CallerInfo is null if no number is supplied.
*/
public static CallerInfo getCallerInfo(Context context, Uri contactRef) {
+ android.util.SeempLog.record(15);
CallerInfo info = null;
ContentResolver cr = CallerInfoAsyncQuery.getCurrentProfileContentResolver(context);
if (cr != null) {
@@ -307,6 +309,7 @@ public class CallerInfo {
* with all relevant fields empty or null.
*/
public static CallerInfo getCallerInfo(Context context, String number) {
+ android.util.SeempLog.record(15);
if (VDBG) Rlog.v(TAG, "getCallerInfo() based on number...");
int subId = SubscriptionManager.getDefaultSubId();
@@ -325,6 +328,7 @@ public class CallerInfo {
* with all relevant fields empty or null.
*/
public static CallerInfo getCallerInfo(Context context, String number, int subId) {
+ android.util.SeempLog.record(15);
if (TextUtils.isEmpty(number)) {
return null;
diff --git a/telephony/java/com/android/internal/telephony/IExtTelephony.aidl b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl
new file mode 100644
index 0000000..063308d
--- /dev/null
+++ b/telephony/java/com/android/internal/telephony/IExtTelephony.aidl
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package com.android.internal.telephony;
+
+
+/**
+ * Interface used to interact with the telephony framework for
+ * Telephony value adds.
+ * {@hide}
+ */
+interface IExtTelephony {
+
+ /**
+ * Returns the current SIM Manual provision status.
+ * @param slotId user preferred slotId.
+ * @return Card provision status as integer, below are
+ * possible return values.
+ * '0' - returned if Uicc Card is not provisioned.
+ * '1' - returned if Uicc Card provisioned.
+ * '-1'- returned if there is an error @ below layers OR
+ * if framework does not received info from Modem yet.
+ * '-2' returned when SIM card is not present in slot.
+ * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
+ */
+ int getCurrentUiccCardProvisioningStatus(int slotId);
+
+ /**
+ * Returns the user preferred Uicc card provision status.
+ * @param slotId user preferred slotId.
+ * @return User preference value as integer, below are
+ * possible return values.
+ * '0' - returned if Uicc Card is not provisioned.
+ * '1' - returned if Uicc Card provisioned.
+ * '-1'- returned if there is an error @ below layers OR
+ * if framework does not received info from Modem yet.
+ * '-2' returned when SIM card is not present in slot.
+ * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
+ */
+ int getUiccCardProvisioningUserPreference(int slotId);
+
+ /**
+ * Activates the Uicc card.
+ * @param slotId user preferred slotId.
+ * @return Uicc card activation result as Integer, below are
+ * supported return values:
+ * '0' - Success
+ * '-1' -Generic Failure
+ * '-2' -Invalid input
+ * '-3 -Another request in progress
+ * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ int activateUiccCard(int slotId);
+
+ /**
+ * Deactivates UICC card.
+ * @param slotId user preferred slotId.
+ * @return Uicc card deactivation result as Integer, below are
+ * supported return values:
+ * '0' - Success
+ * '-1' -Generic Failure
+ * '-2' -Invalid input
+ * '-3 -Another request in progress
+ * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ int deactivateUiccCard(int slotId);
+
+ /**
+ * Check for Sms Prompt is Enabled or Not.
+ * @return
+ * true - Sms Prompt is Enabled
+ * false - Sms prompt is Disabled
+ * Requires Permission: android.Manifest.permission.READ_PHONE_STATE
+ */
+ boolean isSMSPromptEnabled();
+
+ /**
+ * Enable/Disable Sms prompt option.
+ * @param - enabled
+ * true - to enable Sms prompt
+ * false - to disable Sms prompt
+ * Requires Permission: android.Manifest.permission.MODIFY_PHONE_STATE
+ */
+ void setSMSPromptEnabled(boolean enabled);
+
+ /**
+ * Get logical phone id for Emergency call.
+ * @param - void
+ * @return phone id
+ */
+ int getPhoneIdForECall();
+}
diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl
index 70a8653..1377734 100644
--- a/telephony/java/com/android/internal/telephony/ISms.aidl
+++ b/telephony/java/com/android/internal/telephony/ISms.aidl
@@ -187,6 +187,53 @@ interface ISms {
in PendingIntent deliveryIntent);
/**
+ * Send an SMS with options using Subscription Id.
+ *
+ * @param subId the subId on which the SMS has to be sent.
+ * @param destAddr the address to send the message to
+ * @param scAddr the SMSC to send the message through, or NULL for the
+ * default SMSC
+ * @param text the body of the message to send
+ * @param sentIntent if not NULL this <code>PendingIntent</code> is
+ * broadcast when the message is sucessfully sent, or failed.
+ * The result code will be <code>Activity.RESULT_OK<code> for success,
+ * or one of these errors:<br>
+ * <code>RESULT_ERROR_GENERIC_FAILURE</code><br>
+ * <code>RESULT_ERROR_RADIO_OFF</code><br>
+ * <code>RESULT_ERROR_NULL_PDU</code><br>
+ * For <code>RESULT_ERROR_GENERIC_FAILURE</code> the sentIntent may include
+ * the extra "errorCode" containing a radio technology specific value,
+ * generally only useful for troubleshooting.<br>
+ * The per-application based SMS control checks sentIntent. If sentIntent
+ * is NULL the caller will be checked against all unknown applications,
+ * which cause smaller number of SMS to be sent in checking period.
+ * @param deliveryIntent if not NULL this <code>PendingIntent</code> is
+ * broadcast when the message is delivered to the recipient. The
+ * raw pdu of the status report is in the extended data ("pdu").
+ * @param priority Priority level of the message
+ * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1
+ * ---------------------------------
+ * PRIORITY | Level of Priority
+ * ---------------------------------
+ * '00' | Normal
+ * '01' | Interactive
+ * '10' | Urgent
+ * '11' | Emergency
+ * ----------------------------------
+ * Any Other values included Negative considered as Invalid Priority Indicator of the message.
+ * @param isExpectMore is a boolean to indicate the sending message is multi segmented or not.
+ * @param validityPeriod Validity Period of the message in mins.
+ * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1.
+ * Validity Period(Minimum) -> 5 mins
+ * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks).
+ * Any Other values included Negative considered as Invalid Validity Period of the message.
+ */
+ void sendTextForSubscriberWithOptions(in int subId, String callingPkg, in String destAddr,
+ in String scAddr, in String text, in PendingIntent sentIntent,
+ in PendingIntent deliveryIntent, in int priority, in boolean isExpectMore,
+ in int validityPeriod);
+
+ /**
* Inject an SMS PDU into the android platform.
*
* @param subId the subId on which the SMS has to be injected.
@@ -234,6 +281,51 @@ interface ISms {
in List<PendingIntent> deliveryIntents, in boolean persistMessageForNonDefaultSmsApp);
/**
+ * Send a multi-part text based SMS with options using Subscription Id.
+ *
+ * @param subId the subId on which the SMS has to be sent.
+ * @param destinationAddress the address to send the message to
+ * @param scAddress is the service center address or null to use
+ * the current default SMSC
+ * @param parts an <code>ArrayList</code> of strings that, in order,
+ * comprise the original message
+ * @param sentIntents if not null, an <code>ArrayList</code> of
+ * <code>PendingIntent</code>s (one for each message part) that is
+ * broadcast when the corresponding message part has been sent.
+ * The result code will be <code>Activity.RESULT_OK<code> for success,
+ * or one of these errors:
+ * <code>RESULT_ERROR_GENERIC_FAILURE</code>
+ * <code>RESULT_ERROR_RADIO_OFF</code>
+ * <code>RESULT_ERROR_NULL_PDU</code>.
+ * @param deliveryIntents if not null, an <code>ArrayList</code> of
+ * <code>PendingIntent</code>s (one for each message part) that is
+ * broadcast when the corresponding message part has been delivered
+ * to the recipient. The raw pdu of the status report is in the
+ * extended data ("pdu").
+ * @param priority Priority level of the message
+ * Refer specification See 3GPP2 C.S0015-B, v2.0, table 4.5.9-1
+ * ---------------------------------
+ * PRIORITY | Level of Priority
+ * ---------------------------------
+ * '00' | Normal
+ * '01' | Interactive
+ * '10' | Urgent
+ * '11' | Emergency
+ * ----------------------------------
+ * Any Other values included Negative considered as Invalid Priority Indicator of the message.
+ * @param isExpectMore is a boolean to indicate the sending message is multi segmented or not.
+ * @param validityPeriod Validity Period of the message in mins.
+ * Refer specification 3GPP TS 23.040 V6.8.1 section 9.2.3.12.1.
+ * Validity Period(Minimum) -> 5 mins
+ * Validity Period(Maximum) -> 635040 mins(i.e.63 weeks).
+ * Any Other values included Negative considered as Invalid Validity Period of the message.
+ */
+ void sendMultipartTextForSubscriberWithOptions(in int subId, String callingPkg,
+ in String destinationAddress, in String scAddress, in List<String> parts,
+ in List<PendingIntent> sentIntents, in List<PendingIntent> deliveryIntents,
+ in int priority, in boolean isExpectMore, in int validityPeriod);
+
+ /**
* Enable reception of cell broadcast (SMS-CB) messages with the given
* message identifier and RAN type. The RAN type specify this message ID
* belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients
@@ -447,4 +539,12 @@ interface ISms {
void sendStoredMultipartText(int subId, String callingPkg, in Uri messageUri,
String scAddress, in List<PendingIntent> sentIntents,
in List<PendingIntent> deliveryIntents);
+
+ /**
+ * Get the capacity count of sms on Icc card.
+ *
+ * @param subId for subId which getSmsCapacityOnIcc is queried.
+ * @return capacity of ICC
+ */
+ int getSmsCapacityOnIccForSubscriber(int subId);
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index dcece26..c3db8c2 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -488,6 +488,13 @@ interface ITelephony {
int getVoiceNetworkTypeForSubscriber(int subId, String callingPackage);
/**
+ * Return icc operator numeric for given subId
+ * @param subId user preferred subId.
+ * Returns icc operator numeric
+ */
+ String getIccOperatorNumericForData(int subId);
+
+ /**
* Return true if an ICC card is present
*/
boolean hasIccCard();
@@ -531,6 +538,22 @@ interface ITelephony {
*/
void setCellInfoListRate(int rateInMillis);
+
+ /**
+ * Return if the current radio is LTE on GSM
+ */
+ int getLteOnGsmMode();
+
+ /**
+ * Adds a protected sms address to the {@link Settings.Secure.PROTECTED_SMS_ADDRESSES}
+ */
+ void addProtectedSmsAddress(String address);
+
+ /**
+ * Revokes a protected sms address from {@link Settings.Secure.PROTECTED_SMS_ADDRESSES}
+ */
+ boolean revokeProtectedSmsAddress(String address);
+
/**
* get default sim
* @return sim id
@@ -547,6 +570,18 @@ interface ITelephony {
*/
IccOpenLogicalChannelResponse iccOpenLogicalChannel(String AID);
+
+ /**
+ * Opens a logical channel to the ICC card for a particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CCHO command.
+ *
+ * @param subId user preferred subId.
+ * @param AID Application id. See ETSI 102.221 and 101.220.
+ * @return an IccOpenLogicalChannelResponse object.
+ */
+ IccOpenLogicalChannelResponse iccOpenLogicalChannelUsingSubId(int subId, String AID);
+
/**
* Closes a previously opened logical channel to the ICC card.
*
@@ -559,6 +594,19 @@ interface ITelephony {
boolean iccCloseLogicalChannel(int channel);
/**
+ * Closes a previously opened logical channel to the ICC card for a
+ * particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CCHC command.
+ *
+ * @param subId user preferred subId.
+ * @param channel is the channel id to be closed as retruned by a
+ * successful iccOpenLogicalChannel.
+ * @return true if the channel was closed successfully.
+ */
+ boolean iccCloseLogicalChannelUsingSubId(int subId, int channel);
+
+ /**
* Transmit an APDU to the ICC card over a logical channel.
*
* Input parameters equivalent to TS 27.007 AT+CGLA command.
@@ -579,6 +627,28 @@ interface ITelephony {
int p1, int p2, int p3, String data);
/**
+ * Transmit an APDU to the ICC card over a logical channel for a
+ * particular subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CGLA command.
+ *
+ * @param subId user preferred subId.
+ * @param channel is the channel id to be closed as retruned by a
+ * successful iccOpenLogicalChannel.
+ * @param cla Class of the APDU command.
+ * @param instruction Instruction of the APDU command.
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
+ * is sent to the SIM.
+ * @param data Data to be sent with the APDU.
+ * @return The APDU response from the ICC card with the status appended at
+ * the end.
+ */
+ String iccTransmitApduLogicalChannelUsingSubId(int subId, int channel, int cla,
+ int instruction, int p1, int p2, int p3, String data);
+
+ /**
* Transmit an APDU to the ICC card over the basic channel.
*
* Input parameters equivalent to TS 27.007 AT+CSIM command.
@@ -597,6 +667,26 @@ interface ITelephony {
int p1, int p2, int p3, String data);
/**
+ * Transmit an APDU to the ICC card over the basic channel for a particular
+ * subId.
+ *
+ * Input parameters equivalent to TS 27.007 AT+CSIM command.
+ *
+ * @param subId user preferred subId.
+ * @param cla Class of the APDU command.
+ * @param instruction Instruction of the APDU command.
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command. If p3 is negative a 4 byte APDU
+ * is sent to the SIM.
+ * @param data Data to be sent with the APDU.
+ * @return The APDU response from the ICC card with the status appended at
+ * the end.
+ */
+ String iccTransmitApduBasicChannelUsingSubId(int subId, int cla, int instruction,
+ int p1, int p2, int p3, String data);
+
+ /**
* Returns the response APDU for a command APDU sent through SIM_IO.
*
* @param fileID
@@ -611,6 +701,22 @@ interface ITelephony {
String filePath);
/**
+ * Returns the response APDU for a command APDU sent through SIM_IO
+ * for a particular subId.
+ *
+ * @param subId user preferred subId.
+ * @param fileID
+ * @param command
+ * @param p1 P1 value of the APDU command.
+ * @param p2 P2 value of the APDU command.
+ * @param p3 P3 value of the APDU command.
+ * @param filePath
+ * @return The APDU response.
+ */
+ byte[] iccExchangeSimIOUsingSubId(int subId, int fileID, int command, int p1, int p2,
+ int p3, String filePath);
+
+ /**
* Send ENVELOPE to the SIM and returns the response.
*
* @param contents String containing SAT/USAT response in hexadecimal
@@ -1005,4 +1111,15 @@ interface ITelephony {
* Return the modem activity info.
*/
ModemActivityInfo getModemActivityInfo();
+
+ /**
+ * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card
+ */
+ byte[] getAtr();
+
+ /**
+ * Get ATR (Answer To Reset; as per ISO/IEC 7816-4) from SIM card
+ * for a particular subId.
+ */
+ byte[] getAtrUsingSubId(int subId);
}
diff --git a/telephony/java/com/android/internal/telephony/OperatorInfo.java b/telephony/java/com/android/internal/telephony/OperatorInfo.java
index a29d7c1..7db6600 100644
--- a/telephony/java/com/android/internal/telephony/OperatorInfo.java
+++ b/telephony/java/com/android/internal/telephony/OperatorInfo.java
@@ -33,6 +33,7 @@ public class OperatorInfo implements Parcelable {
private String mOperatorAlphaLong;
private String mOperatorAlphaShort;
private String mOperatorNumeric;
+ private String mRadioTech;
private State mState = State.UNKNOWN;
@@ -57,6 +58,11 @@ public class OperatorInfo implements Parcelable {
return mState;
}
+ public String
+ getRadioTech() {
+ return mRadioTech;
+ }
+
OperatorInfo(String operatorAlphaLong,
String operatorAlphaShort,
String operatorNumeric,
@@ -65,6 +71,14 @@ public class OperatorInfo implements Parcelable {
mOperatorAlphaLong = operatorAlphaLong;
mOperatorAlphaShort = operatorAlphaShort;
mOperatorNumeric = operatorNumeric;
+ mRadioTech = "";
+ /* operatorNumeric format: PLMN+RAT or PLMN */
+ if (null != operatorNumeric) {
+ String values[] = operatorNumeric.split("\\+");
+ mOperatorNumeric = values[0];
+ if (values.length > 1)
+ mRadioTech = values[1];
+ }
mState = state;
}
@@ -108,6 +122,7 @@ public class OperatorInfo implements Parcelable {
return "OperatorInfo " + mOperatorAlphaLong
+ "/" + mOperatorAlphaShort
+ "/" + mOperatorNumeric
+ + "/" + mRadioTech
+ "/" + mState;
}
@@ -132,7 +147,7 @@ public class OperatorInfo implements Parcelable {
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mOperatorAlphaLong);
dest.writeString(mOperatorAlphaShort);
- dest.writeString(mOperatorNumeric);
+ dest.writeString(mOperatorNumeric + "+" + mRadioTech);
dest.writeSerializable(mState);
}
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 7088be8..af79ff8 100644..100755
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -77,7 +77,7 @@ public interface RILConstants {
int SIM_SAP_MSG_SIZE_TOO_SMALL = 34;
int SIM_SAP_CONNECT_OK_CALL_ONGOING = 35;
int LCE_NOT_SUPPORTED = 36; /* Link Capacity Estimation (LCE) not supported */
-
+ int INVALID_PARAMETER = 37;
/* NETWORK_MODE_* See ril.h RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE */
int NETWORK_MODE_WCDMA_PREF = 0; /* GSM/WCDMA (WCDMA preferred) */
@@ -334,6 +334,7 @@ cat include/telephony/ril.h | \
int RIL_REQUEST_STOP_LCE = 133;
int RIL_REQUEST_PULL_LCEDATA = 134;
int RIL_REQUEST_GET_ACTIVITY_INFO = 135;
+ int RIL_REQUEST_SIM_GET_ATR = 136;
int RIL_UNSOL_RESPONSE_BASE = 1000;
int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
@@ -382,4 +383,6 @@ cat include/telephony/ril.h | \
int RIL_UNSOL_ON_SS = 1043;
int RIL_UNSOL_STK_CC_ALPHA_NOTIFY = 1044;
int RIL_UNSOL_LCEDATA_RECV = 1045;
+
+ int RIL_UNSOL_STK_SEND_SMS_RESULT = 11002; /* Samsung STK */
}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
index 645c3a1..73e778c 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java
@@ -88,6 +88,11 @@ public interface TelephonyProperties
*/
static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice";
+ /**
+ * {@see BaseCommands#getLteOnGsmMode()}
+ */
+ static final String PROPERTY_LTE_ON_GSM_DEVICE = "telephony.lteOnGsmDevice";
+
static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type";
//****** SIM Card
@@ -217,4 +222,44 @@ public interface TelephonyProperties
* or Earpiece, based on the default audio routing strategy.
*/
static final String PROPERTY_VIDEOCALL_AUDIO_OUTPUT = "persist.radio.call.audio.output";
+
+ /**
+ * Used when Presence app sends Dial intent with specific schema
+ * If true: skip schema parsing and use Tel schema
+ * If false: parse schema
+ */
+ static final String EXTRA_SKIP_SCHEMA_PARSING =
+ "org.codeaurora.extra.SKIP_SCHEMA_PARSING";
+
+ /**
+ * For Group Conference Calling
+ * If true: isConferenceUri in Dial is set to true,
+ * which indicates that Dial is for Conference Calling
+ * If false: above is set to false
+ */
+ static final String EXTRAS_IS_CONFERENCE_URI = "isConferenceUri";
+
+ /**
+ * For Group Conference Dialing Feature
+ * If true: Dial intent triggered from Group Conference Calling screen
+ * if false: normal dial
+ */
+ static final String EXTRA_DIAL_CONFERENCE_URI =
+ "org.codeaurora.extra.DIAL_CONFERENCE_URI";
+
+ /**
+ * For Add Participant Feature
+ * If true: Dial intent triggered from Dialpad is for AddParticipant
+ * if false: normal dial
+ */
+ static final String ADD_PARTICIPANT_KEY = "add_participant";
+
+ /**
+ * For VICE Feature
+ * If true: Dial intent is for call pull functionality
+ * if false: normal dial
+ */
+ static final String EXTRA_IS_CALL_PULL =
+ "org.codeaurora.extra.IS_CALL_PULL";
+
}