com.android.internal.util.IndentingPrintWriter Java Examples

The following examples show how to use com.android.internal.util.IndentingPrintWriter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HdmiCecLocalDeviceTv.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
protected void dump(final IndentingPrintWriter pw) {
    super.dump(pw);
    pw.println("mArcEstablished: " + mArcEstablished);
    pw.println("mArcFeatureEnabled: " + mArcFeatureEnabled);
    pw.println("mSystemAudioActivated: " + mSystemAudioActivated);
    pw.println("mSystemAudioMute: " + mSystemAudioMute);
    pw.println("mSystemAudioControlFeatureEnabled: " + mSystemAudioControlFeatureEnabled);
    pw.println("mAutoDeviceOff: " + mAutoDeviceOff);
    pw.println("mAutoWakeup: " + mAutoWakeup);
    pw.println("mSkipRoutingControl: " + mSkipRoutingControl);
    pw.println("mPrevPortId: " + mPrevPortId);
    pw.println("CEC devices:");
    pw.increaseIndent();
    for (HdmiDeviceInfo info : mSafeAllDeviceInfos) {
        pw.println(info);
    }
    pw.decreaseIndent();
}
 
Example #2
Source File: WifiDisplayAdapter.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@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);
    }
}
 
Example #3
Source File: NetworkStatsHistory.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw, boolean fullHistory) {
    pw.print("NetworkStatsHistory: bucketDuration=");
    pw.println(bucketDuration / SECOND_IN_MILLIS);
    pw.increaseIndent();

    final int start = fullHistory ? 0 : Math.max(0, bucketCount - 32);
    if (start > 0) {
        pw.print("(omitting "); pw.print(start); pw.println(" buckets)");
    }

    for (int i = start; i < bucketCount; i++) {
        pw.print("st="); pw.print(bucketStart[i] / SECOND_IN_MILLIS);
        if (rxBytes != null) { pw.print(" rb="); pw.print(rxBytes[i]); }
        if (rxPackets != null) { pw.print(" rp="); pw.print(rxPackets[i]); }
        if (txBytes != null) { pw.print(" tb="); pw.print(txBytes[i]); }
        if (txPackets != null) { pw.print(" tp="); pw.print(txPackets[i]); }
        if (operations != null) { pw.print(" op="); pw.print(operations[i]); }
        pw.println();
    }

    pw.decreaseIndent();
}
 
Example #4
Source File: PackageInstaller.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/** {@hide} */
public void dump(IndentingPrintWriter pw) {
    pw.printPair("mode", mode);
    pw.printHexPair("installFlags", installFlags);
    pw.printPair("installLocation", installLocation);
    pw.printPair("sizeBytes", sizeBytes);
    pw.printPair("appPackageName", appPackageName);
    pw.printPair("appIcon", (appIcon != null));
    pw.printPair("appLabel", appLabel);
    pw.printPair("originatingUri", originatingUri);
    pw.printPair("originatingUid", originatingUid);
    pw.printPair("referrerUri", referrerUri);
    pw.printPair("abiOverride", abiOverride);
    pw.printPair("volumeUuid", volumeUuid);
    pw.printPair("grantedRuntimePermissions", grantedRuntimePermissions);
    pw.printPair("installerPackageName", installerPackageName);
    pw.println();
}
 
Example #5
Source File: PendingTransactionActions.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
    // Tell activity manager we have been stopped.
    try {
        if (DEBUG_MEMORY_TRIM) Slog.v(TAG, "Reporting activity stopped: " + mActivity);
        // TODO(lifecycler): Use interface callback instead of AMS.
        ActivityManager.getService().activityStopped(
                mActivity.token, mState, mPersistentState, mDescription);
    } catch (RemoteException ex) {
        // Dump statistics about bundle to help developers debug
        final LogWriter writer = new LogWriter(Log.WARN, TAG);
        final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
        pw.println("Bundle stats:");
        Bundle.dumpStats(pw, mState);
        pw.println("PersistableBundle stats:");
        Bundle.dumpStats(pw, mPersistentState);

        if (ex instanceof TransactionTooLargeException
                && mActivity.packageInfo.getTargetSdkVersion() < Build.VERSION_CODES.N) {
            Log.e(TAG, "App sent too much data in instance state, so it was ignored", ex);
            return;
        }
        throw ex.rethrowFromSystemServer();
    }
}
 
Example #6
Source File: VolumeInfo.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println("VolumeInfo{" + id + "}:");
    pw.increaseIndent();
    pw.printPair("type", DebugUtils.valueToString(getClass(), "TYPE_", type));
    pw.printPair("diskId", getDiskId());
    pw.printPair("partGuid", partGuid);
    pw.printPair("mountFlags", DebugUtils.flagsToString(getClass(), "MOUNT_FLAG_", mountFlags));
    pw.printPair("mountUserId", mountUserId);
    pw.printPair("state", DebugUtils.valueToString(getClass(), "STATE_", state));
    pw.println();
    pw.printPair("fsType", fsType);
    pw.printPair("fsUuid", fsUuid);
    pw.printPair("fsLabel", fsLabel);
    pw.println();
    pw.printPair("path", path);
    pw.printPair("internalPath", internalPath);
    pw.decreaseIndent();
    pw.println();
}
 
Example #7
Source File: StorageVolume.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/** {@hide} */
public void dump(IndentingPrintWriter pw) {
    pw.println("StorageVolume:");
    pw.increaseIndent();
    pw.printPair("mId", mId);
    pw.printPair("mPath", mPath);
    pw.printPair("mInternalPath", mInternalPath);
    pw.printPair("mDescription", mDescription);
    pw.printPair("mPrimary", mPrimary);
    pw.printPair("mRemovable", mRemovable);
    pw.printPair("mEmulated", mEmulated);
    pw.printPair("mAllowMassStorage", mAllowMassStorage);
    pw.printPair("mMaxFileSize", mMaxFileSize);
    pw.printPair("mOwner", mOwner);
    pw.printPair("mFsUuid", mFsUuid);
    pw.printPair("mState", mState);
    pw.decreaseIndent();
}
 
Example #8
Source File: IdleController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void dumpControllerStateLocked(IndentingPrintWriter pw,
        Predicate<JobStatus> predicate) {
    pw.println("Currently idle: " + mIdleTracker.isIdle());
    pw.println();

    for (int i = 0; i < mTrackedTasks.size(); i++) {
        final JobStatus js = mTrackedTasks.valueAt(i);
        if (!predicate.test(js)) {
            continue;
        }
        pw.print("#");
        js.printUniqueId(pw);
        pw.print(" from ");
        UserHandle.formatUid(pw, js.getSourceUid());
        pw.println();
    }
}
 
Example #9
Source File: StorageController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void dumpControllerStateLocked(IndentingPrintWriter pw,
        Predicate<JobStatus> predicate) {
    pw.println("Not low: " + mStorageTracker.isStorageNotLow());
    pw.println("Sequence: " + mStorageTracker.getSeq());
    pw.println();

    for (int i = 0; i < mTrackedTasks.size(); i++) {
        final JobStatus js = mTrackedTasks.valueAt(i);
        if (!predicate.test(js)) {
            continue;
        }
        pw.print("#");
        js.printUniqueId(pw);
        pw.print(" from ");
        UserHandle.formatUid(pw, js.getSourceUid());
        pw.println();
    }
}
 
Example #10
Source File: VolumeRecord.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println("VolumeRecord:");
    pw.increaseIndent();
    pw.printPair("type", DebugUtils.valueToString(VolumeInfo.class, "TYPE_", type));
    pw.printPair("fsUuid", fsUuid);
    pw.printPair("partGuid", partGuid);
    pw.println();
    pw.printPair("nickname", nickname);
    pw.printPair("userFlags",
            DebugUtils.flagsToString(VolumeRecord.class, "USER_FLAG_", userFlags));
    pw.println();
    pw.printPair("createdMillis", TimeUtils.formatForLogging(createdMillis));
    pw.printPair("lastTrimMillis", TimeUtils.formatForLogging(lastTrimMillis));
    pw.printPair("lastBenchMillis", TimeUtils.formatForLogging(lastBenchMillis));
    pw.decreaseIndent();
    pw.println();
}
 
Example #11
Source File: DeviceIdleJobsController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void dumpControllerStateLocked(final IndentingPrintWriter pw,
        final Predicate<JobStatus> predicate) {
    pw.println("Idle mode: " + mDeviceIdleMode);
    pw.println();

    mService.getJobStore().forEachJob(predicate, (jobStatus) -> {
        pw.print("#");
        jobStatus.printUniqueId(pw);
        pw.print(" from ");
        UserHandle.formatUid(pw, jobStatus.getSourceUid());
        pw.print(": ");
        pw.print(jobStatus.getSourcePackageName());
        pw.print((jobStatus.satisfiedConstraints
                & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0
                        ? " RUNNABLE" : " WAITING");
        if (jobStatus.dozeWhitelisted) {
            pw.print(" WHITELISTED");
        }
        if (mAllowInIdleJobs.contains(jobStatus)) {
            pw.print(" ALLOWED_IN_DOZE");
        }
        pw.println();
    });
}
 
Example #12
Source File: StorageVolume.java    From soundboard with GNU General Public License v3.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println("StorageVolume:");
    pw.increaseIndent();
    pw.printPair("mId", mId);
    pw.printPair("mStorageId", mStorageId);
    pw.printPair("mPath", mPath);
    pw.printPair("mDescription", mDescription);
    pw.printPair("mPrimary", mPrimary);
    pw.printPair("mRemovable", mRemovable);
    pw.printPair("mEmulated", mEmulated);
    pw.printPair("mMtpReserveSize", mMtpReserveSize);
    pw.printPair("mAllowMassStorage", mAllowMassStorage);
    pw.printPair("mMaxFileSize", mMaxFileSize);
    pw.printPair("mOwner", mOwner);
    pw.printPair("mFsUuid", mFsUuid);
    pw.printPair("mState", mState);
    pw.decreaseIndent();
}
 
Example #13
Source File: NetworkDiagnostics.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println(TAG + ":" + mDescription);
    final long unfinished = mCountDownLatch.getCount();
    if (unfinished > 0) {
        // This can't happen unless a caller forgets to call waitForMeasurements()
        // or a measurement isn't implemented to correctly honor the timeout.
        pw.println("WARNING: countdown wait incomplete: "
                + unfinished + " unfinished measurements");
    }

    pw.increaseIndent();

    String prefix;
    for (Measurement m : getMeasurements()) {
        prefix = m.checkSucceeded() ? "." : "F";
        pw.println(prefix + "  " + m.toString());
    }

    pw.decreaseIndent();
}
 
Example #14
Source File: OffloadController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    if (isOffloadDisabled()) {
        pw.println("Offload disabled");
        return;
    }
    final boolean isStarted = started();
    pw.println("Offload HALs " + (isStarted ? "started" : "not started"));
    LinkProperties lp = mUpstreamLinkProperties;
    String upstream = (lp != null) ? lp.getInterfaceName() : null;
    pw.println("Current upstream: " + upstream);
    pw.println("Exempt prefixes: " + mLastLocalPrefixStrs);
    pw.println("NAT timeout update callbacks received during the "
            + (isStarted ? "current" : "last")
            + " offload session: "
            + mNatUpdateCallbacksReceived);
    pw.println("NAT timeout update netlink errors during the "
            + (isStarted ? "current" : "last")
            + " offload session: "
            + mNatUpdateNetlinkErrors);
}
 
Example #15
Source File: NetworkPolicyLogger.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
void dumpLogs(IndentingPrintWriter pw) {
    synchronized (mLock) {
        pw.println();
        pw.println("mEventLogs (most recent first):");
        pw.increaseIndent();
        mEventsBuffer.reverseDump(pw);
        pw.decreaseIndent();

        pw.println();
        pw.println("mNetworkBlockedLogs (most recent first):");
        pw.increaseIndent();
        mNetworkBlockedBuffer.reverseDump(pw);
        pw.decreaseIndent();

        pw.println();
        pw.println("mUidStateChangeLogs (most recent first):");
        pw.increaseIndent();
        mUidStateChangeBuffer.reverseDump(pw);
        pw.decreaseIndent();
    }
}
 
Example #16
Source File: BaseBundle.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/** {@hide} */
public static void dumpStats(IndentingPrintWriter pw, String key, Object value) {
    final Parcel tmp = Parcel.obtain();
    tmp.writeValue(value);
    final int size = tmp.dataPosition();
    tmp.recycle();

    // We only really care about logging large values
    if (size > 1024) {
        pw.println(key + " [size=" + size + "]");
        if (value instanceof BaseBundle) {
            dumpStats(pw, (BaseBundle) value);
        } else if (value instanceof SparseArray) {
            dumpStats(pw, (SparseArray) value);
        }
    }
}
 
Example #17
Source File: SyncManager.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private void dumpSyncAdapters(IndentingPrintWriter pw) {
    pw.println();
    final List<UserInfo> users = getAllUsers();
    if (users != null) {
        for (UserInfo user : users) {
            pw.println("Sync adapters for " + user + ":");
            pw.increaseIndent();
            for (RegisteredServicesCache.ServiceInfo<?> info :
                    mSyncAdapters.getAllServices(user.id)) {
                pw.println(info);
            }
            pw.decreaseIndent();
            pw.println();
        }
    }
}
 
Example #18
Source File: ConnectivityController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@GuardedBy("mLock")
@Override
public void dumpControllerStateLocked(IndentingPrintWriter pw,
        Predicate<JobStatus> predicate) {
    for (int i = 0; i < mTrackedJobs.size(); i++) {
        final JobStatus js = mTrackedJobs.valueAt(i);
        if (predicate.test(js)) {
            pw.print("#");
            js.printUniqueId(pw);
            pw.print(" from ");
            UserHandle.formatUid(pw, js.getSourceUid());
            pw.print(": ");
            pw.print(js.getJob().getRequiredNetwork());
            pw.println();
        }
    }
}
 
Example #19
Source File: BatteryController.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
@Override
public void dumpControllerStateLocked(IndentingPrintWriter pw,
        Predicate<JobStatus> predicate) {
    pw.println("Stable power: " + mChargeTracker.isOnStablePower());
    pw.println("Not low: " + mChargeTracker.isBatteryNotLow());

    if (mChargeTracker.isMonitoring()) {
        pw.print("MONITORING: seq=");
        pw.println(mChargeTracker.getSeq());
    }
    pw.println();

    for (int i = 0; i < mTrackedTasks.size(); i++) {
        final JobStatus js = mTrackedTasks.valueAt(i);
        if (!predicate.test(js)) {
            continue;
        }
        pw.print("#");
        js.printUniqueId(pw);
        pw.print(" from ");
        UserHandle.formatUid(pw, js.getSourceUid());
        pw.println();
    }
}
 
Example #20
Source File: OverlayManagerSettings.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
void dump(@NonNull final PrintWriter p) {
    final IndentingPrintWriter pw = new IndentingPrintWriter(p, "  ");
    pw.println("Settings");
    pw.increaseIndent();

    if (mItems.isEmpty()) {
        pw.println("<none>");
        return;
    }

    final int N = mItems.size();
    for (int i = 0; i < N; i++) {
        final SettingsItem item = mItems.get(i);
        pw.println(item.mPackageName + ":" + item.getUserId() + " {");
        pw.increaseIndent();

        pw.print("mPackageName.......: "); pw.println(item.mPackageName);
        pw.print("mUserId............: "); pw.println(item.getUserId());
        pw.print("mTargetPackageName.: "); pw.println(item.getTargetPackageName());
        pw.print("mBaseCodePath......: "); pw.println(item.getBaseCodePath());
        pw.print("mState.............: "); pw.println(OverlayInfo.stateToString(item.getState()));
        pw.print("mIsEnabled.........: "); pw.println(item.isEnabled());
        pw.print("mIsStatic..........: "); pw.println(item.isStatic());
        pw.print("mPriority..........: "); pw.println(item.mPriority);
        pw.print("mCategory..........: "); pw.println(item.mCategory);

        pw.decreaseIndent();
        pw.println("}");
    }
}
 
Example #21
Source File: MultipathPolicyTracker.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    // Do not use in production. Access to class data is only safe on the handler thrad.
    pw.println("MultipathPolicyTracker:");
    pw.increaseIndent();
    for (MultipathTracker t : mMultipathTrackers.values()) {
        pw.println(String.format("Network %s: quota %d, budget %d. Preference: %s",
                t.network, t.getQuota(), t.getMultipathBudget(),
                DebugUtils.flagsToString(ConnectivityManager.class, "MULTIPATH_PREFERENCE_",
                        t.getMultipathPreference())));
    }
    pw.decreaseIndent();
}
 
Example #22
Source File: DiskInfo.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println("DiskInfo{" + id + "}:");
    pw.increaseIndent();
    pw.printPair("flags", DebugUtils.flagsToString(getClass(), "FLAG_", flags));
    pw.printPair("size", size);
    pw.printPair("label", label);
    pw.println();
    pw.printPair("sysPath", sysPath);
    pw.decreaseIndent();
    pw.println();
}
 
Example #23
Source File: HdmiCecController.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
void dump(final IndentingPrintWriter pw) {
    for (int i = 0; i < mLocalDevices.size(); ++i) {
        pw.println("HdmiCecLocalDevice #" + i + ":");
        pw.increaseIndent();
        mLocalDevices.valueAt(i).dump(pw);
        pw.decreaseIndent();
    }
    pw.println("CEC message history:");
    pw.increaseIndent();
    final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    for (MessageHistoryRecord record : mMessageHistory) {
        record.dump(pw, sdf);
    }
    pw.decreaseIndent();
}
 
Example #24
Source File: KeepaliveTracker.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void dump(IndentingPrintWriter pw) {
    pw.println("Packet keepalives:");
    pw.increaseIndent();
    for (NetworkAgentInfo nai : mKeepalives.keySet()) {
        pw.println(nai.name());
        pw.increaseIndent();
        for (int slot : mKeepalives.get(nai).keySet()) {
            KeepaliveInfo ki = mKeepalives.get(nai).get(slot);
            pw.println(slot + ": " + ki.toString());
        }
        pw.decreaseIndent();
    }
    pw.decreaseIndent();
}
 
Example #25
Source File: HdmiCecController.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
void dump(final IndentingPrintWriter pw, SimpleDateFormat sdf) {
    pw.print(mIsReceived ? "[R]" : "[S]");
    pw.print(" time=");
    pw.print(sdf.format(new Date(mTime)));
    pw.print(" message=");
    pw.println(mMessage);
}
 
Example #26
Source File: DeviceStorageMonitorService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
void dumpImpl(FileDescriptor fd, PrintWriter _pw, String[] args) {
    final IndentingPrintWriter pw = new IndentingPrintWriter(_pw, "  ");
    if (args == null || args.length == 0 || "-a".equals(args[0])) {
        pw.println("Known volumes:");
        pw.increaseIndent();
        for (int i = 0; i < mStates.size(); i++) {
            final UUID uuid = mStates.keyAt(i);
            final State state = mStates.valueAt(i);
            if (StorageManager.UUID_DEFAULT.equals(uuid)) {
                pw.println("Default:");
            } else {
                pw.println(uuid + ":");
            }
            pw.increaseIndent();
            pw.printPair("level", State.levelToString(state.level));
            pw.printPair("lastUsableBytes", state.lastUsableBytes);
            pw.println();
            pw.decreaseIndent();
        }
        pw.decreaseIndent();
        pw.println();

        pw.printPair("mSeq", mSeq.get());
        pw.printPair("mForceState", State.levelToString(mForceLevel));
        pw.println();
        pw.println();

    } else {
        Shell shell = new Shell();
        shell.exec(mRemoteService, null, fd, null, args, null, new ResultReceiver(null));
    }
}
 
Example #27
Source File: StorageVolume.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/** {@hide} */
// TODO: find out where toString() is called internally and replace these calls by dump().
public String dump() {
    final CharArrayWriter writer = new CharArrayWriter();
    dump(new IndentingPrintWriter(writer, "    ", 80));
    return writer.toString();
}
 
Example #28
Source File: BaseBundle.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/** {@hide} */
public static void dumpStats(IndentingPrintWriter pw, BaseBundle bundle) {
    pw.increaseIndent();
    if (bundle == null) {
        pw.println("[null]");
        return;
    }
    final ArrayMap<String, Object> map = bundle.getMap();
    for (int i = 0; i < map.size(); i++) {
        dumpStats(pw, map.keyAt(i), map.valueAt(i));
    }
    pw.decreaseIndent();
}
 
Example #29
Source File: BaseBundle.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/** {@hide} */
public static void dumpStats(IndentingPrintWriter pw, SparseArray array) {
    pw.increaseIndent();
    if (array == null) {
        pw.println("[null]");
        return;
    }
    for (int i = 0; i < array.size(); i++) {
        dumpStats(pw, "0x" + Integer.toHexString(array.keyAt(i)), array.valueAt(i));
    }
    pw.decreaseIndent();
}
 
Example #30
Source File: NetworkFactory.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
    final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
    pw.println(toString());
    pw.increaseIndent();
    for (int i = 0; i < mNetworkRequests.size(); i++) {
        pw.println(mNetworkRequests.valueAt(i));
    }
    pw.decreaseIndent();
}