use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class AppWidgetService method dump.
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
// Dump the state of all the app widget providers
synchronized (mAppWidgetServices) {
IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " ");
for (int i = 0; i < mAppWidgetServices.size(); i++) {
pw.println("User: " + mAppWidgetServices.keyAt(i));
ipw.increaseIndent();
AppWidgetServiceImpl service = mAppWidgetServices.valueAt(i);
service.dump(fd, ipw, args);
ipw.decreaseIndent();
}
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class ConnectivityService method dump.
@Override
protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
pw.println("Permission Denial: can't dump ConnectivityService " + "from from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
return;
}
// TODO: add locking to get atomic snapshot
pw.println();
for (int i = 0; i < mNetTrackers.length; i++) {
final NetworkStateTracker nst = mNetTrackers[i];
if (nst != null) {
pw.println("NetworkStateTracker for " + getNetworkTypeName(i) + ":");
pw.increaseIndent();
if (nst.getNetworkInfo().isConnected()) {
pw.println("Active network: " + nst.getNetworkInfo().getTypeName());
}
pw.println(nst.getNetworkInfo());
pw.println(nst.getLinkProperties());
pw.println(nst);
pw.println();
pw.decreaseIndent();
}
}
pw.println("Network Requester Pids:");
pw.increaseIndent();
for (int net : mPriorityList) {
String pidString = net + ": ";
for (Integer pid : mNetRequestersPids[net]) {
pidString = pidString + pid.toString() + ", ";
}
pw.println(pidString);
}
pw.println();
pw.decreaseIndent();
pw.println("FeatureUsers:");
pw.increaseIndent();
for (Object requester : mFeatureUsers) {
pw.println(requester.toString());
}
pw.println();
pw.decreaseIndent();
synchronized (this) {
pw.println("NetworkTranstionWakeLock is currently " + (mNetTransitionWakeLock.isHeld() ? "" : "not ") + "held.");
pw.println("It was last requested for " + mNetTransitionWakeLockCausedBy);
}
pw.println();
mTethering.dump(fd, pw, args);
if (mInetLog != null) {
pw.println();
pw.println("Inet condition reports:");
pw.increaseIndent();
for (int i = 0; i < mInetLog.size(); i++) {
pw.println(mInetLog.get(i));
}
pw.decreaseIndent();
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class DisplayManagerService method dump.
// Binder call
@Override
public void dump(FileDescriptor fd, final PrintWriter pw, String[] args) {
if (mContext == null || mContext.checkCallingOrSelfPermission(Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
pw.println("Permission Denial: can't dump DisplayManager from from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
return;
}
pw.println("DISPLAY MANAGER (dumpsys display)");
synchronized (mSyncRoot) {
pw.println(" mHeadless=" + mHeadless);
pw.println(" mOnlyCode=" + mOnlyCore);
pw.println(" mSafeMode=" + mSafeMode);
pw.println(" mPendingTraversal=" + mPendingTraversal);
pw.println(" mAllDisplayBlankStateFromPowerManager=" + mAllDisplayBlankStateFromPowerManager);
pw.println(" mNextNonDefaultDisplayId=" + mNextNonDefaultDisplayId);
pw.println(" mDefaultViewport=" + mDefaultViewport);
pw.println(" mExternalTouchViewport=" + mExternalTouchViewport);
pw.println(" mSingleDisplayDemoMode=" + mSingleDisplayDemoMode);
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);
}
}
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class UsbService method dump.
@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
pw.println("USB Manager State:");
if (mDeviceManager != null) {
mDeviceManager.dump(fd, pw);
}
if (mHostManager != null) {
mHostManager.dump(fd, pw);
}
synchronized (mLock) {
for (int i = 0; i < mSettingsByUser.size(); i++) {
final int userId = mSettingsByUser.keyAt(i);
final UsbSettingsManager settings = mSettingsByUser.valueAt(i);
pw.increaseIndent();
pw.println("Settings for user " + userId + ":");
settings.dump(fd, pw);
pw.decreaseIndent();
}
}
pw.decreaseIndent();
}
use of com.android.internal.util.IndentingPrintWriter in project android_frameworks_base by ParanoidAndroid.
the class NetworkStatsHistory method toString.
@Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
dump(new IndentingPrintWriter(writer, " "), false);
return writer.toString();
}
Aggregations