use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by crdroidandroid.
the class SearchManagerService method dump.
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
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();
}
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by crdroidandroid.
the class DisplayManagerService method dumpInternal.
private void dumpInternal(PrintWriter pw) {
pw.println("DISPLAY MANAGER (dumpsys display)");
synchronized (mSyncRoot) {
pw.println(" mOnlyCode=" + mOnlyCore);
pw.println(" mSafeMode=" + mSafeMode);
pw.println(" mPendingTraversal=" + mPendingTraversal);
pw.println(" mGlobalDisplayState=" + Display.stateToString(mGlobalDisplayState));
pw.println(" mNextNonDefaultDisplayId=" + mNextNonDefaultDisplayId);
pw.println(" mDefaultViewport=" + mDefaultViewport);
pw.println(" mExternalTouchViewport=" + mExternalTouchViewport);
pw.println(" mDefaultDisplayDefaultColorMode=" + mDefaultDisplayDefaultColorMode);
pw.println(" mSingleDisplayDemoMode=" + mSingleDisplayDemoMode);
pw.println(" mWifiDisplayScanRequestCount=" + mWifiDisplayScanRequestCount);
IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ");
ipw.increaseIndent();
pw.println();
pw.println("Display Adapters: size=" + mDisplayAdapters.size());
for (DisplayAdapter adapter : mDisplayAdapters) {
pw.println(" " + adapter.getName());
adapter.dumpLocked(ipw);
}
pw.println();
pw.println("Display Devices: size=" + mDisplayDevices.size());
for (DisplayDevice device : mDisplayDevices) {
pw.println(" " + device.getDisplayDeviceInfoLocked());
device.dumpLocked(ipw);
}
final int logicalDisplayCount = mLogicalDisplays.size();
pw.println();
pw.println("Logical Displays: size=" + logicalDisplayCount);
for (int i = 0; i < logicalDisplayCount; i++) {
int displayId = mLogicalDisplays.keyAt(i);
LogicalDisplay display = mLogicalDisplays.valueAt(i);
pw.println(" Display " + displayId + ":");
display.dumpLocked(ipw);
}
final int callbackCount = mCallbacks.size();
pw.println();
pw.println("Callbacks: size=" + callbackCount);
for (int i = 0; i < callbackCount; i++) {
CallbackRecord callback = mCallbacks.valueAt(i);
pw.println(" " + i + ": mPid=" + callback.mPid + ", mWifiDisplayScanRequested=" + callback.mWifiDisplayScanRequested);
}
if (mDisplayPowerController != null) {
mDisplayPowerController.dump(pw);
}
pw.println();
mPersistentDataStore.dump(pw);
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by crdroidandroid.
the class UsageStatsService method dump.
/**
* Called by the Binder stub.
*/
void dump(String[] args, PrintWriter pw) {
synchronized (mLock) {
IndentingPrintWriter idpw = new IndentingPrintWriter(pw, " ");
ArraySet<String> argSet = new ArraySet<>();
argSet.addAll(Arrays.asList(args));
final int userCount = mUserState.size();
for (int i = 0; i < userCount; i++) {
idpw.printPair("user", mUserState.keyAt(i));
idpw.println();
idpw.increaseIndent();
if (argSet.contains("--checkin")) {
mUserState.valueAt(i).checkin(idpw);
} else {
mUserState.valueAt(i).dump(idpw);
idpw.println();
if (args.length > 0) {
if ("history".equals(args[0])) {
mAppIdleHistory.dumpHistory(idpw, mUserState.keyAt(i));
} else if ("flush".equals(args[0])) {
UsageStatsService.this.flushToDiskLocked();
pw.println("Flushed stats to disk");
}
}
}
mAppIdleHistory.dump(idpw, mUserState.keyAt(i));
idpw.decreaseIndent();
}
pw.println();
pw.println("Carrier privileged apps (have=" + mHaveCarrierPrivilegedApps + "): " + mCarrierPrivilegedApps);
pw.println();
pw.println("Settings:");
pw.print(" mAppIdleDurationMillis=");
TimeUtils.formatDuration(mAppIdleScreenThresholdMillis, pw);
pw.println();
pw.print(" mAppIdleWallclockThresholdMillis=");
TimeUtils.formatDuration(mAppIdleWallclockThresholdMillis, pw);
pw.println();
pw.print(" mCheckIdleIntervalMillis=");
TimeUtils.formatDuration(mCheckIdleIntervalMillis, pw);
pw.println();
pw.print(" mAppIdleParoleIntervalMillis=");
TimeUtils.formatDuration(mAppIdleParoleIntervalMillis, pw);
pw.println();
pw.print(" mAppIdleParoleDurationMillis=");
TimeUtils.formatDuration(mAppIdleParoleDurationMillis, pw);
pw.println();
pw.println();
pw.print("mAppIdleEnabled=");
pw.print(mAppIdleEnabled);
pw.print(" mAppIdleTempParoled=");
pw.print(mAppIdleTempParoled);
pw.print(" mCharging=");
pw.print(mCharging);
pw.print(" mLastAppIdleParoledTime=");
TimeUtils.formatDuration(mLastAppIdleParoledTime, pw);
pw.println();
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by AOSPA.
the class VolumeInfo method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " ", 80));
return writer.toString();
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by AOSPA.
the class StorageVolume method dump.
/** {@hide} */
// TODO(b/26742218): 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();
}
Aggregations