aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kundra <deepakkundra@gmail.com>2016-01-21 19:15:59 -0800
committerDeepak Kundra <deepakkundra@gmail.com>2016-01-28 15:21:07 -0800
commitafc72f7cf43f25372fa0a5048b66ce682fe064e2 (patch)
treec4306fa1e36f09e7a90e119d9d321a907240af84
parent8942ed5118701013a490cea740be396e6c5a2387 (diff)
parent99ef530391a506470bd1124dc12560e8d72c6d7a (diff)
downloadandroid_frameworks_opt_telephony-staging/cm-13.0-caf.tar.gz
android_frameworks_opt_telephony-staging/cm-13.0-caf.tar.bz2
android_frameworks_opt_telephony-staging/cm-13.0-caf.zip
Merge 'remotes/caf/m' into 'cm-13.0'staging/cm-13.0-caf
Change-Id: I98791364677b7c0622c1ee1044838c406954398f
-rw-r--r--resources/res/values-es-rUS/config.xml37
-rw-r--r--resources/res/values-pt-rPT/config.xml36
-rw-r--r--resources/res/values/config.xml24
-rw-r--r--src/java/android/provider/Telephony.java42
-rw-r--r--src/java/android/telephony/SmsManager.java13
-rw-r--r--src/java/android/telephony/gsm/SmsManager.java14
-rw-r--r--src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java15
-rw-r--r--src/java/com/android/internal/telephony/PhoneBase.java45
-rw-r--r--src/java/com/android/internal/telephony/PhoneFactory.java2
-rw-r--r--src/java/com/android/internal/telephony/PhoneProxy.java24
-rw-r--r--src/java/com/android/internal/telephony/ServiceStateTracker.java10
-rw-r--r--src/java/com/android/internal/telephony/SubscriptionController.java2
-rw-r--r--src/java/com/android/internal/telephony/TelephonyPluginBase.java18
-rw-r--r--src/java/com/android/internal/telephony/TelephonyPluginDelegate.java16
-rw-r--r--src/java/com/android/internal/telephony/TelephonyPluginInterface.java11
-rw-r--r--src/java/com/android/internal/telephony/cdma/CDMAPhone.java5
-rw-r--r--src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java10
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/ApnContext.java7
-rwxr-xr-xsrc/java/com/android/internal/telephony/dataconnection/ApnSetting.java15
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DataConnection.java50
-rwxr-xr-x[-rw-r--r--]src/java/com/android/internal/telephony/dataconnection/DcController.java2
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DcFailCause.java2
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java15
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DcTracker.java29
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java19
-rw-r--r--src/java/com/android/internal/telephony/dataconnection/DctController.java50
-rw-r--r--src/java/com/android/internal/telephony/gsm/CallFailCause.java1
-rw-r--r--src/java/com/android/internal/telephony/gsm/GSMPhone.java28
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmCallTracker.java2
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmConnection.java3
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmMmiCode.java18
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java22
-rw-r--r--src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java6
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhone.java17
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java32
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java20
-rw-r--r--src/java/com/android/internal/telephony/uicc/AdnRecordCache.java19
-rw-r--r--src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java41
-rw-r--r--src/java/com/android/internal/telephony/uicc/CsimFileHandler.java4
-rw-r--r--src/java/com/android/internal/telephony/uicc/IccConstants.java5
-rw-r--r--src/java/com/android/internal/telephony/uicc/RuimFileHandler.java4
-rw-r--r--src/java/com/android/internal/telephony/uicc/UiccCardApplication.java3
-rw-r--r--src/java/org/codeaurora/QtiVideoCallConstants.java25
-rw-r--r--src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceListenerBaseImpl.java83
-rw-r--r--src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceUtils.java4
-rw-r--r--src/java/org/codeaurora/ims/qtiims/QtiViceInfo.java96
46 files changed, 704 insertions, 242 deletions
diff --git a/resources/res/values-es-rUS/config.xml b/resources/res/values-es-rUS/config.xml
new file mode 100644
index 000000000..73df57c78
--- /dev/null
+++ b/resources/res/values-es-rUS/config.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. Do not translate. -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- pdp data reject dialog string for cause 29 and 33 -->
+ <string name="data_conn_status_title" translatable="false"></string>
+ <string name="user_authentication_failed" translatable="false"></string>
+ <string name="service_not_subscribed" translatable="false"></string>
+</resources>
diff --git a/resources/res/values-pt-rPT/config.xml b/resources/res/values-pt-rPT/config.xml
new file mode 100644
index 000000000..ac287f536
--- /dev/null
+++ b/resources/res/values-pt-rPT/config.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. Do not translate. -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- SDN related strings -->
+ <string name="sdn" translatable="false"></string>
+ <string name="summary_sdn" translatable="false"></string>
+</resources>
diff --git a/resources/res/values/config.xml b/resources/res/values/config.xml
index 730ff9827..eb6a35fd1 100644
--- a/resources/res/values/config.xml
+++ b/resources/res/values/config.xml
@@ -48,4 +48,28 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<string name="telephony_plugin_jar_name" translatable="false"></string>
<!--Fully qualified class name of telephony extended plugin.-->
<string name="telephony_plugin_class_name" translatable="false"></string>
+ <!-- When set to true, this config enables reading and displaying
+ the contents of EF_SDN present in SIM -->
+ <bool name="config_enable_displaying_sdn">false</bool>
+ <!-- config for showing dial option when fdn contact is selected.
+ By default feature is disabled -->
+ <bool name="config_fdn_direct_dial">false</bool>
+ <!-- FDN contact search is enabled-->
+ <bool name="config_fdn_contact_search">false</bool>
+ <!-- plmn name override enabled-->
+ <bool name="config_plmn_name_override_enabled">false</bool>
+
+ <string name="sdn"></string>
+ <string name="summary_sdn"></string>
+ <string name="launch_sdn"></string>
+ <!-- pdp data retry for cause 29 and 33 is disabled-->
+ <bool name="config_pdp_retry_for_29_33_enabled">false</bool>
+ <!--pdp data reject retry delay can be configured here -->
+ <integer name="data_retry_delay">0</integer>
+ <!-- pdp data reject idle timeout delay-->
+ <integer name="data_retry_idle_delay">0</integer>
+ <!-- pdp data reject dialog string for cause 29 and 33 -->
+ <string name="data_conn_status_title"></string>
+ <string name="user_authentication_failed"></string>
+ <string name="service_not_subscribed"></string>
</resources>
diff --git a/src/java/android/provider/Telephony.java b/src/java/android/provider/Telephony.java
index 443a192ba..5e5e89bd1 100644
--- a/src/java/android/provider/Telephony.java
+++ b/src/java/android/provider/Telephony.java
@@ -316,7 +316,7 @@ public final class Telephony {
* @hide
*/
public static Cursor query(ContentResolver cr, String[] projection) {
- android.util.SeempLog.record(13);
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
}
@@ -326,7 +326,7 @@ public final class Telephony {
*/
public static Cursor query(ContentResolver cr, String[] projection,
String where, String orderBy) {
- android.util.SeempLog.record(13);
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, where,
null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
}
@@ -2044,7 +2044,7 @@ public final class Telephony {
*/
public static Cursor query(
ContentResolver cr, String[] projection) {
- android.util.SeempLog.record(13);
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
}
@@ -2055,7 +2055,7 @@ public final class Telephony {
public static Cursor query(
ContentResolver cr, String[] projection,
String where, String orderBy) {
- android.util.SeempLog.record(13);
+ android.util.SeempLog.record(10);
return cr.query(CONTENT_URI, projection,
where, null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
}
@@ -2983,7 +2983,7 @@ public final class Telephony {
* <P>Type: INTEGER</P>
*/
public static final String SERVICE_CATEGORY = "service_category";
-
+ public static final String MESSAGE_DELETED = "flag_is_deleted";
/**
* Message language code.
* <P>Type: TEXT</P>
@@ -3093,6 +3093,38 @@ public final class Telephony {
}
/**
+ * @hide
+ */
+ public static final class CdmaCallOptions implements BaseColumns {
+ /**
+ * The content:// style URL for this table
+ */
+ public static final Uri CONTENT_URI =
+ Uri.parse("content://cdma/calloption");
+
+ /**
+ * The default sort order for this table
+ */
+ public static final String DEFAULT_SORT_ORDER = "name ASC";
+
+ public static final String NAME = "name";
+
+ public static final String MCC = "mcc";
+
+ public static final String MNC = "mnc";
+
+ public static final String NUMERIC = "numeric";
+
+ public static final String NUMBER = "number";
+
+ public static final String TYPE = "type";
+
+ public static final String CATEGORY = "category";
+
+ public static final String STATE = "state";
+ }
+
+ /**
* Contains phone numbers that are blacklisted
* for phone and/or message purposes.
* @hide
diff --git a/src/java/android/telephony/SmsManager.java b/src/java/android/telephony/SmsManager.java
index f8fc6db0c..30c0bb17d 100644
--- a/src/java/android/telephony/SmsManager.java
+++ b/src/java/android/telephony/SmsManager.java
@@ -290,7 +290,7 @@ public final class SmsManager {
public void sendTextMessage(
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
- android.util.SeempLog.record(94);
+ android.util.SeempLog.record_str(75, destinationAddress);
sendTextMessageInternal(destinationAddress, scAddress, text,
sentIntent, deliveryIntent, true /* persistMessageForCarrierApp*/);
}
@@ -341,6 +341,7 @@ public final class SmsManager {
public void sendTextMessageWithSelfPermissions(
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
+ android.util.SeempLog.record_str(75, destinationAddress);
if (TextUtils.isEmpty(destinationAddress)) {
throw new IllegalArgumentException("Invalid destinationAddress");
}
@@ -525,7 +526,6 @@ public final class SmsManager {
public void sendMultipartTextMessage(
String destinationAddress, String scAddress, ArrayList<String> parts,
ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents) {
- android.util.SeempLog.record(96);
sendMultipartTextMessageInternal(destinationAddress, scAddress, parts,
sentIntents, deliveryIntents, true /* persistMessageForCarrierApp*/);
}
@@ -709,7 +709,7 @@ public final class SmsManager {
public void sendDataMessage(
String destinationAddress, String scAddress, short destinationPort,
byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) {
- android.util.SeempLog.record(92);
+ android.util.SeempLog.record_str(73, destinationAddress);
if (TextUtils.isEmpty(destinationAddress)) {
throw new IllegalArgumentException("Invalid destinationAddress");
}
@@ -737,6 +737,7 @@ public final class SmsManager {
public void sendDataMessageWithSelfPermissions(
String destinationAddress, String scAddress, short destinationPort,
byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) {
+ android.util.SeempLog.record_str(73, destinationAddress);
if (TextUtils.isEmpty(destinationAddress)) {
throw new IllegalArgumentException("Invalid destinationAddress");
}
@@ -870,7 +871,7 @@ public final class SmsManager {
* {@hide}
*/
public boolean copyMessageToIcc(byte[] smsc, byte[] pdu,int status) {
- android.util.SeempLog.record(98);
+ android.util.SeempLog.record(79);
boolean success = false;
if (null == pdu) {
@@ -902,7 +903,7 @@ public final class SmsManager {
*/
public boolean
deleteMessageFromIcc(int messageIndex) {
- android.util.SeempLog.record(99);
+ android.util.SeempLog.record(80);
boolean success = false;
byte[] pdu = new byte[IccConstants.SMS_RECORD_LENGTH-1];
Arrays.fill(pdu, (byte)0xff);
@@ -936,7 +937,7 @@ public final class SmsManager {
* {@hide}
*/
public boolean updateMessageOnIcc(int messageIndex, int newStatus, byte[] pdu) {
- android.util.SeempLog.record(100);
+ android.util.SeempLog.record(81);
boolean success = false;
try {
diff --git a/src/java/android/telephony/gsm/SmsManager.java b/src/java/android/telephony/gsm/SmsManager.java
index 7040b4425..41c5adcda 100644
--- a/src/java/android/telephony/gsm/SmsManager.java
+++ b/src/java/android/telephony/gsm/SmsManager.java
@@ -76,7 +76,7 @@ import java.util.ArrayList;
public final void sendTextMessage(
String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent) {
- android.util.SeempLog.record(94);
+ android.util.SeempLog.record_str(75, destinationAddress);
mSmsMgrProxy.sendTextMessage(destinationAddress, scAddress, text,
sentIntent, deliveryIntent);
}
@@ -129,7 +129,7 @@ import java.util.ArrayList;
public final void sendMultipartTextMessage(
String destinationAddress, String scAddress, ArrayList<String> parts,
ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents) {
- android.util.SeempLog.record(96);
+ android.util.SeempLog.record_str(77, destinationAddress);
mSmsMgrProxy.sendMultipartTextMessage(destinationAddress, scAddress, parts,
sentIntents, deliveryIntents);
}
@@ -163,7 +163,7 @@ import java.util.ArrayList;
public final void sendDataMessage(
String destinationAddress, String scAddress, short destinationPort,
byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) {
- android.util.SeempLog.record(92);
+ android.util.SeempLog.record_str(73, destinationAddress);
mSmsMgrProxy.sendDataMessage(destinationAddress, scAddress, destinationPort,
data, sentIntent, deliveryIntent);
}
@@ -181,7 +181,7 @@ import java.util.ArrayList;
*/
@Deprecated
public final boolean copyMessageToSim(byte[] smsc, byte[] pdu, int status) {
- android.util.SeempLog.record(101);
+ android.util.SeempLog.record(82);
return mSmsMgrProxy.copyMessageToIcc(smsc, pdu, status);
}
@@ -195,7 +195,7 @@ import java.util.ArrayList;
*/
@Deprecated
public final boolean deleteMessageFromSim(int messageIndex) {
- android.util.SeempLog.record(102);
+ android.util.SeempLog.record(83);
return mSmsMgrProxy.deleteMessageFromIcc(messageIndex);
}
@@ -213,7 +213,7 @@ import java.util.ArrayList;
*/
@Deprecated
public final boolean updateMessageOnSim(int messageIndex, int newStatus, byte[] pdu) {
- android.util.SeempLog.record(103);
+ android.util.SeempLog.record(84);
return mSmsMgrProxy.updateMessageOnIcc(messageIndex, newStatus, pdu);
}
@@ -225,7 +225,7 @@ import java.util.ArrayList;
*/
@Deprecated
public final ArrayList<android.telephony.SmsMessage> getAllMessagesFromSim() {
- android.util.SeempLog.record(104);
+ android.util.SeempLog.record(85);
return android.telephony.SmsManager.getDefault().getAllMessagesFromIcc();
}
diff --git a/src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java b/src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java
index a8a267433..91df21eda 100644
--- a/src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java
+++ b/src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java
@@ -50,6 +50,7 @@ public abstract class IccPhoneBookInterfaceManager {
protected final Object mLock = new Object();
protected int mRecordSize[];
protected boolean mSuccess;
+ private boolean mForceAdnUsage = false;
protected List<AdnRecord> mRecords;
@@ -125,6 +126,7 @@ public abstract class IccPhoneBookInterfaceManager {
if (mRecords != null) {
mRecords.clear();
}
+ mForceAdnUsage = false;
}
public void updateIccRecords(IccRecords iccRecords) {
@@ -314,13 +316,13 @@ public abstract class IccPhoneBookInterfaceManager {
"Requires android.permission.READ_CONTACTS permission");
}
- efid = updateEfForIccType(efid);
- if (DBG) logd("getAdnRecordsInEF: efid=" + efid);
-
synchronized(mLock) {
checkThread();
AtomicBoolean status = new AtomicBoolean(false);
Message response = mBaseHandler.obtainMessage(EVENT_LOAD_DONE, status);
+ efid = updateEfForIccType(efid);
+ if (DBG) logd("getAdnRecordsInEF: efid=" + efid);
+
if (mAdnCache != null) {
mAdnCache.requestLoadAllAdnLike(efid,
mAdnCache.extensionEfForEf(efid), null, response);
@@ -328,6 +330,11 @@ public abstract class IccPhoneBookInterfaceManager {
} else {
loge("Failure while trying to load from SIM due to uninitialised adncache");
}
+ if (mRecords == null && efid == IccConstants.EF_PBR && !mAdnCache.isPbrPresent()) {
+ logd("getAdnRecordsInEF: Load from EF_ADN as pbr is not present");
+ mForceAdnUsage = true;
+ return getAdnRecordsInEf(IccConstants.EF_ADN);
+ }
}
return mRecords;
}
@@ -369,7 +376,7 @@ public abstract class IccPhoneBookInterfaceManager {
private int updateEfForIccType(int efid) {
// Check if we are trying to read ADN records
- if (efid == IccConstants.EF_ADN) {
+ if (efid == IccConstants.EF_ADN && !mForceAdnUsage) {
if (mPhone.getCurrentUiccAppType() == AppType.APPTYPE_USIM ||
mPhone.getCurrentUiccAppType() == AppType.APPTYPE_CSIM) {
return IccConstants.EF_PBR;
diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java
index d7e13f76c..5ecee3afb 100644
--- a/src/java/com/android/internal/telephony/PhoneBase.java
+++ b/src/java/com/android/internal/telephony/PhoneBase.java
@@ -198,11 +198,6 @@ public abstract class PhoneBase extends Handler implements Phone {
// Key used to read/write the ID for storing the voice mail
public static final String VM_ID = "vm_id_key";
- // Key used for storing call forwarding status
- public static final String CF_STATUS = "cf_status_key";
- // Key used to read/write the ID for storing the call forwarding status
- public static final String CF_ID = "cf_id_key";
-
// Key used to read/write the SIM IMSI used for storing the imsi
public static final String SIM_IMSI = "sim_imsi_key";
// Key used to read/write SIM IMSI used for storing the imsi
@@ -210,6 +205,11 @@ public abstract class PhoneBase extends Handler implements Phone {
// Key used to read/write if Call Forwarding is enabled
public static final String CF_ENABLED = "cf_enabled_key";
+ // Key used for storing call forwarding status
+ public static final String CF_STATUS = "cf_status_key";
+ // Key used to read/write the ID for storing the call forwarding status
+ public static final String CF_ID = "cf_id_key";
+
// Key used to read/write "disable DNS server check" pref (used for testing)
public static final String DNS_SERVER_CHECK_DISABLED_KEY = "dns_server_check_disabled_key";
@@ -1045,25 +1045,30 @@ public abstract class PhoneBase extends Handler implements Phone {
}
}
- // wrap the response message in our own message along with
- // an empty string (to indicate automatic selection) for the
- // operator's id.
- NetworkSelectMessage nsm = new NetworkSelectMessage();
- nsm.message = response;
- nsm.operatorNumeric = "";
- nsm.operatorAlphaLong = "";
- nsm.operatorAlphaShort = "";
-
if (doAutomatic) {
+ // wrap the response message in our own message along with
+ // an empty string (to indicate automatic selection) for the
+ // operator's id.
+ NetworkSelectMessage nsm = new NetworkSelectMessage();
+ nsm.message = response;
+ nsm.operatorNumeric = "";
+ nsm.operatorAlphaLong = "";
+ nsm.operatorAlphaShort = "";
+
Message msg = obtainMessage(EVENT_SET_NETWORK_AUTOMATIC_COMPLETE, nsm);
mCi.setNetworkSelectionModeAutomatic(msg);
+
+ updateSavedNetworkOperator(nsm);
} else {
Rlog.d(LOG_TAG, "setNetworkSelectionModeAutomatic - already auto, ignoring");
- ar.userObj = nsm;
- handleSetSelectNetwork(ar);
+ // since the Network selection mode is already set to
+ // automatic, sendresponse with the result considering
+ // it as successful for those expecting it.
+ if (response != null) {
+ AsyncResult.forMessage(response, null, null);
+ response.sendToTarget();
+ }
}
-
- updateSavedNetworkOperator(nsm);
}
@Override
@@ -1525,6 +1530,10 @@ public abstract class PhoneBase extends Handler implements Phone {
r.setVoiceCallForwardingFlag(line, enable, number);
}
+ public int getVoiceCallForwardingFlag() {
+ return getCallForwardingIndicatorFromSharedPref();
+ }
+
@Override
public boolean getCallForwardingIndicator() {
IccRecords r = mIccRecords.get();
diff --git a/src/java/com/android/internal/telephony/PhoneFactory.java b/src/java/com/android/internal/telephony/PhoneFactory.java
index 2814f333a..7091a6e74 100644
--- a/src/java/com/android/internal/telephony/PhoneFactory.java
+++ b/src/java/com/android/internal/telephony/PhoneFactory.java
@@ -195,7 +195,7 @@ public class PhoneFactory {
}
Rlog.i(LOG_TAG, "Creating Phone with type = " + phoneType + " sub = " + i);
- sProxyPhones[i] = new PhoneProxy(phone);
+ sProxyPhones[i] = TelephonyPluginDelegate.getInstance().makePhoneProxy(phone);
}
mProxyController = ProxyController.getInstance(context, sProxyPhones,
mUiccController, sCommandsInterfaces);
diff --git a/src/java/com/android/internal/telephony/PhoneProxy.java b/src/java/com/android/internal/telephony/PhoneProxy.java
index 96588a4ee..e8a3e202a 100644
--- a/src/java/com/android/internal/telephony/PhoneProxy.java
+++ b/src/java/com/android/internal/telephony/PhoneProxy.java
@@ -73,16 +73,17 @@ public class PhoneProxy extends Handler implements Phone {
private int mRilVersion;
- private static final int EVENT_VOICE_RADIO_TECH_CHANGED = 1;
+ protected static final int EVENT_VOICE_RADIO_TECH_CHANGED = 1;
private static final int EVENT_RADIO_ON = 2;
- private static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE = 3;
- private static final int EVENT_RIL_CONNECTED = 4;
+ protected static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE = 3;
+ protected static final int EVENT_RIL_CONNECTED = 4;
private static final int EVENT_UPDATE_PHONE_OBJECT = 5;
+ private static final int EVENT_SIM_RECORDS_LOADED = 6;
+ private static final int EVENT_RADIO_AVAILABLE = 7;
+ protected static final int EVENT_RADIO_UNAVAILABLE = 8;
private static final int EVENT_CARRIER_CONFIG_CHANGED = 6;
- private static final int EVENT_SIM_RECORDS_LOADED = 7;
- private static final int EVENT_RADIO_AVAILABLE = 8;
- private int mPhoneId = 0;
+ protected int mPhoneId = 0;
private Context mContext;
private BroadcastReceiver mPhoneProxyReceiver = new BroadcastReceiver() {
@@ -111,6 +112,7 @@ public class PhoneProxy extends Handler implements Phone {
mCommandsInterface.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null);
mCommandsInterface.registerForVoiceRadioTechChanged(
this, EVENT_VOICE_RADIO_TECH_CHANGED, null);
+ mCommandsInterface.registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, null);
mPhoneId = phone.getPhoneId();
mIccSmsInterfaceManager =
new IccSmsInterfaceManager((PhoneBase)this.mActivePhone);
@@ -205,15 +207,15 @@ public class PhoneProxy extends Handler implements Phone {
super.handleMessage(msg);
}
- private static void logd(String msg) {
+ protected void logd(String msg) {
Rlog.d(LOG_TAG, "[PhoneProxy] " + msg);
}
- private void loge(String msg) {
+ protected void loge(String msg) {
Rlog.e(LOG_TAG, "[PhoneProxy] " + msg);
}
- private void phoneObjectUpdater(int newVoiceRadioTech) {
+ protected void phoneObjectUpdater(int newVoiceRadioTech) {
logd("phoneObjectUpdater: newVoiceRadioTech=" + newVoiceRadioTech);
if (mActivePhone != null) {
@@ -1416,6 +1418,10 @@ public class PhoneProxy extends Handler implements Phone {
@Override
public void dispose() {
+ if (mActivePhone != null) {
+ mActivePhone.unregisterForSimRecordsLoaded(this);
+ mActivePhone.getContext().unregisterReceiver(sConfigChangeReceiver);
+ }
mCommandsInterface.unregisterForOn(this);
mCommandsInterface.unregisterForAvailable(this);
mCommandsInterface.unregisterForVoiceRadioTechChanged(this);
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java
index 88f1c14d7..9549704b4 100644
--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -1144,6 +1144,11 @@ public abstract class ServiceStateTracker extends Handler {
return isInNetwork(b, network, CarrierConfigManager.KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY);
}
+ /** Check if the device is shutting down. */
+ public final boolean isDeviceShuttingDown() {
+ return mDeviceShuttingDown;
+ }
+
/**
* Consider dataRegState if voiceRegState is OOS to determine SPN to be
* displayed
@@ -1169,11 +1174,6 @@ public abstract class ServiceStateTracker extends Handler {
rat == ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA);
}
- /** Check if the device is shutting down. */
- public final boolean isDeviceShuttingDown() {
- return mDeviceShuttingDown;
- }
-
protected String maybeUpdateHDTagForSpn(boolean showSpn, String spn) {
if (!showSpn) return spn;
return maybeUpdateHDTag(spn);
diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java
index aa0eb390e..41b201d6d 100644
--- a/src/java/com/android/internal/telephony/SubscriptionController.java
+++ b/src/java/com/android/internal/telephony/SubscriptionController.java
@@ -1737,6 +1737,7 @@ public class SubscriptionController extends ISub.Stub {
case SubscriptionManager.CB_ALERT_SPEECH:
case SubscriptionManager.CB_ETWS_TEST_ALERT:
case SubscriptionManager.CB_CHANNEL_50_ALERT:
+ case SubscriptionManager.CB_CHANNEL_60_ALERT:
case SubscriptionManager.CB_CMAS_TEST_ALERT:
case SubscriptionManager.CB_OPT_OUT_DIALOG:
value.put(propKey, Integer.parseInt(propValue));
@@ -1833,6 +1834,7 @@ public class SubscriptionController extends ISub.Stub {
case SubscriptionManager.CB_ALERT_SPEECH:
case SubscriptionManager.CB_ETWS_TEST_ALERT:
case SubscriptionManager.CB_CHANNEL_50_ALERT:
+ case SubscriptionManager.CB_CHANNEL_60_ALERT:
case SubscriptionManager.CB_CMAS_TEST_ALERT:
case SubscriptionManager.CB_OPT_OUT_DIALOG:
resultValue = cursor.getInt(0) + "";
diff --git a/src/java/com/android/internal/telephony/TelephonyPluginBase.java b/src/java/com/android/internal/telephony/TelephonyPluginBase.java
index 173ef14a6..8312c636a 100644
--- a/src/java/com/android/internal/telephony/TelephonyPluginBase.java
+++ b/src/java/com/android/internal/telephony/TelephonyPluginBase.java
@@ -34,6 +34,9 @@ import com.android.internal.telephony.cdma.CDMALTEPhone;
import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
import com.android.internal.telephony.gsm.GSMPhone;
+import com.android.internal.telephony.gsm.GsmServiceStateTracker;
+import com.android.internal.telephony.uicc.SIMRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
public abstract class TelephonyPluginBase implements TelephonyPluginInterface {
private String TAG = "TelephonyPluginBase";
@@ -72,6 +75,11 @@ public abstract class TelephonyPluginBase implements TelephonyPluginInterface {
}
@Override
+ public PhoneProxy makePhoneProxy(PhoneBase phone) {
+ return new PhoneProxy(phone);
+ }
+
+ @Override
public PhoneBase makeCDMALTEPhone(Context context, CommandsInterface ci,
PhoneNotifier notifier, int phoneId) {
return new CDMALTEPhone(context, ci, notifier, phoneId);
@@ -81,4 +89,14 @@ public abstract class TelephonyPluginBase implements TelephonyPluginInterface {
public void initExtTelephonyClasses(Context context,
Phone[] phoneProxy, CommandsInterface[] commandsInterfaces) {
}
+
+ @Override
+ public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone) {
+ return new GsmServiceStateTracker(phone);
+ }
+
+ @Override
+ public SIMRecords makeSIMRecords (UiccCardApplication app, Context c, CommandsInterface ci) {
+ return new SIMRecords(app, c, ci);
+ }
}
diff --git a/src/java/com/android/internal/telephony/TelephonyPluginDelegate.java b/src/java/com/android/internal/telephony/TelephonyPluginDelegate.java
index 89cf19804..76491b5fe 100644
--- a/src/java/com/android/internal/telephony/TelephonyPluginDelegate.java
+++ b/src/java/com/android/internal/telephony/TelephonyPluginDelegate.java
@@ -35,8 +35,12 @@ import android.telephony.Rlog;
import com.android.internal.telephony.ConfigResourceUtil;
import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
+import com.android.internal.telephony.gsm.GSMPhone;
+import com.android.internal.telephony.gsm.GsmServiceStateTracker;
import com.android.internal.telephony.TelephonyPluginBase;
import com.android.internal.telephony.DefaultTelephonyPlugin;
+import com.android.internal.telephony.uicc.SIMRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
import com.android.internal.R;
import dalvik.system.PathClassLoader;
@@ -127,6 +131,10 @@ public class TelephonyPluginDelegate {
return sPlugin.makeGSMPhone(context, ci, notifier, phoneId);
}
+ public PhoneProxy makePhoneProxy(PhoneBase phone) {
+ return sPlugin.makePhoneProxy(phone);
+ }
+
public PhoneBase makeCDMALTEPhone(Context context, CommandsInterface ci,
PhoneNotifier notifier, int phoneId) {
return sPlugin.makeCDMALTEPhone(context, ci, notifier, phoneId);
@@ -136,4 +144,12 @@ public class TelephonyPluginDelegate {
Phone[] phoneProxy, CommandsInterface[] commandsInterfaces) {
sPlugin.initExtTelephonyClasses(context, phoneProxy, commandsInterfaces);
}
+
+ public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone) {
+ return sPlugin.makeGsmServiceStateTracker(phone);
+ }
+
+ public SIMRecords makeSIMRecords (UiccCardApplication app, Context c, CommandsInterface ci) {
+ return sPlugin.makeSIMRecords (app, c, ci);
+ }
}
diff --git a/src/java/com/android/internal/telephony/TelephonyPluginInterface.java b/src/java/com/android/internal/telephony/TelephonyPluginInterface.java
index 72ded60cd..ae3613b9c 100644
--- a/src/java/com/android/internal/telephony/TelephonyPluginInterface.java
+++ b/src/java/com/android/internal/telephony/TelephonyPluginInterface.java
@@ -31,6 +31,10 @@ import android.content.Context;
import com.android.internal.telephony.dataconnection.DcTracker;
import com.android.internal.telephony.dataconnection.DctController;
+import com.android.internal.telephony.gsm.GSMPhone;
+import com.android.internal.telephony.gsm.GsmServiceStateTracker;
+import com.android.internal.telephony.uicc.SIMRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
public interface TelephonyPluginInterface {
@@ -49,9 +53,16 @@ public interface TelephonyPluginInterface {
public PhoneBase makeGSMPhone(Context context, CommandsInterface ci,
PhoneNotifier notifier, int phoneId);
+ public PhoneProxy makePhoneProxy(PhoneBase phone);
+
public PhoneBase makeCDMALTEPhone(Context context, CommandsInterface ci,
PhoneNotifier notifier, int phoneId);
public void initExtTelephonyClasses(Context context,
Phone[] phoneProxy, CommandsInterface[] commandsInterfaces);
+
+ public GsmServiceStateTracker makeGsmServiceStateTracker(GSMPhone phone);
+
+ public SIMRecords makeSIMRecords (UiccCardApplication app, Context c,
+ CommandsInterface ci);
}
diff --git a/src/java/com/android/internal/telephony/cdma/CDMAPhone.java b/src/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 0c1152986..e180cc290 100644
--- a/src/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/src/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -153,6 +153,7 @@ public class CDMAPhone extends PhoneBase {
super("CDMA", notifier, context, ci, false, phoneId);
initSstIcc();
init(context, notifier);
+ notifyPhoneStateChanged();
}
protected void initSstIcc() {
@@ -1175,7 +1176,7 @@ public class CDMAPhone extends PhoneBase {
mIsPhoneInEcmState = true;
// notify change
sendEmergencyCallbackModeChange();
- setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
+ super.setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
// Post this runnable so we will automatically exit
// if no one invokes exitEmergencyCallbackMode() directly.
@@ -1203,7 +1204,7 @@ public class CDMAPhone extends PhoneBase {
if (ar.exception == null) {
if (mIsPhoneInEcmState) {
mIsPhoneInEcmState = false;
- setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
+ super.setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
}
// send an Intent
sendEmergencyCallbackModeChange();
diff --git a/src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
index 2d147080c..08f5dd012 100644
--- a/src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
@@ -589,8 +589,6 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
String plmn = mSS.getOperatorAlphaLong();
boolean showPlmn = false;
- showPlmn = plmn != null;
-
int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
int[] subIds = SubscriptionManager.getSubId(mPhone.getPhoneId());
if (subIds != null && subIds.length > 0) {
@@ -612,6 +610,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
// would set showPlmn to true only if plmn was not empty, i.e. was not
// null and not blank. But this would cause us to incorrectly display
// "No Service". Now showPlmn is set to true for any non null string.
+ showPlmn = plmn != null;
if (DBG) {
log(String.format("updateSpnDisplay: changed sending intent" +
" showPlmn='%b' plmn='%s' subId='%d'", showPlmn, plmn, subId));
@@ -663,7 +662,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
if (states.length > 0) {
try {
regState = Integer.parseInt(states[0]);
-
+
// states[3] (if present) is the current radio technology
if (states.length >= 4 && states[3] != null) {
dataRadioTechnology = Integer.parseInt(states[3]);
@@ -1436,11 +1435,10 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
String idd = mHbpcdUtils.getIddByMcc(
Integer.parseInt(operatorNumeric.substring(0,3)));
if (idd != null && !idd.isEmpty()) {
- mPhone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING,
- idd);
+ SystemProperties.set(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING, idd);
} else {
// use default "+", since we don't know the current IDP
- mPhone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING, "+");
+ SystemProperties.set(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING, "+");
}
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/ApnContext.java b/src/java/com/android/internal/telephony/dataconnection/ApnContext.java
index bf3724e62..4e058cd7b 100644
--- a/src/java/com/android/internal/telephony/dataconnection/ApnContext.java
+++ b/src/java/com/android/internal/telephony/dataconnection/ApnContext.java
@@ -322,11 +322,6 @@ public class ApnContext {
public void decRefCount(LocalLog log) {
synchronized (mRefCountLock) {
- if (mRefCount == 0) {
- log.log("ApnContext.decRefCount - reset to 0.");
- log("decRefCount attempt to decrement below 0");
- return;
- }
// leave the last log alive to capture the actual tear down
if (mRefCount != 1) {
@@ -341,6 +336,8 @@ public class ApnContext {
if (mRefCount-- == 1) {
mDcTracker.setEnabled(mDcTracker.apnTypeToId(mApnType), false);
}
+ log("decRefCount postDeccrement = " + mRefCount);
+
if (mRefCount < 0) {
log.log("ApnContext.decRefCount went to " + mRefCount);
mRefCount = 0;
diff --git a/src/java/com/android/internal/telephony/dataconnection/ApnSetting.java b/src/java/com/android/internal/telephony/dataconnection/ApnSetting.java
index 117ec6099..8e1dd5a1d 100755
--- a/src/java/com/android/internal/telephony/dataconnection/ApnSetting.java
+++ b/src/java/com/android/internal/telephony/dataconnection/ApnSetting.java
@@ -18,6 +18,7 @@ package com.android.internal.telephony.dataconnection;
import android.telephony.ServiceState;
import android.text.TextUtils;
+import android.util.Log;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;
@@ -34,6 +35,7 @@ public class ApnSetting {
static final String V2_FORMAT_REGEX = "^\\[ApnSettingV2\\]\\s*";
static final String V3_FORMAT_REGEX = "^\\[ApnSettingV3\\]\\s*";
+ static final String TAG = "ApnSetting";
public final String carrier;
public final String apn;
@@ -368,7 +370,20 @@ public class ApnSetting {
gid1.substring(0, mvno_match_data_length).equalsIgnoreCase(mvnoMatchData)) {
return true;
}
+ } else if (mvnoType.equalsIgnoreCase("iccid")) {
+ String iccId = r.getIccId();
+ if (iccId != null) {
+ String[] mvnoIccidList = mvnoMatchData.split(",");
+ for (String mvnoIccid : mvnoIccidList) {
+ Log.d(TAG, "mvnoIccid: " + mvnoIccid);
+ if (iccId.startsWith(mvnoIccid)) {
+ Log.d(TAG, "mvno icc id match found");
+ return true;
+ }
+ }
+ }
}
+
return false;
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
index c7586cc41..e4bc64edd 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
@@ -26,6 +26,7 @@ import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.RetryManager;
import com.android.internal.telephony.ServiceStateTracker;
+import com.android.internal.telephony.TelephonyPluginDelegate;
import com.android.internal.util.AsyncChannel;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.Protocol;
@@ -86,9 +87,9 @@ import java.util.HashMap;
* NOTE: All DataConnection objects must be running on the same looper, which is the default
* as the coordinator has members which are used without synchronization.
*/
-public final class DataConnection extends StateMachine {
- private static final boolean DBG = true;
- private static final boolean VDBG = true;
+public class DataConnection extends StateMachine {
+ protected static final boolean DBG = true;
+ protected static final boolean VDBG = true;
/** Retry configuration: A doubling of retry times from 5secs to 30minutes */
private static final String DEFAULT_DATA_RETRY_CONFIG = "default_randomization=2000,"
@@ -107,25 +108,25 @@ public final class DataConnection extends StateMachine {
// The Tester for failing all bringup's
private DcTesterFailBringUpAll mDcTesterFailBringUpAll;
- private static AtomicInteger mInstanceNumber = new AtomicInteger(0);
+ protected static AtomicInteger mInstanceNumber = new AtomicInteger(0);
private AsyncChannel mAc;
// Utilities for the DataConnection
- private DcRetryAlarmController mDcRetryAlarmController;
+ protected DcRetryAlarmController mDcRetryAlarmController;
// The DCT that's talking to us, we only support one!
- private DcTrackerBase mDct = null;
+ protected DcTrackerBase mDct = null;
protected String[] mPcscfAddr;
- private ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();
+ protected ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();
/**
* Used internally for saving connecting parameters.
*/
- static class ConnectionParams {
+ public static class ConnectionParams {
int mTag;
- ApnContext mApnContext;
+ public ApnContext mApnContext;
int mInitialMaxRetry;
int mProfileId;
int mRilRat;
@@ -157,7 +158,7 @@ public final class DataConnection extends StateMachine {
/**
* Used internally for saving disconnecting parameters.
*/
- static class DisconnectParams {
+ public static class DisconnectParams {
int mTag;
ApnContext mApnContext;
String mReason;
@@ -182,7 +183,7 @@ public final class DataConnection extends StateMachine {
private DisconnectParams mDisconnectParams;
private DcFailCause mDcFailCause;
- private PhoneBase mPhone;
+ protected PhoneBase mPhone;
private LinkProperties mLinkProperties = new LinkProperties();
private long mCreateTime;
private long mLastFailTime;
@@ -195,7 +196,7 @@ public final class DataConnection extends StateMachine {
private NetworkAgent mNetworkAgent;
//***** Package visible variables
- int mTag;
+ protected int mTag;
int mCid;
HashMap<ApnContext, ConnectionParams> mApnContexts = null;
PendingIntent mReconnectIntent = null;
@@ -214,7 +215,7 @@ public final class DataConnection extends StateMachine {
static final int EVENT_DATA_STATE_CHANGED = BASE + 7;
static final int EVENT_TEAR_DOWN_NOW = BASE + 8;
static final int EVENT_LOST_CONNECTION = BASE + 9;
- static final int EVENT_RETRY_CONNECTION = BASE + 10;
+ protected static final int EVENT_RETRY_CONNECTION = BASE + 10;
static final int EVENT_DATA_CONNECTION_DRS_OR_RAT_CHANGED = BASE + 11;
static final int EVENT_DATA_CONNECTION_ROAM_ON = BASE + 12;
static final int EVENT_DATA_CONNECTION_ROAM_OFF = BASE + 13;
@@ -281,7 +282,7 @@ public final class DataConnection extends StateMachine {
return dc;
}
- void dispose() {
+ protected void dispose() {
log("dispose: call quiteNow()");
quitNow();
}
@@ -422,7 +423,7 @@ public final class DataConnection extends StateMachine {
}
//***** Constructor (NOTE: uses dcc.getHandler() as its Handler)
- private DataConnection(PhoneBase phone, String name, int id,
+ protected DataConnection(PhoneBase phone, String name, int id,
DcTrackerBase dct, DcTesterFailBringUpAll failBringUpAll,
DcController dcc) {
super(name, dcc.getHandler());
@@ -696,7 +697,7 @@ public final class DataConnection extends StateMachine {
*
* @param dp is the DisconnectParams.
*/
- private void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
+ protected void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
if (VDBG) log("NotifyDisconnectCompleted");
ApnContext alreadySent = null;
@@ -1619,7 +1620,7 @@ public final class DataConnection extends StateMachine {
return retVal;
}
}
- private DcRetryingState mRetryingState = new DcRetryingState();
+ protected DcRetryingState mRetryingState = new DcRetryingState();
/**
* The state machine is activating a connection.
@@ -1663,6 +1664,7 @@ public final class DataConnection extends StateMachine {
// All is well
mDcFailCause = DcFailCause.NONE;
transitionTo(mActiveState);
+ handlePdpRejectCauseSuccess();
break;
case ERR_BadCommand:
// Vendor ril rejected the command and didn't connect.
@@ -1693,6 +1695,10 @@ public final class DataConnection extends StateMachine {
+ " result.isPermanentFail=" +
mDct.isPermanentFail(result.mFailCause);
if (DBG) log(str);
+ boolean isHandled = isPdpRejectCauseFailureHandled(result, cp);
+ if (isHandled) {
+ break;
+ }
if (cp.mApnContext != null) cp.mApnContext.requestLog(str);
if (result.mFailCause.isRestartRadioFail() ||
(cp.mApnContext != null &&
@@ -2347,4 +2353,14 @@ public final class DataConnection extends StateMachine {
pw.println(" mDcRetryAlarmController=" + mDcRetryAlarmController);
pw.flush();
}
+
+ protected void handlePdpRejectCauseSuccess() {
+ if (DBG) log("handlePdpRejectCauseSuccess()");
+ }
+
+ protected boolean isPdpRejectCauseFailureHandled(DataCallResponse.SetupResult result,
+ ConnectionParams cp) {
+ if (DBG) log("isPdpRejectCauseFailureHandled()");
+ return false;
+ }
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcController.java b/src/java/com/android/internal/telephony/dataconnection/DcController.java
index 0aad0ddd8..543aad2a9 100644..100755
--- a/src/java/com/android/internal/telephony/dataconnection/DcController.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcController.java
@@ -48,7 +48,7 @@ import java.util.HashMap;
* multiple data connections. For instance listening for unsolicited messages
* and then demultiplexing them to the appropriate DC.
*/
-class DcController extends StateMachine {
+public class DcController extends StateMachine {
private static final boolean DBG = true;
private static final boolean VDBG = false;
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcFailCause.java b/src/java/com/android/internal/telephony/dataconnection/DcFailCause.java
index 4e0f879a5..c0692fb63 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcFailCause.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcFailCause.java
@@ -58,6 +58,8 @@ public enum DcFailCause {
RADIO_POWER_OFF(-5), /* no retry */
TETHERED_CALL_ACTIVE(-6), /* no retry */
ERROR_UNSPECIFIED(0xFFFF),
+ PDP_FAIL_IPV4_CALL_THROTTLED(-7),
+ PDP_FAIL_IPV6_CALL_THROTTLED(-8),
// Errors generated by the Framework
// specified here
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java b/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
index 763ceb762..59b872145 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcRetryAlarmController.java
@@ -44,6 +44,7 @@ public class DcRetryAlarmController {
private String mActionRetry;
private static final String INTENT_RETRY_ALARM_WHAT = "what";
private static final String INTENT_RETRY_ALARM_TAG = "tag";
+ private PendingIntent mRetryIntent = null;
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
@Override
@@ -109,7 +110,7 @@ public class DcRetryAlarmController {
* @param ar is the result from SETUP_DATA_CALL
* @return < 0 if no retry is needed otherwise the delay to the next SETUP_DATA_CALL
*/
- int getSuggestedRetryTime(DataConnection dc, AsyncResult ar) {
+ public int getSuggestedRetryTime(DataConnection dc, AsyncResult ar) {
int retryDelay;
DataCallResponse response = (DataCallResponse) ar.result;
@@ -147,10 +148,18 @@ public class DcRetryAlarmController {
" what=" + what + " tag=" + tag);
}
- PendingIntent retryIntent = PendingIntent.getBroadcast (mPhone.getContext(), 0,
+ mRetryIntent = PendingIntent.getBroadcast (mPhone.getContext(), 0,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP,
- SystemClock.elapsedRealtime() + delay, retryIntent);
+ SystemClock.elapsedRealtime() + delay, mRetryIntent);
+ }
+
+ public void cancel(){
+ if(mRetryIntent != null) {
+ if (DBG) log("cancel event: "+mRetryIntent);
+ mAlarmManager.cancel(mRetryIntent);
+ mRetryIntent = null;
+ }
}
@Override
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
index d1bca24f2..23faebd2a 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
@@ -1261,10 +1261,9 @@ public class DcTracker extends DcTrackerBase {
return apn;
}
- protected ArrayList<ApnSetting> createApnList(Cursor cursor) {
+ protected ArrayList<ApnSetting> createApnList(Cursor cursor, IccRecords r) {
ArrayList<ApnSetting> mnoApns = new ArrayList<ApnSetting>();
ArrayList<ApnSetting> mvnoApns = new ArrayList<ApnSetting>();
- IccRecords r = mIccRecords.get();
if (cursor.moveToFirst()) {
do {
@@ -1430,10 +1429,12 @@ public class DcTracker extends DcTrackerBase {
if (DBG) log("tryRestartDataConnections: createAllApnList and cleanUpAllConnections");
createAllApnList();
setInitialAttachApn();
- cleanUpConnectionsOnUpdatedApns(!isDisconnected);
-
+ if (reason.equalsIgnoreCase(Phone.REASON_APN_CHANGED)) {
+ cleanUpConnectionsOnUpdatedApns(!isDisconnected);
+ } else {
+ cleanUpAllConnections(!isDisconnected, reason);
+ }
// FIXME: See bug 17426028 maybe no conditional is needed.
- cleanUpAllConnections(!isDisconnected, reason);
setupDataOnConnectableApns(reason);
}
@@ -2414,7 +2415,7 @@ public class DcTracker extends DcTrackerBase {
if (cursor != null) {
if (cursor.getCount() > 0) {
- mAllApnSettings = createApnList(cursor);
+ mAllApnSettings = createApnList(cursor, mIccRecords.get());
}
cursor.close();
}
@@ -2434,7 +2435,7 @@ public class DcTracker extends DcTrackerBase {
// TODO: What is the right behavior?
//notifyNoData(DataConnection.FailCause.MISSING_UNKNOWN_APN);
} else {
- mPreferredApn = getPreferredApn();
+ mPreferredApn = getPreferredApn(mAllApnSettings);
if (mPreferredApn != null && !mPreferredApn.numeric.equals(operator)) {
mPreferredApn = null;
setPreferredApn(-1);
@@ -2599,7 +2600,7 @@ public class DcTracker extends DcTrackerBase {
}
/** Return the DC AsyncChannel for the new data connection */
- private DcAsyncChannel createDataConnection() {
+ protected DcAsyncChannel createDataConnection() {
if (DBG) log("createDataConnection E");
int id = mUniqueIdGenerator.getAndIncrement();
@@ -2662,7 +2663,7 @@ public class DcTracker extends DcTrackerBase {
usePreferred = true;
}
if (usePreferred) {
- mPreferredApn = getPreferredApn();
+ mPreferredApn = getPreferredApn(mAllApnSettings);
}
if (DBG) {
log("buildWaitingApns: usePreferred=" + usePreferred
@@ -2750,9 +2751,9 @@ public class DcTracker extends DcTrackerBase {
}
}
- protected ApnSetting getPreferredApn() {
- if (mAllApnSettings == null || mAllApnSettings.isEmpty()) {
- log("getPreferredApn: mAllApnSettings is " + ((mAllApnSettings == null)?"null":"empty"));
+ protected ApnSetting getPreferredApn(ArrayList<ApnSetting> apnList) {
+ if (apnList == null || apnList.isEmpty()) {
+ log("getPreferredApn: apnList is " + ((apnList == null)?"null":"empty"));
return null;
}
@@ -2774,7 +2775,7 @@ public class DcTracker extends DcTrackerBase {
int pos;
cursor.moveToFirst();
pos = cursor.getInt(cursor.getColumnIndexOrThrow(Telephony.Carriers._ID));
- for(ApnSetting p : mAllApnSettings) {
+ for(ApnSetting p : apnList) {
log("getPreferredApn: apnSetting=" + p);
if (p.id == pos && p.canHandleType(mRequestedApnType)) {
log("getPreferredApn: X found apnSetting" + p);
@@ -2961,7 +2962,7 @@ public class DcTracker extends DcTrackerBase {
return cid;
}
- private IccRecords getUiccRecords(int appFamily) {
+ protected IccRecords getUiccRecords(int appFamily) {
return mUiccController.getIccRecords(mPhone.getPhoneId(), appFamily);
}
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
index ee66d6e65..fcceb16f9 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTrackerBase.java
@@ -1781,18 +1781,23 @@ public abstract class DcTrackerBase extends Handler {
}
protected void setInitialAttachApn() {
+ setInitialAttachApn(mAllApnSettings, mPreferredApn);
+ }
+
+ protected void setInitialAttachApn(ArrayList <ApnSetting> apnList,
+ ApnSetting preferredApn) {
ApnSetting iaApnSetting = null;
ApnSetting defaultApnSetting = null;
ApnSetting firstApnSetting = null;
- log("setInitialApn: E mPreferredApn=" + mPreferredApn);
+ log("setInitialApn: E preferredApn=" + preferredApn);
- if (mAllApnSettings != null && !mAllApnSettings.isEmpty()) {
- firstApnSetting = mAllApnSettings.get(0);
+ if (apnList != null && !apnList.isEmpty()) {
+ firstApnSetting = apnList.get(0);
log("setInitialApn: firstApnSetting=" + firstApnSetting);
// Search for Initial APN setting and the first apn that can handle default
- for (ApnSetting apn : mAllApnSettings) {
+ for (ApnSetting apn : apnList) {
// Can't use apn.canHandleType(), as that returns true for APNs that have no type.
if (ArrayUtils.contains(apn.types, PhoneConstants.APN_TYPE_IA) &&
apn.carrierEnabled) {
@@ -1819,9 +1824,9 @@ public abstract class DcTrackerBase extends Handler {
if (iaApnSetting != null) {
if (DBG) log("setInitialAttachApn: using iaApnSetting");
initialAttachApnSetting = iaApnSetting;
- } else if (mPreferredApn != null) {
- if (DBG) log("setInitialAttachApn: using mPreferredApn");
- initialAttachApnSetting = mPreferredApn;
+ } else if (preferredApn != null) {
+ if (DBG) log("setInitialAttachApn: using preferredApn");
+ initialAttachApnSetting = preferredApn;
} else if (defaultApnSetting != null) {
if (DBG) log("setInitialAttachApn: using defaultApnSetting");
initialAttachApnSetting = defaultApnSetting;
diff --git a/src/java/com/android/internal/telephony/dataconnection/DctController.java b/src/java/com/android/internal/telephony/dataconnection/DctController.java
index 8b80d0de5..a0bfca571 100644
--- a/src/java/com/android/internal/telephony/dataconnection/DctController.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DctController.java
@@ -409,23 +409,6 @@ public class DctController extends Handler {
if (requestInfo.executedPhoneId != INVALID_PHONE_INDEX) continue;
if (getRequestPhoneId(requestInfo.request) == requestedPhoneId) {
mDcSwitchAsyncChannel[requestedPhoneId].connect(requestInfo);
- Phone phone = mPhones[requestedPhoneId].getActivePhone();
- if ((phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)
- && (activePhoneId == -1)) {
- /* Traditionally modem reports data registered on CDMA sub even when it is
- * non-dds because CDMA network does not have PS ATTACH/DETACH concept.
- *
- * So when CDMA sub becomes DDS from non-dds the state-machine is expacting
- * onDataConnectionAttach() call from serviceStateTracker. It would never
- * happen since cdma SST did not notice change in registration during DDS
- * switch.
- *
- * Hence we need to fake the ATTACH to move/progress DcSwitchStateMachine.
- */
- logd("Active phone is CDMA, fake ATTACH");
- mDcSwitchAsyncChannel[requestedPhoneId].notifyDataAttached();
- }
-
}
}
} else {
@@ -500,7 +483,7 @@ public class DctController extends Handler {
final int topPriPhone = getTopPriorityRequestPhoneId();
logd("onRetryAttach phoneId=" + phoneId + " topPri phone = " + topPriPhone);
- if (phoneId != INVALID_PHONE_INDEX && phoneId == topPriPhone) {
+ if (phoneId != -1 && phoneId == topPriPhone) {
mDcSwitchAsyncChannel[phoneId].retryConnect();
}
}
@@ -511,10 +494,25 @@ public class DctController extends Handler {
Iterator<Integer> iterator = mRequestInfos.keySet().iterator();
while (iterator.hasNext()) {
RequestInfo requestInfo = mRequestInfos.get(iterator.next());
- String specifier = requestInfo.request.networkCapabilities
- .getNetworkSpecifier();
- if (specifier == null || specifier.equals("")) {
- onReleaseRequest(requestInfo);
+ if (requestInfo != null) {
+ String specifier = requestInfo.request.networkCapabilities
+ .getNetworkSpecifier();
+ if (specifier == null || specifier.equals("")) {
+ if (requestInfo.executedPhoneId != INVALID_PHONE_INDEX) {
+ String apn = apnForNetworkRequest(requestInfo.request);
+ int phoneId = requestInfo.executedPhoneId;
+ requestInfo.executedPhoneId = INVALID_PHONE_INDEX;
+ logd("[setDataSubId] subId =" + dataSubId);
+ requestInfo.log(
+ "DctController.onSettingsChange releasing request");
+ for (int i = 0; i < mPhoneNum; i++) {
+ PhoneBase phoneBase =
+ (PhoneBase)mPhones[i].getActivePhone();
+ DcTrackerBase dcTracker = phoneBase.mDcTracker;
+ dcTracker.decApnRefCount(apn, requestInfo.getLog());
+ }
+ }
+ }
}
}
}
@@ -565,6 +563,7 @@ public class DctController extends Handler {
// that means there isn't a phone for the default sub
return INVALID_PHONE_INDEX;
}
+
return phoneId;
}
@@ -671,6 +670,12 @@ public class DctController extends Handler {
subId = Integer.parseInt(specifier);
}
int phoneId = mSubController.getPhoneId(subId);
+ if (!SubscriptionManager.isValidPhoneId(phoneId)) {
+ phoneId = 0;
+ if (!SubscriptionManager.isValidPhoneId(phoneId)) {
+ throw new RuntimeException("Should not happen, no valid phoneId");
+ }
+ }
return phoneId;
}
@@ -756,7 +761,6 @@ public class DctController extends Handler {
DcTrackerBase dcTracker =((PhoneBase)mPhone).mDcTracker;
String apn = apnForNetworkRequest(networkRequest);
if (dcTracker.isApnSupported(apn)) {
- requestNetwork(networkRequest, dcTracker.getApnPriority(apn), l);
} else {
final String str = "Unsupported APN";
log(str);
diff --git a/src/java/com/android/internal/telephony/gsm/CallFailCause.java b/src/java/com/android/internal/telephony/gsm/CallFailCause.java
index 8ef42b2a6..5861c4c62 100644
--- a/src/java/com/android/internal/telephony/gsm/CallFailCause.java
+++ b/src/java/com/android/internal/telephony/gsm/CallFailCause.java
@@ -63,6 +63,7 @@ public interface CallFailCause {
static final int CALL_FAIL_NO_ANSWER_FROM_USER = 19;
static final int CALL_REJECTED = 21;
static final int PREEMPTION = 25;
+ static final int NON_SELECTED_USER_CLEARING = 26;
static final int CALL_FAIL_DESTINATION_OUT_OF_ORDER = 27;
static final int INVALID_NUMBER = 28;
static final int FACILITY_REJECTED = 29;
diff --git a/src/java/com/android/internal/telephony/gsm/GSMPhone.java b/src/java/com/android/internal/telephony/gsm/GSMPhone.java
index 82ae9f49d..a20054d0b 100644
--- a/src/java/com/android/internal/telephony/gsm/GSMPhone.java
+++ b/src/java/com/android/internal/telephony/gsm/GSMPhone.java
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
import com.android.internal.telephony.CallTracker;
import com.android.internal.telephony.ConfigResourceUtil;
+import com.android.internal.telephony.PhoneFactory;
import android.text.TextUtils;
import android.telephony.Rlog;
@@ -156,7 +157,7 @@ public class GSMPhone extends PhoneBase {
mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM);
mCT = new GsmCallTracker(this);
- mSST = new GsmServiceStateTracker(this);
+ mSST = TelephonyPluginDelegate.getInstance().makeGsmServiceStateTracker(this);
mDcTracker = TelephonyPluginDelegate.getInstance().makeDcTracker(this);
if (!unitTestMode) {
@@ -172,6 +173,7 @@ public class GSMPhone extends PhoneBase {
mSST.registerForNetworkAttached(this, EVENT_REGISTERED_TO_NETWORK, null);
mCi.setOnSs(this, EVENT_SS, null);
setProperties();
+ notifyPhoneStateChanged();
}
public
@@ -191,7 +193,7 @@ public class GSMPhone extends PhoneBase {
mCi.setPhoneType(PhoneConstants.PHONE_TYPE_GSM);
mCT = new GsmCallTracker(this);
- mSST = new GsmServiceStateTracker(this);
+ mSST = TelephonyPluginDelegate.getInstance().makeGsmServiceStateTracker(this);
mDcTracker = TelephonyPluginDelegate.getInstance().makeDcTracker(this);
if (!unitTestMode) {
@@ -211,6 +213,7 @@ public class GSMPhone extends PhoneBase {
log("GSMPhone: constructor: sub = " + mPhoneId);
setProperties();
+ notifyPhoneStateChanged();
}
protected void setProperties() {
@@ -328,14 +331,16 @@ public class GSMPhone extends PhoneBase {
}
public boolean getCallForwardingIndicator() {
- boolean cf = false;
- IccRecords r = mIccRecords.get();
+ int callForwardingIndicator = IccRecords.CALL_FORWARDING_STATUS_UNKNOWN;
+ IccRecords r = getIccRecords();
if (r != null && r.isCallForwardStatusStored()) {
- cf = r.getVoiceCallForwardingFlag() == IccRecords.CALL_FORWARDING_STATUS_ENABLED;
- } else {
- cf = getCallForwardingPreference();
+ callForwardingIndicator = r.getVoiceCallForwardingFlag();
}
- return cf;
+
+ if (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_UNKNOWN) {
+ callForwardingIndicator = getVoiceCallForwardingFlag();
+ }
+ return (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_ENABLED);
}
@Override
@@ -1293,9 +1298,6 @@ public class GSMPhone extends PhoneBase {
obtainMessage(EVENT_SET_CLIR_COMPLETE, commandInterfaceCLIRMode, 0, onComplete));
return;
}
- // Packing CLIR value in the message. This will be required for
- // SharedPreference caching, if the message comes back as part of
- // a success response.
mCi.setCLIR(commandInterfaceCLIRMode,
obtainMessage(EVENT_SET_CLIR_COMPLETE, commandInterfaceCLIRMode, 0, onComplete));
}
@@ -1892,9 +1894,7 @@ public class GSMPhone extends PhoneBase {
int nwMode = Phone.PREFERRED_NT_MODE;
int subId = getSubId();
- nwMode = android.provider.Settings.Global.getInt(mContext.getContentResolver(),
- android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId, nwMode);
-
+ nwMode = PhoneFactory.calculatePreferredNetworkType(mContext, subId);
Rlog.d(LOG_TAG, "isManualNetSelAllowed in mode = " + nwMode);
/*
* For multimode targets in global mode manual network
diff --git a/src/java/com/android/internal/telephony/gsm/GsmCallTracker.java b/src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
index 42b1a16b7..177b16ed6 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
@@ -933,7 +933,7 @@ public final class GsmCallTracker extends CallTracker {
if (ar.exception != null) {
mPhone.notifySuppServiceFailed(getFailedService(msg.what));
List<Connection> conn = mForegroundCall.getConnections();
- if (conn != null) {
+ if (conn.size() != 0) {
Rlog.d(LOG_TAG, "Notify merge failure");
conn.get(0).onConferenceMergeFailed();
}
diff --git a/src/java/com/android/internal/telephony/gsm/GsmConnection.java b/src/java/com/android/internal/telephony/gsm/GsmConnection.java
index 1bb77f156..587bd3679 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmConnection.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmConnection.java
@@ -489,6 +489,9 @@ public class GsmConnection extends Connection {
case CallFailCause.EMERGENCY_PERM_FAILURE:
return DisconnectCause.EMERGENCY_PERM_FAILURE;
+ case CallFailCause.NON_SELECTED_USER_CLEARING:
+ return DisconnectCause.NON_SELECTED_USER_CLEARING;
+
case CallFailCause.ERROR_UNSPECIFIED:
case CallFailCause.NORMAL_CLEARING:
default:
diff --git a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
index a02b7b2ad..206089faa 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
@@ -1089,10 +1089,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
*/
if ((ar.exception == null) && (msg.arg1 == 1)) {
boolean cffEnabled = (msg.arg2 == 1);
- if (mIccRecords != null) {
- mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
- mPhone.setCallForwardingPreference(cffEnabled);
- }
+ mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
+ mPhone.setCallForwardingPreference(cffEnabled);
}
onSetComplete(msg, ar);
@@ -1449,10 +1447,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
(info.serviceClass & serviceClassMask)
== CommandsInterface.SERVICE_CLASS_VOICE) {
boolean cffEnabled = (info.status == 1);
- if (mIccRecords != null) {
- mPhone.setVoiceCallForwardingFlag(1, cffEnabled, info.number);
- mPhone.setCallForwardingPreference(cffEnabled);
- }
+ mPhone.setVoiceCallForwardingFlag(1, cffEnabled, info.number);
+ mPhone.setCallForwardingPreference(cffEnabled);
}
return TextUtils.replace(template, sources, destinations);
@@ -1484,10 +1480,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
sb.append(mContext.getText(com.android.internal.R.string.serviceDisabled));
// Set unconditional CFF in SIM to false
- if (mIccRecords != null) {
- mPhone.setCallForwardingPreference(false);
- mPhone.setVoiceCallForwardingFlag(1, false, null);
- }
+ mPhone.setCallForwardingPreference(false);
+ mPhone.setVoiceCallForwardingFlag(1, false, null);
} else {
SpannableStringBuilder tb = new SpannableStringBuilder();
diff --git a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index dfe7614cb..7334f76ab 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -91,20 +91,20 @@ import java.util.TimeZone;
/**
* {@hide}
*/
-final class GsmServiceStateTracker extends ServiceStateTracker {
+public class GsmServiceStateTracker extends ServiceStateTracker {
static final String LOG_TAG = "GsmSST";
static final boolean VDBG = false;
//CAF_MSIM make it private ??
private static final int EVENT_ALL_DATA_DISCONNECTED = 1001;
- private GSMPhone mPhone;
- GsmCellLocation mCellLoc;
- GsmCellLocation mNewCellLoc;
+ protected GSMPhone mPhone;
+ protected GsmCellLocation mCellLoc;
+ protected GsmCellLocation mNewCellLoc;
int mPreferredNetworkType;
private int mMaxDataCalls = 1;
- private int mNewMaxDataCalls = 1;
+ protected int mNewMaxDataCalls = 1;
private int mReasonDataDenied = -1;
- private int mNewReasonDataDenied = -1;
+ protected int mNewReasonDataDenied = -1;
private static final String ACTION_MANAGED_ROAMING_IND =
"codeaurora.intent.action.ACTION_MANAGED_ROAMING_IND";
@@ -119,12 +119,12 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
* Data roaming status solely based on TS 27.007 10.1.19 CGREG. Only used by
* handlePollStateResult to store CGREG roaming result.
*/
- private boolean mDataRoaming = false;
+ protected boolean mDataRoaming = false;
/**
* Mark when service state is in emergency call only mode
*/
- private boolean mEmergencyOnly = false;
+ protected boolean mEmergencyOnly = false;
/**
* Sometimes we get the NITZ time before we know what country we
@@ -1061,7 +1061,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
}
}
- private void pollStateDone() {
+ protected void pollStateDone() {
if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean(PROP_FORCE_ROAMING, false)) {
mNewSS.setVoiceRoaming(true);
mNewSS.setDataRoaming(true);
@@ -1552,7 +1552,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
}
/** code is registration state 0-5 from TS 27.007 7.2 */
- private int regCodeToServiceState(int code) {
+ protected int regCodeToServiceState(int code) {
switch (code) {
case 0:
case 2: // 2 is "searching"
@@ -1582,7 +1582,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
* code is registration state 0-5 from TS 27.007 7.2
* returns true if registered roam, false otherwise
*/
- private boolean regCodeIsRoaming (int code) {
+ protected boolean regCodeIsRoaming (int code) {
return ServiceState.RIL_REG_STATE_ROAMING == code;
}
diff --git a/src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java b/src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
index da7f33ecd..d41f4c41a 100644
--- a/src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
+++ b/src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
@@ -149,6 +149,10 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {
mRefreshCache = false;
}
+ public boolean isPbrFilePresent() {
+ return mIsPbrPresent;
+ }
+
public ArrayList<AdnRecord> loadEfFilesFromUsim() {
synchronized (mLock) {
if (!mPhoneBookRecords.isEmpty()) {
@@ -947,6 +951,8 @@ public class UsimPhoneBookManager extends Handler implements IccConstants {
ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
createPbrFile((ArrayList<byte[]>) ar.result);
+ } else {
+ mIsPbrPresent = false;
}
synchronized (mLock) {
mLock.notify();
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
index 822b6b4ea..17ee5f0c9 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java
@@ -149,7 +149,7 @@ public class ImsPhone extends ImsPhoneBase {
private boolean mImsRegistered = false;
// List of Registrants to send supplementary service notifications to.
- RegistrantList mSsnRegistrants = new RegistrantList();
+ private RegistrantList mSsnRegistrants = new RegistrantList();
// A runnable which is used to automatically exit from Ecm after a period of time.
private Runnable mExitEcmRunnable = new Runnable() {
@@ -265,14 +265,16 @@ public class ImsPhone extends ImsPhoneBase {
}
public boolean getCallForwardingIndicator() {
- boolean cf = false;
+ int callForwardingIndicator = IccRecords.CALL_FORWARDING_STATUS_UNKNOWN;
IccRecords r = getIccRecords();
if (r != null && r.isCallForwardStatusStored()) {
- cf = r.getVoiceCallForwardingFlag() == IccRecords.CALL_FORWARDING_STATUS_ENABLED;
- } else {
- cf = getCallForwardingPreference();
+ callForwardingIndicator = r.getVoiceCallForwardingFlag();
+ }
+
+ if (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_UNKNOWN) {
+ callForwardingIndicator = getVoiceCallForwardingFlag();
}
- return cf;
+ return (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_ENABLED);
}
/**
@@ -1153,7 +1155,8 @@ public class ImsPhone extends ImsPhoneBase {
}
@Override
- public void registerForSuppServiceNotification(Handler h, int what, Object obj) {
+ public void registerForSuppServiceNotification(
+ Handler h, int what, Object obj) {
mSsnRegistrants.addUnique(h, what, obj);
}
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
index 8fe2880ee..652749d10 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
@@ -90,7 +90,7 @@ public final class ImsPhoneCallTracker extends CallTracker {
//Indices map to ImsConfig.FeatureConstants
private boolean[] mImsFeatureEnabled = {false, false, false, false, false, false};
private final String[] mImsFeatureStrings = {"VoLTE", "ViLTE", "VoWiFi", "ViWiFi",
- "UTLTE", "UTWiFi"};
+ "UtLTE", "UtWiFi"};
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
@@ -1409,24 +1409,15 @@ public final class ImsPhoneCallTracker extends CallTracker {
}
foregroundImsPhoneCall.merge(peerImsPhoneCall, ImsPhoneCall.State.ACTIVE);
- // TODO Temporary code. Remove the try-catch block from the runnable once thread
- // synchronization is fixed.
- Runnable r = new Runnable() {
- @Override
- public void run() {
- try {
- final ImsPhoneConnection conn = findConnection(call);
- log("onCallMerged: ImsPhoneConnection=" + conn);
- log("onCallMerged: CurrentVideoProvider=" + conn.getVideoProvider());
- setVideoCallProvider(conn, call);
- log("onCallMerged: CurrentVideoProvider=" + conn.getVideoProvider());
- } catch (Exception e) {
- loge("onCallMerged: exception " + e);
- }
- }
- };
-
- ImsPhoneCallTracker.this.post(r);
+ try {
+ final ImsPhoneConnection conn = findConnection(call);
+ log("onCallMerged: ImsPhoneConnection=" + conn);
+ log("onCallMerged: CurrentVideoProvider=" + conn.getVideoProvider());
+ setVideoCallProvider(conn, call);
+ log("onCallMerged: CurrentVideoProvider=" + conn.getVideoProvider());
+ } catch (Exception e) {
+ loge("onCallMerged: exception " + e);
+ }
// After merge complete, update foreground as Active
// and background call as Held, if background call exists
@@ -1461,7 +1452,7 @@ public final class ImsPhoneCallTracker extends CallTracker {
// Start plumbing this even through Telecom so other components can take
// appropriate action.
- ImsPhoneConnection conn = findConnection(call);
+ ImsPhoneConnection conn = findConnection(mForegroundCall.getImsCall());
if (conn != null) {
conn.onConferenceMergeFailed();
}
@@ -1764,7 +1755,6 @@ public final class ImsPhoneCallTracker extends CallTracker {
}
break;
case EVENT_DIAL_PENDINGMO:
- dialInternal(mPendingMO, mClirMode, mPendingCallVideoState, mPendingIntentExtras);
mPendingIntentExtras = null;
break;
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java
index 34b203767..69f826558 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneMmiCode.java
@@ -1048,10 +1048,8 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
*/
if ((ar.exception == null) && (msg.arg1 == 1)) {
boolean cffEnabled = (msg.arg2 == 1);
- if (mIccRecords != null) {
- mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
- mPhone.setCallForwardingPreference(cffEnabled);
- }
+ mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
+ mPhone.setCallForwardingPreference(cffEnabled);
}
onSetComplete(msg, ar);
@@ -1302,11 +1300,9 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
(info.serviceClass & serviceClassMask)
== CommandsInterface.SERVICE_CLASS_VOICE) {
boolean cffEnabled = (info.status == 1);
- if (mIccRecords != null) {
- mPhone.setVoiceCallForwardingFlag(1, cffEnabled, info.number);
- Rlog.d(LOG_TAG, "makeCFQueryResultMessage cffEnabled = "+cffEnabled);
- mPhone.setCallForwardingPreference(cffEnabled);
- }
+ mPhone.setVoiceCallForwardingFlag(1, cffEnabled, info.number);
+ Rlog.d(LOG_TAG, "makeCFQueryResultMessage cffEnabled = "+cffEnabled);
+ mPhone.setCallForwardingPreference(cffEnabled);
}
return TextUtils.replace(template, sources, destinations);
@@ -1342,10 +1338,8 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
sb.append(mContext.getText(com.android.internal.R.string.serviceDisabled));
// Set unconditional CFF in SIM to false
- if (mIccRecords != null) {
- mPhone.setCallForwardingPreference(false);
- mPhone.setVoiceCallForwardingFlag(1, false, null);
- }
+ mPhone.setCallForwardingPreference(false);
+ mPhone.setVoiceCallForwardingFlag(1, false, null);
} else {
SpannableStringBuilder tb = new SpannableStringBuilder();
diff --git a/src/java/com/android/internal/telephony/uicc/AdnRecordCache.java b/src/java/com/android/internal/telephony/uicc/AdnRecordCache.java
index 3d3f855fc..862368f85 100644
--- a/src/java/com/android/internal/telephony/uicc/AdnRecordCache.java
+++ b/src/java/com/android/internal/telephony/uicc/AdnRecordCache.java
@@ -156,10 +156,12 @@ public final class AdnRecordCache extends Handler implements IccConstants {
/* Find the free EXT1 record in the EXT1 file */
private int findFreeExtRec(int extensionEf) {
int[] extRec = extRecList.get(extensionEf);
- for (int i = 0; i < extRec.length; i++) {
- if (extRec[i] == 0) {
- Rlog.d(LOG_TAG, "Free record found: " +(i+1));
- return (i+1);
+ if (extRec != null) {
+ for (int i = 0; i < extRec.length; i++) {
+ if (extRec[i] == 0) {
+ Rlog.d(LOG_TAG, "Free record found: " +(i+1));
+ return (i+1);
+ }
}
}
@@ -333,7 +335,7 @@ public final class AdnRecordCache extends Handler implements IccConstants {
} else {
mUserWriteResponse.put(efid, response);
new AdnRecordLoader(mFh).updateEF(newAdn, efid, extensionEF,
- index, pin2,
+ index, pin2, findFreeExtRec(extensionEF),
obtainMessage(EVENT_UPDATE_ADN_DONE, efid, index, newAdn));
}
@@ -353,6 +355,10 @@ public final class AdnRecordCache extends Handler implements IccConstants {
useLocalPb ? mUsimLocalPhoneBookManager : mUsimGlobalPhoneBookManager;
}
+ public boolean isPbrPresent() {
+ return (mUsimGlobalPhoneBookManager.isPbrFilePresent() ||
+ mUsimLocalPhoneBookManager.isPbrFilePresent());
+ }
/**
* Responds with exception (in response) if efid is not a known ADN-like
@@ -485,7 +491,8 @@ public final class AdnRecordCache extends Handler implements IccConstants {
mUsimPhoneBookManager.loadEfFilesFromUsim().set(index - 1, adn);
}
if (adn != null && adn.hasExtendedRecord()
- && adn.mExtRecord > 0) {
+ && adn.mExtRecord > 0
+ && extRecList.get(extensionEf) != null) {
extRecList.get(extensionEf)[adn.mExtRecord - 1] = 1;
}
}
diff --git a/src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java b/src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java
index 3c900c73a..ca658aee3 100644
--- a/src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java
+++ b/src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java
@@ -43,7 +43,7 @@ public class AdnRecordLoader extends Handler {
// For "load one"
int mRecordNumber;
- int mNumExtRec;
+ int mNumExtRec = -1;
// for "load all"
ArrayList<AdnRecord> mAdns; // only valid after EVENT_ADN_LOAD_ALL_DONE
@@ -208,7 +208,7 @@ public class AdnRecordLoader extends Handler {
handleMessage(Message msg) {
AsyncResult ar;
byte data[];
- int[] extRecord;
+ int[] extRecord = null;
AdnRecord adn;
try {
@@ -252,21 +252,20 @@ public class AdnRecordLoader extends Handler {
String path = (String)(ar.userObj);
if (ar.exception != null) {
- throw new RuntimeException("get EF record size failed",
- ar.exception);
- }
-
- int[] extRecordSize = (int[])ar.result;
- // extRecordSize is int[3] array
- // int[0] is the record length
- // int[1] is the total length of the EF file
- // int[2] is the number of records in the EF file
- // So int[0] * int[2] = int[1]
- if (extRecordSize.length != 3) {
- throw new RuntimeException("get wrong EF record size format",
- ar.exception);
+ Rlog.d(LOG_TAG, "Exception occured while fetching record size for EFEXT1");
+ } else {
+ int[] extRecordSize = (int[])ar.result;
+ // extRecordSize is int[3] array
+ // int[0] is the record length
+ // int[1] is the total length of the EF file
+ // int[2] is the number of records in the EF file
+ // So int[0] * int[2] = int[1]
+ if (extRecordSize.length != 3) {
+ throw new RuntimeException("get wrong EF record size format",
+ ar.exception);
+ }
+ mNumExtRec = extRecordSize[2]; //Number of EXT records.
}
- mNumExtRec = extRecordSize[2]; //Number of EXT records.
mPendingExtLoads = 1;
/* If we are loading from EF_ADN, specifically
@@ -373,12 +372,14 @@ public class AdnRecordLoader extends Handler {
mPendingExtLoads = 0;
// extRecord has the details of used/free EXT1 records.
- extRecord = new int[mNumExtRec];
- for (int i = 0; i < mNumExtRec; i++) {
- extRecord[i] = 0;
+ if (mNumExtRec != -1) {
+ extRecord = new int[mNumExtRec];
+ for (int i = 0; i < mNumExtRec; i++) {
+ extRecord[i] = 0;
+ }
}
- for(int i = 0, s = datas.size() ; i < s ; i++) {
+ for (int i = 0, s = datas.size() ; i < s ; i++) {
adn = new AdnRecord(mEf, 1 + i, datas.get(i));
mAdns.add(adn);
diff --git a/src/java/com/android/internal/telephony/uicc/CsimFileHandler.java b/src/java/com/android/internal/telephony/uicc/CsimFileHandler.java
index 38cc250eb..186adaebd 100644
--- a/src/java/com/android/internal/telephony/uicc/CsimFileHandler.java
+++ b/src/java/com/android/internal/telephony/uicc/CsimFileHandler.java
@@ -44,8 +44,12 @@ public final class CsimFileHandler extends IccFileHandler implements IccConstant
case EF_CSIM_IMSIM:
case EF_CSIM_CDMAHOME:
case EF_CSIM_EPRL:
+ case EF_CSIM_PRL:
case EF_CSIM_MIPUPP:
return MF_SIM + DF_ADF;
+ case EF_CSIM_MSPL:
+ case EF_CSIM_MLPL:
+ return MF_SIM + DF_TELECOM + DF_MMSS;
}
String path = getCommonIccEFPath(efid);
if (path == null) {
diff --git a/src/java/com/android/internal/telephony/uicc/IccConstants.java b/src/java/com/android/internal/telephony/uicc/IccConstants.java
index 527678ba2..8ef7a83f3 100644
--- a/src/java/com/android/internal/telephony/uicc/IccConstants.java
+++ b/src/java/com/android/internal/telephony/uicc/IccConstants.java
@@ -73,6 +73,10 @@ public interface IccConstants {
static final int EF_CSIM_IMSIM = 0x6F22;
static final int EF_CSIM_CDMAHOME = 0x6F28;
static final int EF_CSIM_EPRL = 0x6F5A;
+ static final int EF_CSIM_PRL = 0x6F30;
+ // C.S0074-Av1.0 Section 4
+ static final int EF_CSIM_MLPL = 0x4F20;
+ static final int EF_CSIM_MSPL = 0x4F21;
static final int EF_CSIM_MIPUPP = 0x6F4D;
//ISIM access
@@ -97,6 +101,7 @@ public interface IccConstants {
static final String DF_GRAPHICS = "5F50";
static final String DF_GSM = "7F20";
static final String DF_CDMA = "7F25";
+ static final String DF_MMSS = "5F3C";
//UICC access
static final String DF_ADF = "7FFF";
diff --git a/src/java/com/android/internal/telephony/uicc/RuimFileHandler.java b/src/java/com/android/internal/telephony/uicc/RuimFileHandler.java
index 58e939fa0..58d72cac9 100644
--- a/src/java/com/android/internal/telephony/uicc/RuimFileHandler.java
+++ b/src/java/com/android/internal/telephony/uicc/RuimFileHandler.java
@@ -64,8 +64,12 @@ public final class RuimFileHandler extends IccFileHandler {
case EF_CSIM_IMSIM:
case EF_CSIM_CDMAHOME:
case EF_CSIM_EPRL:
+ case EF_CSIM_PRL:
case EF_CSIM_MIPUPP:
return MF_SIM + DF_CDMA;
+ case EF_CSIM_MSPL:
+ case EF_CSIM_MLPL:
+ return MF_SIM + DF_TELECOM + DF_MMSS;
}
return getCommonIccEFPath(efid);
}
diff --git a/src/java/com/android/internal/telephony/uicc/UiccCardApplication.java b/src/java/com/android/internal/telephony/uicc/UiccCardApplication.java
index 4e09badba..f38167e89 100644
--- a/src/java/com/android/internal/telephony/uicc/UiccCardApplication.java
+++ b/src/java/com/android/internal/telephony/uicc/UiccCardApplication.java
@@ -26,6 +26,7 @@ import android.telephony.Rlog;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.telephony.TelephonyPluginDelegate;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState;
@@ -179,7 +180,7 @@ public class UiccCardApplication {
private IccRecords createIccRecords(AppType type, Context c, CommandsInterface ci) {
if (type == AppType.APPTYPE_USIM || type == AppType.APPTYPE_SIM) {
- return new SIMRecords(this, c, ci);
+ return TelephonyPluginDelegate.getInstance().makeSIMRecords(this, c, ci);
} else if (type == AppType.APPTYPE_RUIM || type == AppType.APPTYPE_CSIM){
return new RuimRecords(this, c, ci);
} else if (type == AppType.APPTYPE_ISIM) {
diff --git a/src/java/org/codeaurora/QtiVideoCallConstants.java b/src/java/org/codeaurora/QtiVideoCallConstants.java
index b643ea939..a1a06eaf4 100644
--- a/src/java/org/codeaurora/QtiVideoCallConstants.java
+++ b/src/java/org/codeaurora/QtiVideoCallConstants.java
@@ -104,6 +104,16 @@ public class QtiVideoCallConstants {
public static final int DOMAIN_PS = 2;
/**
+ * Call supplementary services failures.
+ * TODO: Rename the file to QtiCallConstants.java as generic IMS constants are added. This
+ * will be handled when we move the file to vendor/codeaurora/telephony project.
+ */
+ public static final int ERROR_CALL_CODE_UNSPECIFIED = -1;
+ public static final int ERROR_CALL_SUPP_SVC_FAILED = 1;
+ public static final int ERROR_CALL_SUPP_SVC_CANCELLED = 2;
+ public static final int ERROR_CALL_SUPP_SVC_REINVITE_COLLISION = 3;
+
+ /**
* Private constructor. This class should not be instantiated.
*/
private QtiVideoCallConstants() {
@@ -159,5 +169,20 @@ public class QtiVideoCallConstants {
/* Session modification cause extra key name */
public static final String SESSION_MODIFICATION_CAUSE_EXTRA_KEY = "SessionModificationCause";
+
+ /**
+ * Local device supports downgrade to voice
+ */
+ public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL = 0x00800000;
+
+ /**
+ * Remote device supports downgrade to voice
+ */
+ public static final int CAPABILITY_SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE = 0x01000000;
+
+ /**
+ * Add participant in an active or conference call option
+ */
+ public static final int CAPABILITY_ADD_PARTICIPANT = 0x02000000;
}
diff --git a/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceListenerBaseImpl.java b/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceListenerBaseImpl.java
new file mode 100644
index 000000000..c93e2f924
--- /dev/null
+++ b/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceListenerBaseImpl.java
@@ -0,0 +1,83 @@
+/**
+ * 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 org.codeaurora.ims.qtiims;
+
+import android.telephony.Rlog;
+
+/**
+ * This class contains default implementation for IQtiImsInterfaceListener.
+ */
+public class QtiImsInterfaceListenerBaseImpl extends IQtiImsInterfaceListener.Stub {
+
+ private static String LOG_TAG = "QtiImsInterfaceListenerBaseImpl";
+
+ @Override
+ public void onSetCallForwardUncondTimer(int status) {
+ logUnexpectedQtiImsListenerCall("onSetCallForwardUncondTimer");
+ }
+
+ @Override
+ public void onGetCallForwardUncondTimer(int startHour, int endHour, int startMinute,
+ int endMinute, int reason, int status, String number, int service) {
+ logUnexpectedQtiImsListenerCall("onGetCallForwardUncondTimer");
+ }
+
+ @Override
+ public void onUTReqFailed(int errCode, String errString) {
+ logUnexpectedQtiImsListenerCall("onUTReqFailed");
+ }
+
+ @Override
+ public void onGetPacketCount(int status, long packetCount) {
+ logUnexpectedQtiImsListenerCall("onGetPacketCount");
+ }
+
+ @Override
+ public void onGetPacketErrorCount(int status, long packetErrorCount) {
+ logUnexpectedQtiImsListenerCall("onGetPacketErrorCount");
+ }
+
+ @Override
+ public void receiveCallDeflectResponse(int result) {
+ logUnexpectedQtiImsListenerCall("receiveCallDeflectResponse");
+ }
+
+ @Override
+ public void notifyRefreshViceInfo(QtiViceInfo viceInfo) {
+ logUnexpectedQtiImsListenerCall("notifyRefreshViceInfo");
+ }
+
+ private static void logUnexpectedQtiImsListenerCall(String name)
+ {
+ Rlog.e(LOG_TAG, "Error! " + name + "() in QtiImsInterfaceListener should not be " +
+ "called, Default Implementation.");
+ }
+}
+
diff --git a/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceUtils.java b/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceUtils.java
index f704ae581..de017dcd3 100644
--- a/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceUtils.java
+++ b/src/java/org/codeaurora/ims/qtiims/QtiImsInterfaceUtils.java
@@ -41,8 +41,8 @@ public class QtiImsInterfaceUtils {
public static final String QTI_IMS_CALL_DEFLECT_NUMBER =
"ims_call_deflect_number";
- /* Call deflect extra key name */
- public static final String QTI_IMS_DEFLECT_EXTRA_KEY = "Deflect";
+ /* Call deflect setting name */
+ public static final String QTI_IMS_DEFLECT_ENABLED = "qti.ims.call_deflect";
/* Default success value */
public static final int QTI_IMS_REQUEST_SUCCESS = 0;
diff --git a/src/java/org/codeaurora/ims/qtiims/QtiViceInfo.java b/src/java/org/codeaurora/ims/qtiims/QtiViceInfo.java
index 0ac90d5d3..1436c1733 100644
--- a/src/java/org/codeaurora/ims/qtiims/QtiViceInfo.java
+++ b/src/java/org/codeaurora/ims/qtiims/QtiViceInfo.java
@@ -32,6 +32,10 @@ package org.codeaurora.ims.qtiims;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.Rlog;
+
+import java.util.ArrayList;
+import java.util.List;
/*
* This file contains all the api's through which
@@ -46,7 +50,37 @@ import android.os.Parcelable;
public class QtiViceInfo implements Parcelable {
+ private static final String TAG = "QtiViceInfo";
private String mViceInfoAsString = null;
+ public int dialogSize = 0;
+ public static List<String[]> callInfo;
+
+ public static final int INDEX_DIALOG_ID = 0;
+ public static final int INDEX_NUMBER = 1;
+ public static final int INDEX_ISPULLABLE = 2;
+ public static final int INDEX_CALLTYPE = 3;
+ public static final int INDEX_DIRECTION = 4;
+ // INDEX Values listed above + 1 for the array to hold it
+ public static final int INDEX_MAX = 5;
+
+ // Strings/values that are part in DEP XML
+ public static final String STATE_TERMINATED = "terminated";
+ public static final String STATE_CONFIRMED = "confirmed";
+ public static final String MEDIA_TYPE_AUDIO = "audio";
+ public static final String MEDIA_TYPE_VIDEO = "video";
+ public static final String MEDIA_DIRECTION_SENDRECV = "sendrecv";
+ public static final String MEDIA_DIRECTION_SENDONLY = "sendonly";
+ public static final String MEDIA_DIRECTION_RECVONLY = "recvonly";
+ public static final String MEDIA_DIRECTION_INACTIVE = "inactive";
+
+ // Translated values after processing the media attributes
+ public static final String CALL_TYPE_VOICE_ACTIVE = "volteactive";
+ public static final String CALL_TYPE_VOICE_HELD = "volteheld";
+ public static final String CALL_TYPE_VIDEO_TX_RX = "vttxrx";
+ public static final String CALL_TYPE_VIDEO_TX = "vttx";
+ public static final String CALL_TYPE_VIDEO_RX = "vtrx";
+ public static final String CALL_TYPE_VIDEO_HELD = "vtheld";
+
public QtiViceInfo() {
}
@@ -55,8 +89,27 @@ public class QtiViceInfo implements Parcelable {
readFromParcel(in);
}
+ /**
+ * dialogIds Will have following information -
+ * dialogIds[INDEX_DIALOG_ID] - Holds Unique DialogId
+ * dialogIds[INDEX_NUMBER] - Holds number/uri
+ * dialogIds[INDEX_ISPULLABLE] - Pullable/NonPullable (true, false)
+ * dialogIds[INDEX_CALLTYPE] - CallType
+ * CallType - volteactive, volteheld, vttxrx, vttx, vtrx, vtheld
+ * dialogIds[INDEX_DIRECTION] - Direction of the call (Originator/recipent)
+ */
+ public QtiViceInfo(List<String[]> dialogIds) {
+ if (dialogIds != null) {
+ callInfo = new ArrayList<String[]>();
+ dialogSize = dialogIds.size();
+ callInfo = dialogIds;
+ Rlog.d(TAG,"QtiViceInfo const = " + toString());
+ }
+ }
+
public void setViceDialogInfoAsString(String value) {
mViceInfoAsString = value;
+ Rlog.d(TAG,"setViceDialogInfoAsString XML String = " + mViceInfoAsString);
}
public String getViceDialogInfoAsString() {
@@ -69,12 +122,53 @@ public class QtiViceInfo implements Parcelable {
}
private void readFromParcel(Parcel in) {
+ dialogSize = in.readInt();
+ Rlog.d(TAG, "readFromParcel size = " + dialogSize);
+ if (dialogSize < 0) {
+ return;
+ }
+ callInfo = new ArrayList<String[]>();
+ for (int i = 0; i < dialogSize; i++) {
+ String[] info = new String[INDEX_MAX];
+ info = in.createStringArray(); // read each string[]
+ callInfo.add(info);
+ }
+ Rlog.d(TAG, "readFromParcel - " + toString());
+ }
+ public String toString() {
+ if (callInfo != null) {
+ Rlog.d(TAG, "mCallInfo size = " + dialogSize);
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < dialogSize; i++) {
+ String[] callinfo = callInfo.get(i);
+ sb.append("QtiViceInfo :");
+ sb.append("DialogId - ");
+ sb.append(callinfo[INDEX_DIALOG_ID]);
+ sb.append("Number - ");
+ sb.append(callinfo[INDEX_NUMBER]);
+ sb.append("IsPullable - ");
+ sb.append(callinfo[INDEX_ISPULLABLE]);
+ sb.append("CallType - ");
+ sb.append(callinfo[INDEX_CALLTYPE]);
+ sb.append("Direction - ");
+ sb.append(callinfo[INDEX_DIRECTION]);
+ }
+ return sb.toString();
+ }
+ return null;
}
@Override
public void writeToParcel(Parcel out, int flags) {
-
+ if (callInfo != null) {
+ out.writeInt(dialogSize);
+ for (int i = 0; i < dialogSize; i++) {
+ String[] callPull = callInfo.get(i);
+ out.writeStringArray(callPull);
+ }
+ out.setDataPosition(0);
+ }
}
public static final Creator<QtiViceInfo> CREATOR =