Skip to content

Commit

Permalink
telephony: DataConnection: support old RILs
Browse files Browse the repository at this point in the history
Older RILs require different technology value

Change-Id: Ia72bb1229132a00b5c343c0467823b895f0338d0

Conflicts:
	src/java/com/android/internal/telephony/dataconnection/DataConnection.java
  • Loading branch information
pawitp authored and spezi77 committed Feb 18, 2016
1 parent 5e2f8e9 commit 30f31e8
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ private void onConnect(ConnectionParams cp) {
}

mPhone.mCi.setupDataCall(
Integer.toString(cp.mRilRat + 2),
Integer.toString(getRilRadioTechnology(cp.mRilRat)),
Integer.toString(cp.mProfileId),
mApnSetting.apn, mApnSetting.user, mApnSetting.password,
Integer.toString(authType),
Expand Down Expand Up @@ -726,6 +726,21 @@ private void notifyDisconnectCompleted(DisconnectParams dp, boolean sendAll) {
if (DBG) log("NotifyDisconnectCompleted DisconnectParams=" + dp);
}

private int getRilRadioTechnology(int rilRadioTechnology) {
if (mPhone.mCi.getRilVersion() < 6) {
int phoneType = mPhone.getPhoneType();
if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
return RILConstants.SETUP_DATA_TECH_GSM;
} else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
return RILConstants.SETUP_DATA_TECH_CDMA;
} else {
throw new RuntimeException("Unknown phoneType " + phoneType + ", should not happen");
}
} else {
return rilRadioTechnology + 2;
}
}

/*
* **************************************************************************
* Begin Members and methods owned by DataConnectionTracker but stored
Expand Down

0 comments on commit 30f31e8

Please sign in to comment.