Catch nulls in the new logging code.
Robert Greenwalt [Tue, 28 Jul 2015 21:04:38 +0000 (14:04 -0700)]
bug:22723423
Change-Id: I2e019732944e4738698db828cd4620963a5791dc

src/java/com/android/internal/telephony/dataconnection/DctController.java

index 6ff68b1..47c7790 100644 (file)
@@ -441,7 +441,7 @@ public class DctController extends Handler {
     private int releaseNetwork(NetworkRequest request) {
         RequestInfo requestInfo = mRequestInfos.get(request.requestId);
         logd("releaseNetwork request=" + request + ", requestInfo=" + requestInfo);
-        requestInfo.log("DctController.releaseNetwork");
+        if (requestInfo != null) requestInfo.log("DctController.releaseNetwork");
 
         final int serialNum = trackNetworkRelease(requestInfo);
         mRequestInfos.remove(request.requestId);
@@ -541,14 +541,16 @@ public class DctController extends Handler {
 
     private void onReleaseRequest(RequestInfo requestInfo, int executionSerialNumber) {
         logd("onReleaseRequest request=" + requestInfo);
-        requestInfo.log("DctController.onReleaseRequest");
-        if (requestInfo != null && requestInfo.executed) {
-            String apn = apnForNetworkRequest(requestInfo.request);
-            int phoneId = getRequestPhoneId(requestInfo.request);
-            PhoneBase phoneBase = (PhoneBase)mPhones[phoneId].getActivePhone();
-            DcTrackerBase dcTracker = phoneBase.mDcTracker;
-            dcTracker.decApnRefCount(apn, requestInfo.getLog(), executionSerialNumber);
-            requestInfo.executed = false;
+        if (requestInfo != null) {
+            requestInfo.log("DctController.onReleaseRequest");
+            if (requestInfo.executed) {
+                String apn = apnForNetworkRequest(requestInfo.request);
+                int phoneId = getRequestPhoneId(requestInfo.request);
+                PhoneBase phoneBase = (PhoneBase)mPhones[phoneId].getActivePhone();
+                DcTrackerBase dcTracker = phoneBase.mDcTracker;
+                dcTracker.decApnRefCount(apn, requestInfo.getLog(), executionSerialNumber);
+                requestInfo.executed = false;
+            }
         }
     }