Java Code Examples for com.android.internal.util.IndentingPrintWriter#decreaseIndent()
The following examples show how to use
com.android.internal.util.IndentingPrintWriter#decreaseIndent() .
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: NetworkPolicyLogger.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
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 2
Source File: StorageVolume.java From soundboard with GNU General Public License v3.0 | 6 votes |
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 3
Source File: VolumeRecord.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
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 4
Source File: SyncManager.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
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 5
Source File: StorageVolume.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
/** {@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 6
Source File: HdmiCecLocalDeviceTv.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
@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 7
Source File: HdmiControlService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override protected void dump(FileDescriptor fd, final PrintWriter writer, String[] args) { if (!DumpUtils.checkDumpPermission(getContext(), TAG, writer)) return; final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); pw.println("mHdmiControlEnabled: " + mHdmiControlEnabled); pw.println("mProhibitMode: " + mProhibitMode); if (mCecController != null) { pw.println("mCecController: "); pw.increaseIndent(); mCecController.dump(pw); pw.decreaseIndent(); } pw.println("mMhlController: "); pw.increaseIndent(); mMhlController.dump(pw); pw.decreaseIndent(); pw.println("mPortInfo: "); pw.increaseIndent(); for (HdmiPortInfo hdmiPortInfo : mPortInfo) { pw.println("- " + hdmiPortInfo); } pw.decreaseIndent(); pw.println("mPowerStatus: " + mPowerStatus); }
Example 8
Source File: BaseBundle.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
/** {@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 9
Source File: KeepaliveTracker.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
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 10
Source File: MultipathPolicyTracker.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
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 11
Source File: OverlayManagerSettings.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
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 12
Source File: BaseBundle.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
/** {@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 13
Source File: PackageInstallerService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
void dump(IndentingPrintWriter pw) { synchronized (mSessions) { pw.println("Active install sessions:"); pw.increaseIndent(); int N = mSessions.size(); for (int i = 0; i < N; i++) { final PackageInstallerSession session = mSessions.valueAt(i); session.dump(pw); pw.println(); } pw.println(); pw.decreaseIndent(); pw.println("Historical install sessions:"); pw.increaseIndent(); N = mHistoricalSessions.size(); for (int i = 0; i < N; i++) { pw.print(mHistoricalSessions.get(i)); pw.println(); } pw.println(); pw.decreaseIndent(); pw.println("Legacy install sessions:"); pw.increaseIndent(); pw.println(mLegacySessions.toString()); pw.decreaseIndent(); } }
Example 14
Source File: DeviceStorageMonitorService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
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 15
Source File: PackageInstallerSession.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@GuardedBy("mLock") private void dumpLocked(IndentingPrintWriter pw) { pw.println("Session " + sessionId + ":"); pw.increaseIndent(); pw.printPair("userId", userId); pw.printPair("mOriginalInstallerUid", mOriginalInstallerUid); pw.printPair("mInstallerPackageName", mInstallerPackageName); pw.printPair("mInstallerUid", mInstallerUid); pw.printPair("createdMillis", createdMillis); pw.printPair("stageDir", stageDir); pw.printPair("stageCid", stageCid); pw.println(); params.dump(pw); pw.printPair("mClientProgress", mClientProgress); pw.printPair("mProgress", mProgress); pw.printPair("mSealed", mSealed); pw.printPair("mPermissionsManuallyAccepted", mPermissionsManuallyAccepted); pw.printPair("mRelinquished", mRelinquished); pw.printPair("mDestroyed", mDestroyed); pw.printPair("mFds", mFds.size()); pw.printPair("mBridges", mBridges.size()); pw.printPair("mFinalStatus", mFinalStatus); pw.printPair("mFinalMessage", mFinalMessage); pw.println(); pw.decreaseIndent(); }
Example 16
Source File: SearchManagerService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); synchronized (mSearchables) { for (int i = 0; i < mSearchables.size(); i++) { ipw.print("\nUser: "); ipw.println(mSearchables.keyAt(i)); ipw.increaseIndent(); mSearchables.valueAt(i).dump(fd, ipw, args); ipw.decreaseIndent(); } } }
Example 17
Source File: JobSchedulerService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
void dump(IndentingPrintWriter pw) { pw.println("Settings:"); pw.increaseIndent(); pw.printPair(KEY_MIN_IDLE_COUNT, MIN_IDLE_COUNT).println(); pw.printPair(KEY_MIN_CHARGING_COUNT, MIN_CHARGING_COUNT).println(); pw.printPair(KEY_MIN_BATTERY_NOT_LOW_COUNT, MIN_BATTERY_NOT_LOW_COUNT).println(); pw.printPair(KEY_MIN_STORAGE_NOT_LOW_COUNT, MIN_STORAGE_NOT_LOW_COUNT).println(); pw.printPair(KEY_MIN_CONNECTIVITY_COUNT, MIN_CONNECTIVITY_COUNT).println(); pw.printPair(KEY_MIN_CONTENT_COUNT, MIN_CONTENT_COUNT).println(); pw.printPair(KEY_MIN_READY_JOBS_COUNT, MIN_READY_JOBS_COUNT).println(); pw.printPair(KEY_HEAVY_USE_FACTOR, HEAVY_USE_FACTOR).println(); pw.printPair(KEY_MODERATE_USE_FACTOR, MODERATE_USE_FACTOR).println(); pw.printPair(KEY_FG_JOB_COUNT, FG_JOB_COUNT).println(); pw.printPair(KEY_BG_NORMAL_JOB_COUNT, BG_NORMAL_JOB_COUNT).println(); pw.printPair(KEY_BG_MODERATE_JOB_COUNT, BG_MODERATE_JOB_COUNT).println(); pw.printPair(KEY_BG_LOW_JOB_COUNT, BG_LOW_JOB_COUNT).println(); pw.printPair(KEY_BG_CRITICAL_JOB_COUNT, BG_CRITICAL_JOB_COUNT).println(); pw.printPair(KEY_MAX_STANDARD_RESCHEDULE_COUNT, MAX_STANDARD_RESCHEDULE_COUNT).println(); pw.printPair(KEY_MAX_WORK_RESCHEDULE_COUNT, MAX_WORK_RESCHEDULE_COUNT).println(); pw.printPair(KEY_MIN_LINEAR_BACKOFF_TIME, MIN_LINEAR_BACKOFF_TIME).println(); pw.printPair(KEY_MIN_EXP_BACKOFF_TIME, MIN_EXP_BACKOFF_TIME).println(); pw.printPair(KEY_STANDBY_HEARTBEAT_TIME, STANDBY_HEARTBEAT_TIME).println(); pw.print("standby_beats={"); pw.print(STANDBY_BEATS[0]); for (int i = 1; i < STANDBY_BEATS.length; i++) { pw.print(", "); pw.print(STANDBY_BEATS[i]); } pw.println('}'); pw.printPair(KEY_CONN_CONGESTION_DELAY_FRAC, CONN_CONGESTION_DELAY_FRAC).println(); pw.printPair(KEY_CONN_PREFETCH_RELAX_FRAC, CONN_PREFETCH_RELAX_FRAC).println(); pw.decreaseIndent(); }
Example 18
Source File: TelephonyRegistry.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
@Override public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; synchronized (mRecords) { final int recordCount = mRecords.size(); pw.println("last known state:"); pw.increaseIndent(); for (int i = 0; i < TelephonyManager.getDefault().getPhoneCount(); i++) { pw.println("Phone Id=" + i); pw.increaseIndent(); pw.println("mCallState=" + mCallState[i]); pw.println("mCallIncomingNumber=" + mCallIncomingNumber[i]); pw.println("mServiceState=" + mServiceState[i]); pw.println("mVoiceActivationState= " + mVoiceActivationState[i]); pw.println("mDataActivationState= " + mDataActivationState[i]); pw.println("mUserMobileDataState= " + mUserMobileDataState[i]); pw.println("mSignalStrength=" + mSignalStrength[i]); pw.println("mMessageWaiting=" + mMessageWaiting[i]); pw.println("mCallForwarding=" + mCallForwarding[i]); pw.println("mDataActivity=" + mDataActivity[i]); pw.println("mDataConnectionState=" + mDataConnectionState[i]); pw.println("mCellLocation=" + mCellLocation[i]); pw.println("mCellInfo=" + mCellInfo.get(i)); pw.decreaseIndent(); } pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState); pw.println("mPreciseCallState=" + mPreciseCallState); pw.println("mCarrierNetworkChangeState=" + mCarrierNetworkChangeState); pw.println("mRingingCallState=" + mRingingCallState); pw.println("mForegroundCallState=" + mForegroundCallState); pw.println("mBackgroundCallState=" + mBackgroundCallState); pw.println("mVoLteServiceState=" + mVoLteServiceState); pw.decreaseIndent(); pw.println("local logs:"); pw.increaseIndent(); mLocalLog.dump(fd, pw, args); pw.decreaseIndent(); pw.println("registrations: count=" + recordCount); pw.increaseIndent(); for (Record r : mRecords) { pw.println(r); } pw.decreaseIndent(); } }
Example 19
Source File: ContentService.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
@Override protected synchronized void dump(FileDescriptor fd, PrintWriter pw_, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw_)) return; final IndentingPrintWriter pw = new IndentingPrintWriter(pw_, " "); final boolean dumpAll = ArrayUtils.contains(args, "-a"); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. final long identityToken = clearCallingIdentity(); try { if (mSyncManager == null) { pw.println("SyncManager not available yet"); } else { mSyncManager.dump(fd, pw, dumpAll); } pw.println(); pw.println("Observer tree:"); synchronized (mRootNode) { int[] counts = new int[2]; final SparseIntArray pidCounts = new SparseIntArray(); mRootNode.dumpLocked(fd, pw, args, "", " ", counts, pidCounts); pw.println(); ArrayList<Integer> sorted = new ArrayList<Integer>(); for (int i=0; i<pidCounts.size(); i++) { sorted.add(pidCounts.keyAt(i)); } Collections.sort(sorted, new Comparator<Integer>() { @Override public int compare(Integer lhs, Integer rhs) { int lc = pidCounts.get(lhs); int rc = pidCounts.get(rhs); if (lc < rc) { return 1; } else if (lc > rc) { return -1; } return 0; } }); for (int i=0; i<sorted.size(); i++) { int pid = sorted.get(i); pw.print(" pid "); pw.print(pid); pw.print(": "); pw.print(pidCounts.get(pid)); pw.println(" observers"); } pw.println(); pw.print(" Total number of nodes: "); pw.println(counts[0]); pw.print(" Total number of observers: "); pw.println(counts[1]); } synchronized (mCache) { pw.println(); pw.println("Cached content:"); pw.increaseIndent(); for (int i = 0; i < mCache.size(); i++) { pw.println("User " + mCache.keyAt(i) + ":"); pw.increaseIndent(); pw.println(mCache.valueAt(i)); pw.decreaseIndent(); } pw.decreaseIndent(); } } finally { restoreCallingIdentity(identityToken); } }
Example 20
Source File: ContentService.java From AndroidComponentPlugin with Apache License 2.0 | 4 votes |
@Override protected synchronized void dump(FileDescriptor fd, PrintWriter pw_, String[] args) { if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw_)) return; final IndentingPrintWriter pw = new IndentingPrintWriter(pw_, " "); final boolean dumpAll = ArrayUtils.contains(args, "-a"); // This makes it so that future permission checks will be in the context of this // process rather than the caller's process. We will restore this before returning. final long identityToken = clearCallingIdentity(); try { if (mSyncManager == null) { pw.println("SyncManager not available yet"); } else { mSyncManager.dump(fd, pw, dumpAll); } pw.println(); pw.println("Observer tree:"); synchronized (mRootNode) { int[] counts = new int[2]; final SparseIntArray pidCounts = new SparseIntArray(); mRootNode.dumpLocked(fd, pw, args, "", " ", counts, pidCounts); pw.println(); ArrayList<Integer> sorted = new ArrayList<Integer>(); for (int i=0; i<pidCounts.size(); i++) { sorted.add(pidCounts.keyAt(i)); } Collections.sort(sorted, new Comparator<Integer>() { @Override public int compare(Integer lhs, Integer rhs) { int lc = pidCounts.get(lhs); int rc = pidCounts.get(rhs); if (lc < rc) { return 1; } else if (lc > rc) { return -1; } return 0; } }); for (int i=0; i<sorted.size(); i++) { int pid = sorted.get(i); pw.print(" pid "); pw.print(pid); pw.print(": "); pw.print(pidCounts.get(pid)); pw.println(" observers"); } pw.println(); pw.print(" Total number of nodes: "); pw.println(counts[0]); pw.print(" Total number of observers: "); pw.println(counts[1]); sObserverDeathDispatcher.dump(pw, " "); } synchronized (sObserverLeakDetectedUid) { pw.println(); pw.print("Observer leaking UIDs: "); pw.println(sObserverLeakDetectedUid.toString()); } synchronized (mCache) { pw.println(); pw.println("Cached content:"); pw.increaseIndent(); for (int i = 0; i < mCache.size(); i++) { pw.println("User " + mCache.keyAt(i) + ":"); pw.increaseIndent(); pw.println(mCache.valueAt(i)); pw.decreaseIndent(); } pw.decreaseIndent(); } } finally { restoreCallingIdentity(identityToken); } }