use of com.android.internal.util.FastPrintWriter in project android_frameworks_base by DirtyUnicorns.
the class BackStackRecord method commitInternal.
int commitInternal(boolean allowStateLoss) {
if (mCommitted) {
throw new IllegalStateException("commit already called");
}
if (FragmentManagerImpl.DEBUG) {
Log.v(TAG, "Commit: " + this);
LogWriter logw = new LogWriter(Log.VERBOSE, TAG);
PrintWriter pw = new FastPrintWriter(logw, false, 1024);
dump(" ", null, pw, null);
pw.flush();
}
mCommitted = true;
if (mAddToBackStack) {
mIndex = mManager.allocBackStackIndex(this);
} else {
mIndex = -1;
}
mManager.enqueueAction(this, allowStateLoss);
return mIndex;
}
use of com.android.internal.util.FastPrintWriter in project android_frameworks_base by AOSPA.
the class BackStackRecord method commitInternal.
int commitInternal(boolean allowStateLoss) {
if (mCommitted) {
throw new IllegalStateException("commit already called");
}
if (FragmentManagerImpl.DEBUG) {
Log.v(TAG, "Commit: " + this);
LogWriter logw = new LogWriter(Log.VERBOSE, TAG);
PrintWriter pw = new FastPrintWriter(logw, false, 1024);
dump(" ", null, pw, null);
pw.flush();
}
mCommitted = true;
if (mAddToBackStack) {
mIndex = mManager.allocBackStackIndex(this);
} else {
mIndex = -1;
}
mManager.enqueueAction(this, allowStateLoss);
return mIndex;
}
use of com.android.internal.util.FastPrintWriter in project android_frameworks_base by AOSPA.
the class WindowLeaked method dumpGfxInfo.
public void dumpGfxInfo(FileDescriptor fd, String[] args) {
FileOutputStream fout = new FileOutputStream(fd);
PrintWriter pw = new FastPrintWriter(fout);
try {
synchronized (mLock) {
final int count = mViews.size();
pw.println("Profile data in ms:");
for (int i = 0; i < count; i++) {
ViewRootImpl root = mRoots.get(i);
String name = getWindowName(root);
pw.printf("\n\t%s (visibility=%d)", name, root.getHostVisibility());
ThreadedRenderer renderer = root.getView().mAttachInfo.mHardwareRenderer;
if (renderer != null) {
renderer.dumpGfxInfo(pw, fd, args);
}
}
pw.println("\nView hierarchy:\n");
int viewsCount = 0;
int displayListsSize = 0;
int[] info = new int[2];
for (int i = 0; i < count; i++) {
ViewRootImpl root = mRoots.get(i);
root.dumpGfxInfo(info);
String name = getWindowName(root);
pw.printf(" %s\n %d views, %.2f kB of display lists", name, info[0], info[1] / 1024.0f);
pw.printf("\n\n");
viewsCount += info[0];
displayListsSize += info[1];
}
pw.printf("\nTotal ViewRootImpl: %d\n", count);
pw.printf("Total Views: %d\n", viewsCount);
pw.printf("Total DisplayList: %.2f kB\n\n", displayListsSize / 1024.0f);
}
} finally {
pw.flush();
}
}
use of com.android.internal.util.FastPrintWriter in project platform_frameworks_base by android.
the class ActivityManager method dumpPackageStateStatic.
/**
* @hide
*/
public static void dumpPackageStateStatic(FileDescriptor fd, String packageName) {
FileOutputStream fout = new FileOutputStream(fd);
PrintWriter pw = new FastPrintWriter(fout);
dumpService(pw, fd, "package", new String[] { packageName });
pw.println();
dumpService(pw, fd, Context.ACTIVITY_SERVICE, new String[] { "-a", "package", packageName });
pw.println();
dumpService(pw, fd, "meminfo", new String[] { "--local", "--package", packageName });
pw.println();
dumpService(pw, fd, ProcessStats.SERVICE_NAME, new String[] { packageName });
pw.println();
dumpService(pw, fd, "usagestats", new String[] { "--packages", packageName });
pw.println();
dumpService(pw, fd, BatteryStats.SERVICE_NAME, new String[] { packageName });
pw.flush();
}
use of com.android.internal.util.FastPrintWriter in project platform_frameworks_base by android.
the class ActivityThread method handleDumpService.
private void handleDumpService(DumpComponentInfo info) {
final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
try {
Service s = mServices.get(info.token);
if (s != null) {
PrintWriter pw = new FastPrintWriter(new FileOutputStream(info.fd.getFileDescriptor()));
s.dump(info.fd.getFileDescriptor(), pw, info.args);
pw.flush();
}
} finally {
IoUtils.closeQuietly(info.fd);
StrictMode.setThreadPolicy(oldPolicy);
}
}
Aggregations