use of android.util.PrintWriterPrinter in project android_frameworks_base by AOSPA.
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 AOSPA.
the class BatteryStatsImpl method dumpLocked.
public void dumpLocked(Context context, PrintWriter pw, int flags, int reqUid, long histStart) {
if (DEBUG) {
pw.println("mOnBatteryTimeBase:");
mOnBatteryTimeBase.dump(pw, " ");
pw.println("mOnBatteryScreenOffTimeBase:");
mOnBatteryScreenOffTimeBase.dump(pw, " ");
Printer pr = new PrintWriterPrinter(pw);
pr.println("*** Screen timer:");
mScreenOnTimer.logState(pr, " ");
for (int i = 0; i < NUM_SCREEN_BRIGHTNESS_BINS; i++) {
pr.println("*** Screen brightness #" + i + ":");
mScreenBrightnessTimer[i].logState(pr, " ");
}
pr.println("*** Interactive timer:");
mInteractiveTimer.logState(pr, " ");
pr.println("*** Power save mode timer:");
mPowerSaveModeEnabledTimer.logState(pr, " ");
pr.println("*** Device idle mode light timer:");
mDeviceIdleModeLightTimer.logState(pr, " ");
pr.println("*** Device idle mode full timer:");
mDeviceIdleModeFullTimer.logState(pr, " ");
pr.println("*** Device light idling timer:");
mDeviceLightIdlingTimer.logState(pr, " ");
pr.println("*** Device idling timer:");
mDeviceIdlingTimer.logState(pr, " ");
pr.println("*** Phone timer:");
mPhoneOnTimer.logState(pr, " ");
for (int i = 0; i < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; i++) {
pr.println("*** Phone signal strength #" + i + ":");
mPhoneSignalStrengthsTimer[i].logState(pr, " ");
}
pr.println("*** Signal scanning :");
mPhoneSignalScanningTimer.logState(pr, " ");
for (int i = 0; i < NUM_DATA_CONNECTION_TYPES; i++) {
pr.println("*** Data connection type #" + i + ":");
mPhoneDataConnectionsTimer[i].logState(pr, " ");
}
pr.println("*** mMobileRadioPowerState=" + mMobileRadioPowerState);
pr.println("*** Mobile network active timer:");
mMobileRadioActiveTimer.logState(pr, " ");
pr.println("*** Mobile network active adjusted timer:");
mMobileRadioActiveAdjustedTime.logState(pr, " ");
pr.println("*** mWifiRadioPowerState=" + mWifiRadioPowerState);
pr.println("*** Wifi timer:");
mWifiOnTimer.logState(pr, " ");
pr.println("*** WifiRunning timer:");
mGlobalWifiRunningTimer.logState(pr, " ");
for (int i = 0; i < NUM_WIFI_STATES; i++) {
pr.println("*** Wifi state #" + i + ":");
mWifiStateTimer[i].logState(pr, " ");
}
for (int i = 0; i < NUM_WIFI_SUPPL_STATES; i++) {
pr.println("*** Wifi suppl state #" + i + ":");
mWifiSupplStateTimer[i].logState(pr, " ");
}
for (int i = 0; i < NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
pr.println("*** Wifi signal strength #" + i + ":");
mWifiSignalStrengthsTimer[i].logState(pr, " ");
}
pr.println("*** Flashlight timer:");
mFlashlightOnTimer.logState(pr, " ");
pr.println("*** Camera timer:");
mCameraOnTimer.logState(pr, " ");
}
super.dumpLocked(context, pw, flags, reqUid, histStart);
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by AOSPA.
the class CountryDetectorService method dump.
@SuppressWarnings("unused")
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
if (!DEBUG)
return;
try {
final Printer p = new PrintWriterPrinter(fout);
p.println("CountryDetectorService state:");
p.println(" Number of listeners=" + mReceivers.keySet().size());
if (mCountryDetector == null) {
p.println(" ComprehensiveCountryDetector not initialized");
} else {
p.println(" " + mCountryDetector.toString());
}
} catch (Exception e) {
Slog.e(TAG, "Failed to dump CountryDetectorService: ", e);
}
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by AOSPA.
the class IntentResolver method dumpMap.
boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, ArrayMap<String, F[]> map, String packageName, boolean printFilter, boolean collapseDuplicates) {
final String eprefix = prefix + " ";
final String fprefix = prefix + " ";
final ArrayMap<Object, MutableInt> found = new ArrayMap<>();
boolean printedSomething = false;
Printer printer = null;
for (int mapi = 0; mapi < map.size(); mapi++) {
F[] a = map.valueAt(mapi);
final int N = a.length;
boolean printedHeader = false;
F filter;
if (collapseDuplicates && !printFilter) {
found.clear();
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
Object label = filterToLabel(filter);
int index = found.indexOfKey(label);
if (index < 0) {
found.put(label, new MutableInt(1));
} else {
found.valueAt(index).value++;
}
}
for (int i = 0; i < found.size(); i++) {
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilterLabel(out, fprefix, found.keyAt(i), found.valueAt(i).value);
}
} else {
for (int i = 0; i < N && (filter = a[i]) != null; i++) {
if (packageName != null && !isPackageForFilter(packageName, filter)) {
continue;
}
if (title != null) {
out.print(titlePrefix);
out.println(title);
title = null;
}
if (!printedHeader) {
out.print(eprefix);
out.print(map.keyAt(mapi));
out.println(":");
printedHeader = true;
}
printedSomething = true;
dumpFilter(out, fprefix, filter);
if (printFilter) {
if (printer == null) {
printer = new PrintWriterPrinter(out);
}
filter.dump(printer, fprefix + " ");
}
}
}
}
return printedSomething;
}
use of android.util.PrintWriterPrinter in project android_frameworks_base by ResurrectionRemix.
the class CountryDetectorService method dump.
@SuppressWarnings("unused")
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
if (!DEBUG)
return;
try {
final Printer p = new PrintWriterPrinter(fout);
p.println("CountryDetectorService state:");
p.println(" Number of listeners=" + mReceivers.keySet().size());
if (mCountryDetector == null) {
p.println(" ComprehensiveCountryDetector not initialized");
} else {
p.println(" " + mCountryDetector.toString());
}
} catch (Exception e) {
Slog.e(TAG, "Failed to dump CountryDetectorService: ", e);
}
}
Aggregations