Search in sources :

Example 31 with IndentingPrintWriter

use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by DirtyUnicorns.

the class DiskInfo method toString.

@Override
public String toString() {
    final CharArrayWriter writer = new CharArrayWriter();
    dump(new IndentingPrintWriter(writer, "    ", 80));
    return writer.toString();
}
Also used : CharArrayWriter(java.io.CharArrayWriter) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 32 with IndentingPrintWriter

use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by DirtyUnicorns.

the class VolumeInfo method toString.

@Override
public String toString() {
    final CharArrayWriter writer = new CharArrayWriter();
    dump(new IndentingPrintWriter(writer, "    ", 80));
    return writer.toString();
}
Also used : CharArrayWriter(java.io.CharArrayWriter) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 33 with IndentingPrintWriter

use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by DirtyUnicorns.

the class Tethering method dump.

@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
    // Binder.java closes the resource for us.
    @SuppressWarnings("resource") final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
        pw.println("Permission Denial: can't dump ConnectivityService.Tether " + "from from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
        return;
    }
    pw.println("Tethering:");
    pw.increaseIndent();
    pw.print("mUpstreamIfaceTypes:");
    synchronized (mPublicSync) {
        for (Integer netType : mUpstreamIfaceTypes) {
            pw.print(" " + ConnectivityManager.getNetworkTypeName(netType));
        }
        pw.println();
        pw.println("Tether state:");
        pw.increaseIndent();
        for (int i = 0; i < mTetherStates.size(); i++) {
            final String iface = mTetherStates.keyAt(i);
            final TetherState tetherState = mTetherStates.valueAt(i);
            pw.print(iface + " - ");
            switch(tetherState.mLastState) {
                case IControlsTethering.STATE_UNAVAILABLE:
                    pw.print("UnavailableState");
                    break;
                case IControlsTethering.STATE_AVAILABLE:
                    pw.print("AvailableState");
                    break;
                case IControlsTethering.STATE_TETHERED:
                    pw.print("TetheredState");
                    break;
                default:
                    pw.print("UnknownState");
                    break;
            }
            pw.println(" - lastError = " + tetherState.mLastError);
        }
        pw.decreaseIndent();
    }
    pw.decreaseIndent();
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 34 with IndentingPrintWriter

use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by DirtyUnicorns.

the class WifiDisplayAdapter method dumpLocked.

@Override
public void dumpLocked(PrintWriter pw) {
    super.dumpLocked(pw);
    pw.println("mCurrentStatus=" + getWifiDisplayStatusLocked());
    pw.println("mFeatureState=" + mFeatureState);
    pw.println("mScanState=" + mScanState);
    pw.println("mActiveDisplayState=" + mActiveDisplayState);
    pw.println("mActiveDisplay=" + mActiveDisplay);
    pw.println("mDisplays=" + Arrays.toString(mDisplays));
    pw.println("mAvailableDisplays=" + Arrays.toString(mAvailableDisplays));
    pw.println("mRememberedDisplays=" + Arrays.toString(mRememberedDisplays));
    pw.println("mPendingStatusChangeBroadcast=" + mPendingStatusChangeBroadcast);
    pw.println("mSupportsProtectedBuffers=" + mSupportsProtectedBuffers);
    // Try to dump the controller state.
    if (mDisplayController == null) {
        pw.println("mDisplayController=null");
    } else {
        pw.println("mDisplayController:");
        final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ");
        ipw.increaseIndent();
        DumpUtils.dumpAsync(getHandler(), mDisplayController, ipw, "", 200);
    }
}
Also used : IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Example 35 with IndentingPrintWriter

use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by DirtyUnicorns.

the class SyncManager method dump.

protected void dump(FileDescriptor fd, PrintWriter pw) {
    final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ");
    dumpPendingSyncs(pw);
    dumpPeriodicSyncs(pw);
    dumpSyncState(ipw);
    dumpSyncHistory(ipw);
    dumpSyncAdapters(ipw);
}
Also used : IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter)

Aggregations

IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)126 CharArrayWriter (java.io.CharArrayWriter)21 NetworkPolicyManager.uidRulesToString (android.net.NetworkPolicyManager.uidRulesToString)10 ArrayList (java.util.ArrayList)10 ArraySet (android.util.ArraySet)9 HashSet (java.util.HashSet)7 PackageParser (android.content.pm.PackageParser)6 UserInfo (android.content.pm.UserInfo)6 ArrayMap (android.util.ArrayMap)6 SparseBooleanArray (android.util.SparseBooleanArray)6 Map (java.util.Map)6 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)6 Point (android.graphics.Point)5 INetworkPolicyManager (android.net.INetworkPolicyManager)5 NetworkPolicyManager (android.net.NetworkPolicyManager)5 IBinder (android.os.IBinder)5 RemoteCallbackList (android.os.RemoteCallbackList)5 DiskInfo (android.os.storage.DiskInfo)5 VolumeInfo (android.os.storage.VolumeInfo)5 VolumeRecord (android.os.storage.VolumeRecord)5