use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class SyncManager method dump.
protected void dump(FileDescriptor fd, PrintWriter pw) {
final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ");
dumpSyncState(ipw);
dumpSyncHistory(ipw);
dumpSyncAdapters(ipw);
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class NetworkStatsService method dump.
@Override
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
mContext.enforceCallingOrSelfPermission(DUMP, TAG);
final HashSet<String> argSet = new HashSet<String>();
for (String arg : args) {
argSet.add(arg);
}
// usage: dumpsys netstats --full --uid --tag --poll --checkin
final boolean poll = argSet.contains("--poll") || argSet.contains("poll");
final boolean checkin = argSet.contains("--checkin");
final boolean fullHistory = argSet.contains("--full") || argSet.contains("full");
final boolean includeUid = argSet.contains("--uid") || argSet.contains("detail");
final boolean includeTag = argSet.contains("--tag") || argSet.contains("detail");
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
synchronized (mStatsLock) {
if (poll) {
performPollLocked(FLAG_PERSIST_ALL | FLAG_PERSIST_FORCE);
pw.println("Forced poll");
return;
}
if (checkin) {
// list current stats files to verify rotation
pw.println("Current files:");
pw.increaseIndent();
for (String file : mBaseDir.list()) {
pw.println(file);
}
pw.decreaseIndent();
return;
}
pw.println("Active interfaces:");
pw.increaseIndent();
for (String iface : mActiveIfaces.keySet()) {
final NetworkIdentitySet ident = mActiveIfaces.get(iface);
pw.print("iface=");
pw.print(iface);
pw.print(" ident=");
pw.println(ident.toString());
}
pw.decreaseIndent();
pw.println("Dev stats:");
pw.increaseIndent();
mDevRecorder.dumpLocked(pw, fullHistory);
pw.decreaseIndent();
pw.println("Xt stats:");
pw.increaseIndent();
mXtRecorder.dumpLocked(pw, fullHistory);
pw.decreaseIndent();
if (includeUid) {
pw.println("UID stats:");
pw.increaseIndent();
mUidRecorder.dumpLocked(pw, fullHistory);
pw.decreaseIndent();
}
if (includeTag) {
pw.println("UID tag stats:");
pw.increaseIndent();
mUidTagRecorder.dumpLocked(pw, fullHistory);
pw.decreaseIndent();
}
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class NetworkPolicyManagerService method dump.
@Override
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
mContext.enforceCallingOrSelfPermission(DUMP, TAG);
final IndentingPrintWriter fout = new IndentingPrintWriter(writer, " ");
final HashSet<String> argSet = new HashSet<String>();
for (String arg : args) {
argSet.add(arg);
}
synchronized (mRulesLock) {
if (argSet.contains("--unsnooze")) {
for (NetworkPolicy policy : mNetworkPolicy.values()) {
policy.clearSnooze();
}
updateNetworkEnabledLocked();
updateNetworkRulesLocked();
updateNotificationsLocked();
writePolicyLocked();
fout.println("Cleared snooze timestamps");
return;
}
fout.print("Restrict background: ");
fout.println(mRestrictBackground);
fout.println("Network policies:");
fout.increaseIndent();
for (NetworkPolicy policy : mNetworkPolicy.values()) {
fout.println(policy.toString());
}
fout.decreaseIndent();
fout.println("Policy for UIDs:");
fout.increaseIndent();
int size = mUidPolicy.size();
for (int i = 0; i < size; i++) {
final int uid = mUidPolicy.keyAt(i);
final int policy = mUidPolicy.valueAt(i);
fout.print("UID=");
fout.print(uid);
fout.print(" policy=");
dumpPolicy(fout, policy);
fout.println();
}
fout.decreaseIndent();
final SparseBooleanArray knownUids = new SparseBooleanArray();
collectKeys(mUidForeground, knownUids);
collectKeys(mUidRules, knownUids);
fout.println("Status for known UIDs:");
fout.increaseIndent();
size = knownUids.size();
for (int i = 0; i < size; i++) {
final int uid = knownUids.keyAt(i);
fout.print("UID=");
fout.print(uid);
fout.print(" foreground=");
final int foregroundIndex = mUidPidForeground.indexOfKey(uid);
if (foregroundIndex < 0) {
fout.print("UNKNOWN");
} else {
dumpSparseBooleanArray(fout, mUidPidForeground.valueAt(foregroundIndex));
}
fout.print(" rules=");
final int rulesIndex = mUidRules.indexOfKey(uid);
if (rulesIndex < 0) {
fout.print("UNKNOWN");
} else {
dumpRules(fout, mUidRules.valueAt(rulesIndex));
}
fout.println();
}
fout.decreaseIndent();
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
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 platform_frameworks_base by android.
the class ExternalStorageProvider method dump.
@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ", 160);
synchronized (mRootsLock) {
for (int i = 0; i < mRoots.size(); i++) {
final RootInfo root = mRoots.valueAt(i);
pw.println("Root{" + root.rootId + "}:");
pw.increaseIndent();
pw.printPair("flags", DebugUtils.flagsToString(Root.class, "FLAG_", root.flags));
pw.println();
pw.printPair("title", root.title);
pw.printPair("docId", root.docId);
pw.println();
pw.printPair("path", root.path);
pw.printPair("visiblePath", root.visiblePath);
pw.decreaseIndent();
pw.println();
}
}
}
Aggregations