summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/com/android/internal/telephony/DataConnection.java33
-rw-r--r--telephony/java/com/android/internal/telephony/DataConnectionTracker.java14
-rw-r--r--telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java8
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl4
-rw-r--r--telephony/java/com/android/internal/telephony/IccConstants.java1
-rw-r--r--telephony/java/com/android/internal/telephony/Phone.java19
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneBase.java21
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneProxy.java10
-rw-r--r--telephony/java/com/android/internal/telephony/SipPhoneNotifier.java8
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java2
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GSMPhone.java3
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java4
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/SIMFileHandler.java1
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/SIMRecords.java76
-rwxr-xr-xtelephony/java/com/android/internal/telephony/sip/SipPhoneBase.java4
15 files changed, 160 insertions, 48 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index 7e722cb..521d90c 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -21,7 +21,7 @@ import com.android.internal.telephony.gsm.ApnSetting;
import com.android.internal.util.HierarchicalState;
import com.android.internal.util.HierarchicalStateMachine;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.AsyncResult;
import android.os.Message;
import android.os.SystemProperties;
@@ -261,7 +261,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
protected int mTag;
protected PhoneBase phone;
protected int cid;
- protected NetworkProperties mNetworkProperties = new NetworkProperties();
+ protected LinkProperties mLinkProperties = new LinkProperties();
protected long createTime;
protected long lastFailTime;
protected FailCause lastFailCause;
@@ -378,7 +378,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
this.lastFailTime = -1;
this.lastFailCause = FailCause.NONE;
- mNetworkProperties.clear();
+ mLinkProperties = new LinkProperties();
}
/**
@@ -416,7 +416,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
// Start with clean network properties and if we have
// a failure we'll clear again at the bottom of this code.
- mNetworkProperties.clear();
+ LinkProperties linkProperties = new LinkProperties();
if (response.length >= 2) {
cid = Integer.parseInt(response[0]);
String interfaceName = response[1];
@@ -425,23 +425,23 @@ public abstract class DataConnection extends HierarchicalStateMachine {
try {
String prefix = "net." + interfaceName + ".";
- mNetworkProperties.setInterface(NetworkInterface.getByName(interfaceName));
+ linkProperties.setInterface(NetworkInterface.getByName(interfaceName));
// TODO: Get gateway and dns via RIL interface not property?
String gatewayAddress = SystemProperties.get(prefix + "gw");
- mNetworkProperties.setGateway(InetAddress.getByName(gatewayAddress));
+ linkProperties.setGateway(InetAddress.getByName(gatewayAddress));
if (response.length > 2) {
String ipAddress = response[2];
- mNetworkProperties.addAddress(InetAddress.getByName(ipAddress));
+ linkProperties.addAddress(InetAddress.getByName(ipAddress));
// TODO: Get gateway and dns via RIL interface not property?
String dnsServers[] = new String[2];
dnsServers[0] = SystemProperties.get(prefix + "dns1");
dnsServers[1] = SystemProperties.get(prefix + "dns2");
if (isDnsOk(dnsServers)) {
- mNetworkProperties.addDns(InetAddress.getByName(dnsServers[0]));
- mNetworkProperties.addDns(InetAddress.getByName(dnsServers[1]));
+ linkProperties.addDns(InetAddress.getByName(dnsServers[0]));
+ linkProperties.addDns(InetAddress.getByName(dnsServers[1]));
} else {
result = SetupResult.ERR_BadDns;
}
@@ -463,15 +463,16 @@ public abstract class DataConnection extends HierarchicalStateMachine {
// An error occurred so clear properties
if (result != SetupResult.SUCCESS) {
- log("onSetupCompleted with an error clearing NetworkProperties");
- mNetworkProperties.clear();
+ log("onSetupCompleted with an error clearing LinkProperties");
+ linkProperties.clear();
}
+ mLinkProperties = linkProperties;
}
if (DBG) {
log("DataConnection setup result='" + result + "' on cid=" + cid);
if (result == SetupResult.SUCCESS) {
- log("NetworkProperties: " + mNetworkProperties.toString());
+ log("LinkProperties: " + mLinkProperties.toString());
}
}
return result;
@@ -636,7 +637,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
case ERR_BadDns:
// Connection succeeded but DNS info is bad so disconnect
StringBuilder dnsAddressesSb = new StringBuilder();
- for (InetAddress addr : mNetworkProperties.getDnses()) {
+ for (InetAddress addr : mLinkProperties.getDnses()) {
if (dnsAddressesSb.length() != 0) dnsAddressesSb.append(" ");
dnsAddressesSb.append(addr.toString());
}
@@ -911,10 +912,10 @@ public abstract class DataConnection extends HierarchicalStateMachine {
}
/**
- * @return the connections NetworkProperties
+ * @return the connections LinkProperties
*/
- public NetworkProperties getNetworkProperties() {
- return mNetworkProperties;
+ public LinkProperties getLinkProperties() {
+ return new LinkProperties(mLinkProperties);
}
/**
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 14cb584..765f64b 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -17,7 +17,7 @@
package com.android.internal.telephony;
import android.app.PendingIntent;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
@@ -192,8 +192,8 @@ public abstract class DataConnectionTracker extends Handler {
/** indication of our availability (preconditions to trysetupData are met) **/
protected boolean mAvailability = false;
- /** all our network properties (dns, gateway, ip, etc) */
- protected NetworkProperties mNetworkProperties;
+ /** all our link properties (dns, gateway, ip, etc) */
+ protected LinkProperties mLinkProperties;
/**
* Default constructor
@@ -420,10 +420,10 @@ public abstract class DataConnectionTracker extends Handler {
protected abstract void setState(State s);
- protected NetworkProperties getNetworkProperties(String apnType) {
+ protected LinkProperties getLinkProperties(String apnType) {
int id = apnTypeToId(apnType);
if (isApnIdEnabled(id)) {
- return mNetworkProperties;
+ return new LinkProperties(mLinkProperties);
} else {
return null;
}
@@ -673,7 +673,7 @@ public abstract class DataConnectionTracker extends Handler {
}
}
- protected NetworkProperties getNetworkProperties(DataConnection connection) {
- return connection.getNetworkProperties();
+ protected LinkProperties getLinkProperties(DataConnection connection) {
+ return connection.getLinkProperties();
}
}
diff --git a/telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java b/telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java
index 382c19f..bf3c4d1 100644
--- a/telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java
+++ b/telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java
@@ -16,7 +16,7 @@
package com.android.internal.telephony;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -108,9 +108,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
// use apnType as the key to which connection we're talking about.
// pass apnType back up to fetch particular for this one.
TelephonyManager telephony = TelephonyManager.getDefault();
- NetworkProperties networkProperties = null;
+ LinkProperties linkProperties = null;
if (state == Phone.DataState.CONNECTED) {
- networkProperties = sender.getNetworkProperties(apnType);
+ linkProperties = sender.getLinkProperties(apnType);
}
try {
mRegistry.notifyDataConnection(
@@ -118,7 +118,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
sender.isDataConnectivityPossible(), reason,
sender.getActiveApn(),
apnType,
- networkProperties,
+ linkProperties,
((telephony!=null) ? telephony.getNetworkType() :
TelephonyManager.NETWORK_TYPE_UNKNOWN));
} catch (RemoteException ex) {
diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index f7b70ee..eb7e566 100644
--- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -17,7 +17,7 @@
package com.android.internal.telephony;
import android.content.Intent;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.Bundle;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
@@ -33,7 +33,7 @@ interface ITelephonyRegistry {
void notifyCallForwardingChanged(boolean cfi);
void notifyDataActivity(int state);
void notifyDataConnection(int state, boolean isDataConnectivityPossible,
- String reason, String apn, String apnType, in NetworkProperties networkProperties,
+ String reason, String apn, String apnType, in LinkProperties linkProperties,
int networkType);
void notifyDataConnectionFailed(String reason, String apnType);
void notifyCellLocation(in Bundle cellLocation);
diff --git a/telephony/java/com/android/internal/telephony/IccConstants.java b/telephony/java/com/android/internal/telephony/IccConstants.java
index acc9197..b12d2d4 100644
--- a/telephony/java/com/android/internal/telephony/IccConstants.java
+++ b/telephony/java/com/android/internal/telephony/IccConstants.java
@@ -52,6 +52,7 @@ public interface IccConstants {
static final int EF_SPN_CPHS = 0x6f14;
static final int EF_SPN_SHORT_CPHS = 0x6f18;
static final int EF_INFO_CPHS = 0x6f16;
+ static final int EF_CSP_CPHS = 0x6f15;
// CDMA RUIM file ids from 3GPP2 C.S0023-0
static final int EF_CST = 0x6f32;
diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java
index 109b4b9..fffe057 100644
--- a/telephony/java/com/android/internal/telephony/Phone.java
+++ b/telephony/java/com/android/internal/telephony/Phone.java
@@ -17,7 +17,7 @@
package com.android.internal.telephony;
import android.content.Context;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.Handler;
import android.os.Message;
import android.telephony.CellLocation;
@@ -99,7 +99,7 @@ public interface Phone {
static final String STATE_CHANGE_REASON_KEY = "reason";
static final String DATA_APN_TYPE_KEY = "apnType";
static final String DATA_APN_KEY = "apn";
- static final String DATA_NETWORK_PROPERTIES_KEY = "dataProperties";
+ static final String DATA_LINK_PROPERTIES_KEY = "linkProperties";
static final String DATA_IFACE_NAME_KEY = "iface";
static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable";
@@ -319,9 +319,9 @@ public interface Phone {
String getActiveApn();
/**
- * Return the NetworkProperties for the named apn or null if not available
+ * Return the LinkProperties for the named apn or null if not available
*/
- NetworkProperties getNetworkProperties(String apnType);
+ LinkProperties getLinkProperties(String apnType);
/**
* Get current signal strength. No change notification available on this
@@ -1703,4 +1703,15 @@ public interface Phone {
void unsetOnEcbModeExitResponse(Handler h);
+ /**
+ * TODO: Adding a function for each property is not good.
+ * A fucntion of type getPhoneProp(propType) where propType is an
+ * enum of GSM+CDMA+LTE props would be a better approach.
+ *
+ * Get "Restriction of menu options for manual PLMN selection" bit
+ * status from EF_CSP data, this belongs to "Value Added Services Group".
+ * @return true if this bit is set or EF_CSP data is unavailable,
+ * false otherwise
+ */
+ boolean isCspPlmnEnabled();
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index 27e1cb3..36a2fcf 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -21,7 +21,7 @@ import android.app.IActivityManager;
import android.content.Context;
import android.content.res.Configuration;
import android.content.SharedPreferences;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.net.wifi.WifiManager;
import android.os.AsyncResult;
import android.os.Handler;
@@ -938,8 +938,8 @@ public abstract class PhoneBase extends Handler implements Phone {
return mDataConnection.getActiveApnTypes();
}
- public NetworkProperties getNetworkProperties(String apnType) {
- return mDataConnection.getNetworkProperties(apnType);
+ public LinkProperties getLinkProperties(String apnType) {
+ return mDataConnection.getLinkProperties(apnType);
}
public String getActiveApn() {
@@ -1024,6 +1024,13 @@ public abstract class PhoneBase extends Handler implements Phone {
}
}
+ public boolean isCspPlmnEnabled() {
+ // This function should be overridden by the class GSMPhone.
+ // Not implemented in CDMAPhone.
+ logUnexpectedGsmMethodCall("isCspPlmnEnabled");
+ return false;
+ }
+
/**
* Common error logger method for unexpected calls to CDMA-only methods.
*/
@@ -1036,4 +1043,12 @@ public abstract class PhoneBase extends Handler implements Phone {
public DataState getDataConnectionState() {
return getDataConnectionState(APN_TYPE_DEFAULT);
}
+
+ /**
+ * Common error logger method for unexpected calls to GSM/WCDMA-only methods.
+ */
+ private void logUnexpectedGsmMethodCall(String name) {
+ Log.e(LOG_TAG, "Error! " + name + "() in PhoneBase should not be " +
+ "called, GSMPhone inactive.");
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java
index c10596d..b6e4cda 100644
--- a/telephony/java/com/android/internal/telephony/PhoneProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java
@@ -20,7 +20,7 @@ package com.android.internal.telephony;
import android.app.ActivityManagerNative;
import android.content.Context;
import android.content.Intent;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
@@ -208,8 +208,8 @@ public class PhoneProxy extends Handler implements Phone {
return mActivePhone.getActiveApnTypes();
}
- public NetworkProperties getNetworkProperties(String apnType) {
- return mActivePhone.getNetworkProperties(apnType);
+ public LinkProperties getLinkProperties(String apnType) {
+ return mActivePhone.getLinkProperties(apnType);
}
public String getActiveApn() {
@@ -832,4 +832,8 @@ public class PhoneProxy extends Handler implements Phone {
public void unsetOnEcbModeExitResponse(Handler h){
mActivePhone.unsetOnEcbModeExitResponse(h);
}
+
+ public boolean isCspPlmnEnabled() {
+ return mActivePhone.isCspPlmnEnabled();
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java b/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java
index 1229d14..30d06d8 100644
--- a/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java
+++ b/telephony/java/com/android/internal/telephony/SipPhoneNotifier.java
@@ -16,7 +16,7 @@
package com.android.internal.telephony;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -110,9 +110,9 @@ public class SipPhoneNotifier implements PhoneNotifier {
// use apnType as the key to which connection we're talking about.
// pass apnType back up to fetch particular for this one.
TelephonyManager telephony = TelephonyManager.getDefault();
- NetworkProperties networkProperties = null;
+ LinkProperties linkProperties = null;
if (state == Phone.DataState.CONNECTED) {
- networkProperties = sender.getNetworkProperties(apnType);
+ linkProperties = sender.getLinkProperties(apnType);
}
try {
mRegistry.notifyDataConnection(
@@ -120,7 +120,7 @@ public class SipPhoneNotifier implements PhoneNotifier {
sender.isDataConnectivityPossible(), reason,
sender.getActiveApn(),
apnType,
- networkProperties,
+ linkProperties,
((telephony!=null) ? telephony.getNetworkType() :
TelephonyManager.NETWORK_TYPE_UNKNOWN));
} catch (RemoteException ex) {
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index c94cfa4..5918245 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -732,7 +732,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
}
if (ar.exception == null) {
- mNetworkProperties = getNetworkProperties(mActiveDataConnection);
+ mLinkProperties = getLinkProperties(mActiveDataConnection);
// everything is setup
notifyDefaultData(reason);
diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
index 2ae5a3c..7331e05 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
@@ -1467,4 +1467,7 @@ public class GSMPhone extends PhoneBase {
Log.e(LOG_TAG, "Error! This functionality is not implemented for GSM.");
}
+ public boolean isCspPlmnEnabled() {
+ return mSIMRecords.isCspPlmnEnabled();
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index face581..4414460 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -1098,7 +1098,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
}
if (ar.exception == null) {
- mNetworkProperties = getNetworkProperties(mActivePdp);
+ mLinkProperties = getLinkProperties(mActivePdp);
ApnSetting apn = mActivePdp.getApn();
if (apn.proxy != null && apn.proxy.length() != 0) {
@@ -1106,7 +1106,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
ProxyProperties proxy = new ProxyProperties();
proxy.setAddress(InetAddress.getByName(apn.proxy));
proxy.setPort(Integer.parseInt(apn.port));
- mNetworkProperties.setHttpProxy(proxy);
+ mLinkProperties.setHttpProxy(proxy);
} catch (UnknownHostException e) {
Log.e(LOG_TAG, "UnknownHostException making ProxyProperties: " + e);
} catch (SecurityException e) {
diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMFileHandler.java b/telephony/java/com/android/internal/telephony/gsm/SIMFileHandler.java
index 206e62f..e8d10f9 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SIMFileHandler.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SIMFileHandler.java
@@ -81,6 +81,7 @@ public final class SIMFileHandler extends IccFileHandler implements IccConstants
case EF_SPN_CPHS:
case EF_SPN_SHORT_CPHS:
case EF_INFO_CPHS:
+ case EF_CSP_CPHS:
return MF_SIM + DF_GSM;
case EF_PBR:
diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
index 30f38bd..c80c608 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
@@ -73,6 +73,7 @@ public final class SIMRecords extends IccRecords {
* mCphsInfo[1] and mCphsInfo[2] is CPHS Service Table
*/
private byte[] mCphsInfo = null;
+ boolean mCspPlmnEnabled = true;
byte[] efMWIS = null;
byte[] efCPHS_MWI =null;
@@ -141,6 +142,7 @@ public final class SIMRecords extends IccRecords {
private static final int EVENT_SET_MSISDN_DONE = 30;
private static final int EVENT_SIM_REFRESH = 31;
private static final int EVENT_GET_CFIS_DONE = 32;
+ private static final int EVENT_GET_CSP_CPHS_DONE = 33;
// ***** Constructor
@@ -1002,6 +1004,22 @@ public final class SIMRecords extends IccRecords {
((GSMPhone) phone).notifyCallForwardingIndicator();
break;
+ case EVENT_GET_CSP_CPHS_DONE:
+ isRecordLoadResponse = true;
+
+ ar = (AsyncResult)msg.obj;
+
+ if (ar.exception != null) {
+ Log.e(LOG_TAG,"Exception in fetching EF_CSP data " + ar.exception);
+ break;
+ }
+
+ data = (byte[])ar.result;
+
+ Log.i(LOG_TAG,"EF_CSP: " + IccUtils.bytesToHexString(data));
+ handleEfCspData(data);
+ break;
+
}}catch (RuntimeException exc) {
// I don't want these exceptions to be fatal
Log.w(LOG_TAG, "Exception parsing SIM record", exc);
@@ -1025,6 +1043,12 @@ public final class SIMRecords extends IccRecords {
new AdnRecordLoader(phone).loadFromEF(EF_MAILBOX_CPHS, EF_EXT1,
1, obtainMessage(EVENT_GET_CPHS_MAILBOX_DONE));
break;
+ case EF_CSP_CPHS:
+ recordsToLoad++;
+ Log.i(LOG_TAG, "[CSP] SIM Refresh for EF_CSP_CPHS");
+ phone.getIccFileHandler().loadEFTransparent(EF_CSP_CPHS,
+ obtainMessage(EVENT_GET_CSP_CPHS_DONE));
+ break;
default:
// For now, fetch all records if this is not a
// voicemail number.
@@ -1255,6 +1279,9 @@ public final class SIMRecords extends IccRecords {
iccFh.loadEFTransparent(EF_INFO_CPHS, obtainMessage(EVENT_GET_INFO_CPHS_DONE));
recordsToLoad++;
+ iccFh.loadEFTransparent(EF_CSP_CPHS,obtainMessage(EVENT_GET_CSP_CPHS_DONE));
+ recordsToLoad++;
+
// XXX should seek instead of examining them all
if (false) { // XXX
iccFh.loadEFLinearFixedAll(EF_SMS, obtainMessage(EVENT_GET_ALL_SMS_DONE));
@@ -1476,4 +1503,53 @@ public final class SIMRecords extends IccRecords {
Log.d(LOG_TAG, "[SIMRecords] " + s);
}
+ /**
+ * Return true if "Restriction of menu options for manual PLMN selection"
+ * bit is set or EF_CSP data is unavailable, return false otherwise.
+ */
+ public boolean isCspPlmnEnabled() {
+ return mCspPlmnEnabled;
+ }
+
+ /**
+ * Parse EF_CSP data and check if
+ * "Restriction of menu options for manual PLMN selection" is
+ * Enabled/Disabled
+ *
+ * @param data EF_CSP hex data.
+ */
+ private void handleEfCspData(byte[] data) {
+ // As per spec CPHS4_2.WW6, CPHS B.4.7.1, EF_CSP contains CPHS defined
+ // 18 bytes (i.e 9 service groups info) and additional data specific to
+ // operator. The valueAddedServicesGroup is not part of standard
+ // services. This is operator specific and can be programmed any where.
+ // Normally this is programmed as 10th service after the standard
+ // services.
+ int usedCspGroups = data.length / 2;
+ // This is the "Servive Group Number" of "Value Added Services Group".
+ byte valueAddedServicesGroup = (byte)0xC0;
+
+ mCspPlmnEnabled = true;
+ for (int i = 0; i < usedCspGroups; i++) {
+ if (data[2 * i] == valueAddedServicesGroup) {
+ Log.i(LOG_TAG, "[CSP] found ValueAddedServicesGroup, value "
+ + data[(2 * i) + 1]);
+ if ((data[(2 * i) + 1] & 0x80) == 0x80) {
+ // Bit 8 is for
+ // "Restriction of menu options for manual PLMN selection".
+ // Operator Selection menu should be enabled.
+ mCspPlmnEnabled = true;
+ } else {
+ mCspPlmnEnabled = false;
+ // Operator Selection menu should be disabled.
+ // Operator Selection Mode should be set to Automatic.
+ Log.i(LOG_TAG,"[CSP] Set Automatic Network Selection");
+ phone.setNetworkSelectionModeAutomatic(null);
+ }
+ return;
+ }
+ }
+
+ Log.w(LOG_TAG, "[CSP] Value Added Service Group (0xC0), not found!");
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java b/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java
index 1d33be9..e742887 100755
--- a/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/sip/SipPhoneBase.java
@@ -19,7 +19,7 @@ package com.android.internal.telephony.sip;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
-import android.net.NetworkProperties;
+import android.net.LinkProperties;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
@@ -540,7 +540,7 @@ abstract class SipPhoneBase extends PhoneBase {
}
//@Override
- public NetworkProperties getNetworkProperties(String apnType) {
+ public LinkProperties getLinkProperties(String apnType) {
// FIXME: what's this for SIP?
return null;
}