Skip to content

Commit f8b8eaf

Browse files
Robert GreenwaltAndroid Git Automerger
authored andcommitted
am 7a08ef4: am e3776a4: am fc19160: Merge "Add a config to set Dun capabilities." into ics-mr1
* commit '7a08ef442ad6138352785690a8e341607d763399': Add a config to set Dun capabilities.
2 parents 2c2a41e + 7a08ef4 commit f8b8eaf

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

core/res/res/values/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,13 @@
246246
<item>4</item>
247247
</integer-array>
248248

249+
<!-- If the DUN connection for this CDMA device supports more than just DUN -->
250+
<!-- traffic you should list them here. -->
251+
<!-- If this device is not CDMA this is ignored. If this list is empty on -->
252+
<!-- a DUN-requiring CDMA device, the DUN APN will just support just DUN. -->
253+
<string-array translatable="false" name="config_cdma_dun_supported_types">
254+
</string-array>
255+
249256
<!-- String containing the apn value for tethering. May be overriden by secure settings
250257
TETHER_DUN_APN. Value is a comma separated series of strings:
251258
"name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type"

telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
9595
Phone.APN_TYPE_MMS,
9696
Phone.APN_TYPE_HIPRI };
9797

98+
private String[] mDunApnTypes = {
99+
Phone.APN_TYPE_DUN };
100+
98101
private static final int mDefaultApnId = DataConnectionTracker.APN_DEFAULT_ID;
99102

100103
/* Constructor */
@@ -121,6 +124,21 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
121124

122125
createAllDataConnectionList();
123126
broadcastMessenger();
127+
128+
Context c = mCdmaPhone.getContext();
129+
String[] t = c.getResources().getStringArray(
130+
com.android.internal.R.array.config_cdma_dun_supported_types);
131+
if (t != null && t.length > 0) {
132+
ArrayList<String> temp = new ArrayList<String>();
133+
for(int i=0; i< t.length; i++) {
134+
if (!Phone.APN_TYPE_DUN.equalsIgnoreCase(t[i])) {
135+
temp.add(t[i]);
136+
}
137+
}
138+
temp.add(0, Phone.APN_TYPE_DUN);
139+
mDunApnTypes = temp.toArray(t);
140+
}
141+
124142
}
125143

126144
@Override
@@ -348,8 +366,7 @@ private boolean setupData(String reason) {
348366
String[] types;
349367
int apnId;
350368
if (mRequestedApnType.equals(Phone.APN_TYPE_DUN)) {
351-
types = new String[1];
352-
types[0] = Phone.APN_TYPE_DUN;
369+
types = mDunApnTypes;
353370
apnId = DataConnectionTracker.APN_DUN_ID;
354371
} else {
355372
types = mDefaultApnTypes;

0 commit comments

Comments
 (0)