Skip to content

Commit fc19160

Browse files
Robert GreenwaltAndroid (Google) Code Review
authored andcommitted
Merge "Add a config to set Dun capabilities." into ics-mr1
2 parents c312ba3 + 8d27f20 commit fc19160

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
@@ -227,6 +227,13 @@
227227
<item>4</item>
228228
</integer-array>
229229

230+
<!-- If the DUN connection for this CDMA device supports more than just DUN -->
231+
<!-- traffic you should list them here. -->
232+
<!-- If this device is not CDMA this is ignored. If this list is empty on -->
233+
<!-- a DUN-requiring CDMA device, the DUN APN will just support just DUN. -->
234+
<string-array translatable="false" name="config_cdma_dun_supported_types">
235+
</string-array>
236+
230237
<!-- String containing the apn value for tethering. May be overriden by secure settings
231238
TETHER_DUN_APN. Value is a comma separated series of strings:
232239
"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
@@ -93,6 +93,9 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
9393
Phone.APN_TYPE_MMS,
9494
Phone.APN_TYPE_HIPRI };
9595

96+
private String[] mDunApnTypes = {
97+
Phone.APN_TYPE_DUN };
98+
9699
private static final int mDefaultApnId = DataConnectionTracker.APN_DEFAULT_ID;
97100

98101
/* Constructor */
@@ -118,6 +121,21 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
118121

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

123141
@Override
@@ -343,8 +361,7 @@ private boolean setupData(String reason) {
343361
String[] types;
344362
int apnId;
345363
if (mRequestedApnType.equals(Phone.APN_TYPE_DUN)) {
346-
types = new String[1];
347-
types[0] = Phone.APN_TYPE_DUN;
364+
types = mDunApnTypes;
348365
apnId = DataConnectionTracker.APN_DUN_ID;
349366
} else {
350367
types = mDefaultApnTypes;

0 commit comments

Comments
 (0)