use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.
the class ProcessRecord method dump.
void dump(PrintWriter pw, String prefix) {
final long now = SystemClock.uptimeMillis();
pw.print(prefix);
pw.print("user #");
pw.print(userId);
pw.print(" uid=");
pw.print(info.uid);
if (uid != info.uid) {
pw.print(" ISOLATED uid=");
pw.print(uid);
}
pw.println();
if (info.className != null) {
pw.print(prefix);
pw.print("class=");
pw.println(info.className);
}
if (info.manageSpaceActivityName != null) {
pw.print(prefix);
pw.print("manageSpaceActivityName=");
pw.println(info.manageSpaceActivityName);
}
pw.print(prefix);
pw.print("dir=");
pw.print(info.sourceDir);
pw.print(" publicDir=");
pw.print(info.publicSourceDir);
pw.print(" data=");
pw.println(info.dataDir);
pw.print(prefix);
pw.print("packageList=");
pw.println(pkgList);
pw.print(prefix);
pw.print("compat=");
pw.println(compat);
if (instrumentationClass != null || instrumentationProfileFile != null || instrumentationArguments != null) {
pw.print(prefix);
pw.print("instrumentationClass=");
pw.print(instrumentationClass);
pw.print(" instrumentationProfileFile=");
pw.println(instrumentationProfileFile);
pw.print(prefix);
pw.print("instrumentationArguments=");
pw.println(instrumentationArguments);
pw.print(prefix);
pw.print("instrumentationInfo=");
pw.println(instrumentationInfo);
if (instrumentationInfo != null) {
instrumentationInfo.dump(new PrintWriterPrinter(pw), prefix + " ");
}
}
pw.print(prefix);
pw.print("thread=");
pw.println(thread);
pw.print(prefix);
pw.print("pid=");
pw.print(pid);
pw.print(" starting=");
pw.print(starting);
pw.print(" lastPss=");
pw.println(lastPss);
pw.print(prefix);
pw.print("lastActivityTime=");
TimeUtils.formatDuration(lastActivityTime, now, pw);
pw.print(" lruWeight=");
pw.print(lruWeight);
pw.print(" serviceb=");
pw.print(serviceb);
pw.print(" keeping=");
pw.print(keeping);
pw.print(" hidden=");
pw.print(hidden);
pw.print(" empty=");
pw.println(empty);
pw.print(prefix);
pw.print("oom: max=");
pw.print(maxAdj);
pw.print(" hidden=");
pw.print(hiddenAdj);
pw.print(" client=");
pw.print(clientHiddenAdj);
pw.print(" empty=");
pw.print(emptyAdj);
pw.print(" curRaw=");
pw.print(curRawAdj);
pw.print(" setRaw=");
pw.print(setRawAdj);
pw.print(" nonStopping=");
pw.print(nonStoppingAdj);
pw.print(" cur=");
pw.print(curAdj);
pw.print(" set=");
pw.println(setAdj);
pw.print(prefix);
pw.print("curSchedGroup=");
pw.print(curSchedGroup);
pw.print(" setSchedGroup=");
pw.print(setSchedGroup);
pw.print(" systemNoUi=");
pw.print(systemNoUi);
pw.print(" trimMemoryLevel=");
pw.println(trimMemoryLevel);
pw.print(prefix);
pw.print("adjSeq=");
pw.print(adjSeq);
pw.print(" lruSeq=");
pw.println(lruSeq);
if (hasShownUi || pendingUiClean || hasAboveClient) {
pw.print(prefix);
pw.print("hasShownUi=");
pw.print(hasShownUi);
pw.print(" pendingUiClean=");
pw.print(pendingUiClean);
pw.print(" hasAboveClient=");
pw.println(hasAboveClient);
}
if (setIsForeground || foregroundServices || forcingToForeground != null) {
pw.print(prefix);
pw.print("setIsForeground=");
pw.print(setIsForeground);
pw.print(" foregroundServices=");
pw.print(foregroundServices);
pw.print(" forcingToForeground=");
pw.println(forcingToForeground);
}
if (persistent || removed) {
pw.print(prefix);
pw.print("persistent=");
pw.print(persistent);
pw.print(" removed=");
pw.println(removed);
}
if (hasActivities || hasClientActivities || foregroundActivities) {
pw.print(prefix);
pw.print("hasActivities=");
pw.print(hasActivities);
pw.print(" hasClientActivities=");
pw.print(hasClientActivities);
pw.print(" foregroundActivities=");
pw.println(foregroundActivities);
}
if (!keeping) {
long wtime;
synchronized (batteryStats.getBatteryStats()) {
wtime = batteryStats.getBatteryStats().getProcessWakeTime(info.uid, pid, SystemClock.elapsedRealtime());
}
long timeUsed = wtime - lastWakeTime;
pw.print(prefix);
pw.print("lastWakeTime=");
pw.print(lastWakeTime);
pw.print(" timeUsed=");
TimeUtils.formatDuration(timeUsed, pw);
pw.println("");
pw.print(prefix);
pw.print("lastCpuTime=");
pw.print(lastCpuTime);
pw.print(" timeUsed=");
TimeUtils.formatDuration(curCpuTime - lastCpuTime, pw);
pw.println("");
}
pw.print(prefix);
pw.print("lastRequestedGc=");
TimeUtils.formatDuration(lastRequestedGc, now, pw);
pw.print(" lastLowMemory=");
TimeUtils.formatDuration(lastLowMemory, now, pw);
pw.print(" reportLowMemory=");
pw.println(reportLowMemory);
if (killedBackground || waitingToKill != null) {
pw.print(prefix);
pw.print("killedBackground=");
pw.print(killedBackground);
pw.print(" waitingToKill=");
pw.println(waitingToKill);
}
if (debugging || crashing || crashDialog != null || notResponding || anrDialog != null || bad) {
pw.print(prefix);
pw.print("debugging=");
pw.print(debugging);
pw.print(" crashing=");
pw.print(crashing);
pw.print(" ");
pw.print(crashDialog);
pw.print(" notResponding=");
pw.print(notResponding);
pw.print(" ");
pw.print(anrDialog);
pw.print(" bad=");
pw.print(bad);
// crashing or notResponding is always set before errorReportReceiver
if (errorReportReceiver != null) {
pw.print(" errorReportReceiver=");
pw.print(errorReportReceiver.flattenToShortString());
}
pw.println();
}
if (activities.size() > 0) {
pw.print(prefix);
pw.println("Activities:");
for (int i = 0; i < activities.size(); i++) {
pw.print(prefix);
pw.print(" - ");
pw.println(activities.get(i));
}
}
if (services.size() > 0) {
pw.print(prefix);
pw.println("Services:");
for (ServiceRecord sr : services) {
pw.print(prefix);
pw.print(" - ");
pw.println(sr);
}
}
if (executingServices.size() > 0) {
pw.print(prefix);
pw.println("Executing Services:");
for (ServiceRecord sr : executingServices) {
pw.print(prefix);
pw.print(" - ");
pw.println(sr);
}
}
if (connections.size() > 0) {
pw.print(prefix);
pw.println("Connections:");
for (ConnectionRecord cr : connections) {
pw.print(prefix);
pw.print(" - ");
pw.println(cr);
}
}
if (pubProviders.size() > 0) {
pw.print(prefix);
pw.println("Published Providers:");
for (HashMap.Entry<String, ContentProviderRecord> ent : pubProviders.entrySet()) {
pw.print(prefix);
pw.print(" - ");
pw.println(ent.getKey());
pw.print(prefix);
pw.print(" -> ");
pw.println(ent.getValue());
}
}
if (conProviders.size() > 0) {
pw.print(prefix);
pw.println("Connected Providers:");
for (int i = 0; i < conProviders.size(); i++) {
pw.print(prefix);
pw.print(" - ");
pw.println(conProviders.get(i).toShortString());
}
}
if (curReceiver != null) {
pw.print(prefix);
pw.print("curReceiver=");
pw.println(curReceiver);
}
if (receivers.size() > 0) {
pw.print(prefix);
pw.println("Receivers:");
for (ReceiverList rl : receivers) {
pw.print(prefix);
pw.print(" - ");
pw.println(rl);
}
}
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.
the class ReceiverList method dump.
void dump(PrintWriter pw, String prefix) {
Printer pr = new PrintWriterPrinter(pw);
dumpLocal(pw, prefix);
String p2 = prefix + " ";
final int N = size();
for (int i = 0; i < N; i++) {
BroadcastFilter bf = get(i);
pw.print(prefix);
pw.print("Filter #");
pw.print(i);
pw.print(": BroadcastFilter{");
pw.print(Integer.toHexString(System.identityHashCode(bf)));
pw.println('}');
bf.dumpInReceiverList(pw, pr, p2);
}
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.
the class BroadcastRecord method dump.
void dump(PrintWriter pw, String prefix) {
final long now = SystemClock.uptimeMillis();
pw.print(prefix);
pw.print(this);
pw.print(" to user ");
pw.println(userId);
pw.print(prefix);
pw.println(intent.toInsecureString());
if (targetComp != null && targetComp != intent.getComponent()) {
pw.print(prefix);
pw.print(" targetComp: ");
pw.println(targetComp.toShortString());
}
Bundle bundle = intent.getExtras();
if (bundle != null) {
pw.print(prefix);
pw.print(" extras: ");
pw.println(bundle.toString());
}
pw.print(prefix);
pw.print("caller=");
pw.print(callerPackage);
pw.print(" ");
pw.print(callerApp != null ? callerApp.toShortString() : "null");
pw.print(" pid=");
pw.print(callingPid);
pw.print(" uid=");
pw.println(callingUid);
if (requiredPermission != null || appOp != AppOpsManager.OP_NONE) {
pw.print(prefix);
pw.print("requiredPermission=");
pw.print(requiredPermission);
pw.print(" appOp=");
pw.println(appOp);
}
pw.print(prefix);
pw.print("dispatchClockTime=");
pw.println(new Date(dispatchClockTime));
pw.print(prefix);
pw.print("dispatchTime=");
TimeUtils.formatDuration(dispatchTime, now, pw);
if (finishTime != 0) {
pw.print(" finishTime=");
TimeUtils.formatDuration(finishTime, now, pw);
} else {
pw.print(" receiverTime=");
TimeUtils.formatDuration(receiverTime, now, pw);
}
pw.println("");
if (anrCount != 0) {
pw.print(prefix);
pw.print("anrCount=");
pw.println(anrCount);
}
if (resultTo != null || resultCode != -1 || resultData != null) {
pw.print(prefix);
pw.print("resultTo=");
pw.print(resultTo);
pw.print(" resultCode=");
pw.print(resultCode);
pw.print(" resultData=");
pw.println(resultData);
}
if (resultExtras != null) {
pw.print(prefix);
pw.print("resultExtras=");
pw.println(resultExtras);
}
if (resultAbort || ordered || sticky || initialSticky) {
pw.print(prefix);
pw.print("resultAbort=");
pw.print(resultAbort);
pw.print(" ordered=");
pw.print(ordered);
pw.print(" sticky=");
pw.print(sticky);
pw.print(" initialSticky=");
pw.println(initialSticky);
}
if (nextReceiver != 0 || receiver != null) {
pw.print(prefix);
pw.print("nextReceiver=");
pw.print(nextReceiver);
pw.print(" receiver=");
pw.println(receiver);
}
if (curFilter != null) {
pw.print(prefix);
pw.print("curFilter=");
pw.println(curFilter);
}
if (curReceiver != null) {
pw.print(prefix);
pw.print("curReceiver=");
pw.println(curReceiver);
}
if (curApp != null) {
pw.print(prefix);
pw.print("curApp=");
pw.println(curApp);
pw.print(prefix);
pw.print("curComponent=");
pw.println((curComponent != null ? curComponent.toShortString() : "--"));
if (curReceiver != null && curReceiver.applicationInfo != null) {
pw.print(prefix);
pw.print("curSourceDir=");
pw.println(curReceiver.applicationInfo.sourceDir);
}
}
if (state != IDLE) {
String stateStr = " (?)";
switch(state) {
case APP_RECEIVE:
stateStr = " (APP_RECEIVE)";
break;
case CALL_IN_RECEIVE:
stateStr = " (CALL_IN_RECEIVE)";
break;
case CALL_DONE_RECEIVE:
stateStr = " (CALL_DONE_RECEIVE)";
break;
}
pw.print(prefix);
pw.print("state=");
pw.print(state);
pw.println(stateStr);
}
final int N = receivers != null ? receivers.size() : 0;
String p2 = prefix + " ";
PrintWriterPrinter printer = new PrintWriterPrinter(pw);
for (int i = 0; i < N; i++) {
Object o = receivers.get(i);
pw.print(prefix);
pw.print("Receiver #");
pw.print(i);
pw.print(": ");
pw.println(o);
if (o instanceof BroadcastFilter)
((BroadcastFilter) o).dumpBrief(pw, p2);
else if (o instanceof ResolveInfo)
((ResolveInfo) o).dump(printer, p2);
}
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.
the class MockProvider method dump.
public void dump(PrintWriter pw, String prefix) {
pw.println(prefix + mName);
pw.println(prefix + "mHasLocation=" + mHasLocation);
pw.println(prefix + "mLocation:");
mLocation.dump(new PrintWriterPrinter(pw), prefix + " ");
pw.println(prefix + "mHasStatus=" + mHasStatus);
pw.println(prefix + "mStatus=" + mStatus);
pw.println(prefix + "mStatusUpdateTime=" + mStatusUpdateTime);
pw.println(prefix + "mExtras=" + mExtras);
}
use of android.util.PrintWriterPrinter in project platform_frameworks_base by android.
the class InputMethodService method dump.
/**
* Performs a dump of the InputMethodService's internal state. Override
* to add your own information to the dump.
*/
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
final Printer p = new PrintWriterPrinter(fout);
p.println("Input method service state for " + this + ":");
p.println(" mWindowCreated=" + mWindowCreated + " mWindowAdded=" + mWindowAdded);
p.println(" mWindowVisible=" + mWindowVisible + " mWindowWasVisible=" + mWindowWasVisible + " mInShowWindow=" + mInShowWindow);
p.println(" Configuration=" + getResources().getConfiguration());
p.println(" mToken=" + mToken);
p.println(" mInputBinding=" + mInputBinding);
p.println(" mInputConnection=" + mInputConnection);
p.println(" mStartedInputConnection=" + mStartedInputConnection);
p.println(" mInputStarted=" + mInputStarted + " mInputViewStarted=" + mInputViewStarted + " mCandidatesViewStarted=" + mCandidatesViewStarted);
if (mInputEditorInfo != null) {
p.println(" mInputEditorInfo:");
mInputEditorInfo.dump(p, " ");
} else {
p.println(" mInputEditorInfo: null");
}
p.println(" mShowInputRequested=" + mShowInputRequested + " mLastShowInputRequested=" + mLastShowInputRequested + " mShowInputFlags=0x" + Integer.toHexString(mShowInputFlags));
p.println(" mCandidatesVisibility=" + mCandidatesVisibility + " mFullscreenApplied=" + mFullscreenApplied + " mIsFullscreen=" + mIsFullscreen + " mExtractViewHidden=" + mExtractViewHidden);
if (mExtractedText != null) {
p.println(" mExtractedText:");
p.println(" text=" + mExtractedText.text.length() + " chars" + " startOffset=" + mExtractedText.startOffset);
p.println(" selectionStart=" + mExtractedText.selectionStart + " selectionEnd=" + mExtractedText.selectionEnd + " flags=0x" + Integer.toHexString(mExtractedText.flags));
} else {
p.println(" mExtractedText: null");
}
p.println(" mExtractedToken=" + mExtractedToken);
p.println(" mIsInputViewShown=" + mIsInputViewShown + " mStatusIcon=" + mStatusIcon);
p.println("Last computed insets:");
p.println(" contentTopInsets=" + mTmpInsets.contentTopInsets + " visibleTopInsets=" + mTmpInsets.visibleTopInsets + " touchableInsets=" + mTmpInsets.touchableInsets + " touchableRegion=" + mTmpInsets.touchableRegion);
p.println(" mShouldClearInsetOfPreviousIme=" + mShouldClearInsetOfPreviousIme);
p.println(" mSettingsObserver=" + mSettingsObserver);
}
Aggregations