Skip to content

Commit 9b10800

Browse files
author
John Wang
committed
Check watingApns before access it.
bug:5663125 Change-Id: I66275fafd316f318f9035ac11c16a30fcb32f7c8
1 parent 20398fa commit 9b10800

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,14 @@ protected void onDataSetupComplete(AsyncResult ar) {
18481848
DataConnection dc = apnContext.getDataConnection();
18491849

18501850
if (DBG) {
1851-
log(String.format("onDataSetupComplete: success apn=%s",
1852-
apnContext.getWaitingApns().get(0).apn));
1851+
// TODO We may use apnContext.getApnSetting() directly
1852+
// instead of getWaitingApns().get(0)
1853+
String apnStr = "<unknown>";
1854+
if (apnContext.getWaitngApns() != null
1855+
&& !apnContext.getWatingApns().isEmpty()){
1856+
apnStr = apnContext.getWaitingApns().get(0).apn;
1857+
}
1858+
log("onDataSetupComplete: success apn=" + apnStr);
18531859
}
18541860
ApnSetting apn = apnContext.getApnSetting();
18551861
if (apn.proxy != null && apn.proxy.length() != 0) {

0 commit comments

Comments
 (0)