Skip to content

Commit 93faa32

Browse files
committed
Make setupDataCall take a protocol parameter.
Backport the protocol changes to setupDataCall and its callers from master. As in master, hardcode IPv4 connectivity for now. When we add the protocol field to ApnSettings, it will be fetched from there. Bug: 3333633 Change-Id: I51880bc0ec192cbf964ac7bbd6a4b7d2eed41d27
1 parent 919853c commit 93faa32

File tree

7 files changed

+38
-21
lines changed

7 files changed

+38
-21
lines changed

telephony/java/com/android/internal/telephony/CommandsInterface.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,11 +1350,15 @@ void setFacilityLock (String facility, boolean lockState, String password,
13501350
* the password for APN, or NULL
13511351
* @param authType
13521352
* the PAP / CHAP auth type. Values is one of SETUP_DATA_AUTH_*
1353+
* @param protocol
1354+
* one of the PDP_type values in TS 27.007 section 10.1.1.
1355+
* For example, "IP", "IPV6", "IPV4V6", or "PPP".
13531356
* @param result
13541357
* Callback message
13551358
*/
1356-
public void setupDataCall(String radioTechnology, String profile, String apn,
1357-
String user, String password, String authType, Message result);
1359+
public void setupDataCall(String radioTechnology, String profile,
1360+
String apn, String user, String password, String authType,
1361+
String protocol, Message result);
13581362

13591363
/**
13601364
* Deactivate packet data connection

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,8 @@ private int translateStatus(int status) {
13091309
: RILConstants.SETUP_DATA_AUTH_NONE;
13101310

13111311
setupDataCall(Integer.toString(radioTechnology), profile, apn, user,
1312-
password, Integer.toString(authType), result);
1312+
password, Integer.toString(authType),
1313+
RILConstants.SETUP_DATA_PROTOCOL_IP, result);
13131314

13141315
}
13151316

@@ -1321,30 +1322,27 @@ private int translateStatus(int status) {
13211322
deactivateDataCall(cid, result);
13221323
}
13231324

1324-
/**
1325-
* The preferred new alternative to setupDefaultPDP that is
1326-
* CDMA-compatible.
1327-
*
1328-
*/
13291325
public void
13301326
setupDataCall(String radioTechnology, String profile, String apn,
1331-
String user, String password, String authType, Message result) {
1327+
String user, String password, String authType, String protocol,
1328+
Message result) {
13321329
RILRequest rr
13331330
= RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result);
13341331

1335-
rr.mp.writeInt(6);
1332+
rr.mp.writeInt(7);
13361333

13371334
rr.mp.writeString(radioTechnology);
13381335
rr.mp.writeString(profile);
13391336
rr.mp.writeString(apn);
13401337
rr.mp.writeString(user);
13411338
rr.mp.writeString(password);
13421339
rr.mp.writeString(authType);
1340+
rr.mp.writeString(protocol);
13431341

13441342
if (RILJ_LOGD) riljLog(rr.serialString() + "> "
13451343
+ requestToString(rr.mRequest) + " " + radioTechnology + " "
13461344
+ profile + " " + apn + " " + user + " "
1347-
+ password + " " + authType);
1345+
+ password + " " + authType + " " + protocol);
13481346

13491347
send(rr);
13501348
}
@@ -2963,7 +2961,11 @@ private RILRequest findAndRemoveRequestFromList(int serial) {
29632961
dataCall.active = p.readInt();
29642962
dataCall.type = p.readString();
29652963
dataCall.apn = p.readString();
2966-
dataCall.address = p.readString();
2964+
String address = p.readString();
2965+
if (address != null) {
2966+
address = address.split(" ")[0];
2967+
}
2968+
dataCall.address = address;
29672969

29682970
response.add(dataCall);
29692971
}

telephony/java/com/android/internal/telephony/RILConstants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,16 @@ class C */
9191
/* Setup a packet data connection. See ril.h RIL_REQUEST_SETUP_DATA_CALL */
9292
int SETUP_DATA_TECH_CDMA = 0;
9393
int SETUP_DATA_TECH_GSM = 1;
94+
9495
int SETUP_DATA_AUTH_NONE = 0;
9596
int SETUP_DATA_AUTH_PAP = 1;
9697
int SETUP_DATA_AUTH_CHAP = 2;
9798
int SETUP_DATA_AUTH_PAP_CHAP = 3;
9899

100+
String SETUP_DATA_PROTOCOL_IP = "IP";
101+
String SETUP_DATA_PROTOCOL_IPV6 = "IPV6";
102+
String SETUP_DATA_PROTOCOL_IPV4V6 = "IPV4V6";
103+
99104
/*
100105
cat include/telephony/ril.h | \
101106
egrep '^#define' | \

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ protected void onConnect(ConnectionParams cp) {
8585
// msg.obj will be returned in AsyncResult.userObj;
8686
Message msg = obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE, cp);
8787
msg.obj = cp;
88-
phone.mCM.setupDataCall(Integer.toString(RILConstants.SETUP_DATA_TECH_CDMA),
89-
Integer.toString(dataProfile), null, null,
90-
null, Integer.toString(RILConstants.SETUP_DATA_AUTH_PAP_CHAP), msg);
88+
phone.mCM.setupDataCall(
89+
Integer.toString(RILConstants.SETUP_DATA_TECH_CDMA),
90+
Integer.toString(dataProfile),
91+
null, null, null,
92+
Integer.toString(RILConstants.SETUP_DATA_AUTH_PAP_CHAP),
93+
RILConstants.SETUP_DATA_PROTOCOL_IP, msg);
9194
}
9295

9396
@Override

telephony/java/com/android/internal/telephony/gsm/GsmDataConnection.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ void onConnect(ConnectionParams cp) {
104104
authType = (apn.user != null) ? RILConstants.SETUP_DATA_AUTH_PAP_CHAP :
105105
RILConstants.SETUP_DATA_AUTH_NONE;
106106
}
107-
phone.mCM.setupDataCall(Integer.toString(RILConstants.SETUP_DATA_TECH_GSM),
108-
Integer.toString(RILConstants.DATA_PROFILE_DEFAULT), apn.apn, apn.user,
109-
apn.password, Integer.toString(authType), msg);
107+
phone.mCM.setupDataCall(
108+
Integer.toString(RILConstants.SETUP_DATA_TECH_GSM),
109+
Integer.toString(RILConstants.DATA_PROFILE_DEFAULT),
110+
apn.apn, apn.user, apn.password, Integer.toString(authType),
111+
RILConstants.SETUP_DATA_PROTOCOL_IP, msg);
110112
}
111113

112114
@Override

telephony/java/com/android/internal/telephony/sip/SipCommandInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public void deactivateDefaultPDP(int cid, Message result) {
193193

194194
public void setupDataCall(String radioTechnology, String profile,
195195
String apn, String user, String password, String authType,
196-
Message result) {
196+
String protcol, Message result) {
197197
}
198198

199199
public void deactivateDataCall(int cid, Message result) {

telephony/java/com/android/internal/telephony/test/SimulatedCommands.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,9 @@ public void setupDefaultPDP(String apn, String user, String password, Message re
960960
unimplemented(result);
961961
}
962962

963-
public void setupDataCall(String radioTechnology, String profile, String apn, String user,
964-
String password, String authType, Message result) {
963+
public void setupDataCall(String radioTechnology, String profile,
964+
String apn, String user, String password, String authType,
965+
String protocol, Message result) {
965966
unimplemented(result);
966967
}
967968

0 commit comments

Comments
 (0)