summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Greenwalt <rgreenwalt@google.com> 2012-02-14 13:39:25 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2012-02-14 13:39:25 -0800
commite3776a47dbebc8195edeac39f7f4ce3e08b59bec (patch)
tree6a04d771bdf5cb3f709a3cfec17487804e481ddf
parente6ccc94ef9825360d8993553b30dcaa0f342c871 (diff)
parentfc19160a6a464eb71e50794fc1aa1e99c4173e31 (diff)
am fc19160a: Merge "Add a config to set Dun capabilities." into ics-mr1
* commit 'fc19160a6a464eb71e50794fc1aa1e99c4173e31': Add a config to set Dun capabilities.
-rwxr-xr-xcore/res/res/values/config.xml7
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java21
2 files changed, 26 insertions, 2 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5eb09e6fb880..37a8edb9a0a2 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -227,6 +227,13 @@
<item>4</item>
</integer-array>
+ <!-- If the DUN connection for this CDMA device supports more than just DUN -->
+ <!-- traffic you should list them here. -->
+ <!-- If this device is not CDMA this is ignored. If this list is empty on -->
+ <!-- a DUN-requiring CDMA device, the DUN APN will just support just DUN. -->
+ <string-array translatable="false" name="config_cdma_dun_supported_types">
+ </string-array>
+
<!-- String containing the apn value for tethering. May be overriden by secure settings
TETHER_DUN_APN. Value is a comma separated series of strings:
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index e2a4a7a4c1df..b3277e5ce22f 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -93,6 +93,9 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
Phone.APN_TYPE_MMS,
Phone.APN_TYPE_HIPRI };
+ private String[] mDunApnTypes = {
+ Phone.APN_TYPE_DUN };
+
private static final int mDefaultApnId = DataConnectionTracker.APN_DEFAULT_ID;
/* Constructor */
@@ -118,6 +121,21 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
createAllDataConnectionList();
broadcastMessenger();
+
+ Context c = mCdmaPhone.getContext();
+ String[] t = c.getResources().getStringArray(
+ com.android.internal.R.array.config_cdma_dun_supported_types);
+ if (t != null && t.length > 0) {
+ ArrayList<String> temp = new ArrayList<String>();
+ for(int i=0; i< t.length; i++) {
+ if (!Phone.APN_TYPE_DUN.equalsIgnoreCase(t[i])) {
+ temp.add(t[i]);
+ }
+ }
+ temp.add(0, Phone.APN_TYPE_DUN);
+ mDunApnTypes = temp.toArray(t);
+ }
+
}
@Override
@@ -343,8 +361,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
String[] types;
int apnId;
if (mRequestedApnType.equals(Phone.APN_TYPE_DUN)) {
- types = new String[1];
- types[0] = Phone.APN_TYPE_DUN;
+ types = mDunApnTypes;
apnId = DataConnectionTracker.APN_DUN_ID;
} else {
types = mDefaultApnTypes;