Search in sources :

Example 91 with PrintWriterPrinter

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);
    }
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Example 92 with PrintWriterPrinter

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);
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Example 93 with PrintWriterPrinter

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);
    }
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer) RemoteException(android.os.RemoteException)

Example 94 with PrintWriterPrinter

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;
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) MutableInt(android.util.MutableInt) ArrayMap(android.util.ArrayMap) PrintWriterPrinter(android.util.PrintWriterPrinter) LogPrinter(android.util.LogPrinter) Printer(android.util.Printer)

Example 95 with PrintWriterPrinter

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);
    }
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer) RemoteException(android.os.RemoteException)

Aggregations

PrintWriterPrinter (android.util.PrintWriterPrinter)109 Printer (android.util.Printer)47 RemoteException (android.os.RemoteException)28 ResolveInfo (android.content.pm.ResolveInfo)22 Intent (android.content.Intent)20 PrintWriter (java.io.PrintWriter)16 URISyntaxException (java.net.URISyntaxException)16 Bundle (android.os.Bundle)10 ArrayMap (android.util.ArrayMap)7 LogPrinter (android.util.LogPrinter)7 HashMap (java.util.HashMap)7 InputMethodInfo (android.view.inputmethod.InputMethodInfo)6 IInputMethod (com.android.internal.view.IInputMethod)6 Date (java.util.Date)6 Map (java.util.Map)6 MutableInt (android.util.MutableInt)5 ArrayList (java.util.ArrayList)5 PendingIntent (android.app.PendingIntent)4 Iterator (java.util.Iterator)4 Point (android.graphics.Point)2