Log any Orphaned NetworkRequests.
Robert Greenwalt [Tue, 21 Jul 2015 20:45:23 +0000 (13:45 -0700)]
Try to figure out why the ApnContext isn't told the request is dead.

bug:22632129
Change-Id: I24a592e6a45c4476fabff50d8c640fb6ec6af6e1

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

index 496e88d..9e9433e 100644 (file)
@@ -28,6 +28,7 @@ import android.util.SparseIntArray;
 import com.android.internal.R;
 import com.android.internal.telephony.DctConstants;
 import com.android.internal.telephony.Phone;
+import com.android.internal.util.IndentingPrintWriter;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -397,7 +398,17 @@ public class ApnContext {
         Rlog.d(LOG_TAG, "[ApnContext:" + mApnType + "] " + s);
     }
 
-    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
-        pw.println("ApnContext: " + this.toString());
+    public void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) {
+        final IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, "  ");
+        synchronized (mRefCountLock) {
+            pw.println(toString());
+            if (mRefCount > 0) {
+                pw.increaseIndent();
+                for (LocalLog l : mLocalLogs) {
+                    l.dump(fd, pw, args);
+                }
+                pw.decreaseIndent();
+            }
+        }
     }
 }