Improve dump detail
This change improves the formatting and detail provided by the VCN dump Bug: 8675309 Test: atest FrameworksVcnTests Change-Id: I8f13a0d8fe54e9bf8948e9576e9705024fe79611
This commit is contained in:
@@ -935,13 +935,31 @@ public class VcnManagementService extends IVcnManagementService.Stub {
|
||||
pw.println("VcnManagementService dump:");
|
||||
pw.increaseIndent();
|
||||
|
||||
pw.println("mNetworkProvider:");
|
||||
pw.increaseIndent();
|
||||
mNetworkProvider.dump(pw);
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.println("mTrackingNetworkCallback:");
|
||||
pw.increaseIndent();
|
||||
mTrackingNetworkCallback.dump(pw);
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
synchronized (mLock) {
|
||||
pw.println("mLastSnapshot:");
|
||||
pw.increaseIndent();
|
||||
mLastSnapshot.dump(pw);
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.println("mVcns:");
|
||||
pw.increaseIndent();
|
||||
for (Vcn vcn : mVcns.values()) {
|
||||
vcn.dump(pw);
|
||||
}
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
}
|
||||
|
||||
@@ -1003,6 +1021,24 @@ public class VcnManagementService extends IVcnManagementService.Stub {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Dumps the state of this snapshot for logging and debugging purposes. */
|
||||
public void dump(IndentingPrintWriter pw) {
|
||||
pw.println("TrackingNetworkCallback:");
|
||||
pw.increaseIndent();
|
||||
|
||||
pw.println("mCaps:");
|
||||
pw.increaseIndent();
|
||||
synchronized (mCaps) {
|
||||
for (Entry<Network, NetworkCapabilities> entry : mCaps.entrySet()) {
|
||||
pw.println(entry.getKey() + ": " + entry.getValue());
|
||||
}
|
||||
}
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
}
|
||||
|
||||
/** VcnCallbackImpl for Vcn signals sent up to VcnManagementService. */
|
||||
|
||||
@@ -43,6 +43,7 @@ import android.util.Slog;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.annotations.VisibleForTesting.Visibility;
|
||||
import com.android.internal.util.IndentingPrintWriter;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -320,6 +321,17 @@ public class TelephonySubscriptionTracker extends BroadcastReceiver {
|
||||
&& mPrivilegedPackages.equals(other.mPrivilegedPackages);
|
||||
}
|
||||
|
||||
/** Dumps the state of this snapshot for logging and debugging purposes. */
|
||||
public void dump(IndentingPrintWriter pw) {
|
||||
pw.println("TelephonySubscriptionSnapshot:");
|
||||
pw.increaseIndent();
|
||||
|
||||
pw.println("mSubIdToGroupMap: " + mSubIdToGroupMap);
|
||||
pw.println("mPrivilegedPackages: " + mPrivilegedPackages);
|
||||
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TelephonySubscriptionSnapshot{ "
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.util.Slog;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.annotations.VisibleForTesting.Visibility;
|
||||
import com.android.internal.util.IndentingPrintWriter;
|
||||
import com.android.server.vcn.TelephonySubscriptionTracker.TelephonySubscriptionSnapshot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -396,6 +397,18 @@ public class UnderlyingNetworkTracker {
|
||||
return Objects.hash(network, networkCapabilities, linkProperties, isBlocked);
|
||||
}
|
||||
|
||||
/** Dumps the state of this record for logging and debugging purposes. */
|
||||
public void dump(IndentingPrintWriter pw) {
|
||||
pw.println("UnderlyingNetworkRecord:");
|
||||
pw.increaseIndent();
|
||||
|
||||
pw.println("mNetwork: " + network);
|
||||
pw.println("mNetworkCapabilities: " + networkCapabilities);
|
||||
pw.println("mLinkProperties: " + linkProperties);
|
||||
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
|
||||
/** Builder to incrementally construct an UnderlyingNetworkRecord. */
|
||||
private static class Builder {
|
||||
@NonNull private final Network mNetwork;
|
||||
|
||||
@@ -2054,6 +2054,12 @@ public class VcnGatewayConnection extends StateMachine {
|
||||
"mNetworkAgent.getNetwork(): "
|
||||
+ (mNetworkAgent == null ? null : mNetworkAgent.getNetwork()));
|
||||
|
||||
pw.println("mUnderlying:");
|
||||
pw.increaseIndent();
|
||||
mUnderlying.dump(pw);
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,15 +163,19 @@ public class VcnNetworkProvider extends NetworkProvider {
|
||||
pw.increaseIndent();
|
||||
|
||||
pw.println("mListeners:");
|
||||
pw.increaseIndent();
|
||||
for (NetworkRequestListener listener : mListeners) {
|
||||
pw.println(listener);
|
||||
}
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.println("mRequests.values:");
|
||||
pw.increaseIndent();
|
||||
for (NetworkRequestEntry entry : mRequests.values()) {
|
||||
entry.dump(pw);
|
||||
}
|
||||
pw.decreaseIndent();
|
||||
pw.println();
|
||||
|
||||
pw.decreaseIndent();
|
||||
|
||||
Reference in New Issue
Block a user