Search in sources :

Example 1 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.

the class BatteryStatsImpl method dumpLocked.

public void dumpLocked(PrintWriter pw) {
    if (DEBUG) {
        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("*** Input event counter:");
        mInputEventCounter.logState(pr, "  ");
        pr.println("*** Phone timer:");
        mPhoneOnTimer.logState(pr, "  ");
        for (int i = 0; i < SignalStrength.NUM_SIGNAL_STRENGTH_BINS; i++) {
            pr.println("*** 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("*** Wifi timer:");
        mWifiOnTimer.logState(pr, "  ");
        pr.println("*** WifiRunning timer:");
        mGlobalWifiRunningTimer.logState(pr, "  ");
        pr.println("*** Bluetooth timer:");
        mBluetoothOnTimer.logState(pr, "  ");
        pr.println("*** Mobile ifaces:");
        pr.println(mMobileIfaces.toString());
    }
    super.dumpLocked(pw);
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Example 2 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.

the class InputMethodManagerService method dump.

@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) {
        pw.println("Permission Denial: can't dump InputMethodManager from from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid());
        return;
    }
    IInputMethod method;
    ClientState client;
    final Printer p = new PrintWriterPrinter(pw);
    synchronized (mMethodMap) {
        p.println("Current Input Method Manager state:");
        int N = mMethodList.size();
        p.println("  Input Methods:");
        for (int i = 0; i < N; i++) {
            InputMethodInfo info = mMethodList.get(i);
            p.println("  InputMethod #" + i + ":");
            info.dump(p, "    ");
        }
        p.println("  Clients:");
        for (ClientState ci : mClients.values()) {
            p.println("  Client " + ci + ":");
            p.println("    client=" + ci.client);
            p.println("    inputContext=" + ci.inputContext);
            p.println("    sessionRequested=" + ci.sessionRequested);
            p.println("    curSession=" + ci.curSession);
        }
        p.println("  mCurMethodId=" + mCurMethodId);
        client = mCurClient;
        p.println("  mCurClient=" + client + " mCurSeq=" + mCurSeq);
        p.println("  mCurFocusedWindow=" + mCurFocusedWindow);
        p.println("  mCurId=" + mCurId + " mHaveConnect=" + mHaveConnection + " mBoundToMethod=" + mBoundToMethod);
        p.println("  mCurToken=" + mCurToken);
        p.println("  mCurIntent=" + mCurIntent);
        method = mCurMethod;
        p.println("  mCurMethod=" + mCurMethod);
        p.println("  mEnabledSession=" + mEnabledSession);
        p.println("  mShowRequested=" + mShowRequested + " mShowExplicitlyRequested=" + mShowExplicitlyRequested + " mShowForced=" + mShowForced + " mInputShown=" + mInputShown);
        p.println("  mSystemReady=" + mSystemReady + " mScreenOn=" + mScreenOn);
    }
    p.println(" ");
    if (client != null) {
        pw.flush();
        try {
            client.client.asBinder().dump(fd, args);
        } catch (RemoteException e) {
            p.println("Input method client dead: " + e);
        }
    } else {
        p.println("No input method client.");
    }
    p.println(" ");
    if (method != null) {
        pw.flush();
        try {
            method.asBinder().dump(fd, args);
        } catch (RemoteException e) {
            p.println("Input method service dead: " + e);
        }
    } else {
        p.println("No input method service.");
    }
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) IInputMethod(com.android.internal.view.IInputMethod) Printer(android.util.Printer) PrintWriterPrinter(android.util.PrintWriterPrinter) RemoteException(android.os.RemoteException) InputMethodInfo(android.view.inputmethod.InputMethodInfo)

Example 3 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.

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 4 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.

the class IntentResolver method dumpMap.

boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, Map<String, F[]> map, String packageName, boolean printFilter) {
    String eprefix = prefix + "  ";
    String fprefix = prefix + "    ";
    boolean printedSomething = false;
    Printer printer = null;
    for (Map.Entry<String, F[]> e : map.entrySet()) {
        F[] a = e.getValue();
        final int N = a.length;
        boolean printedHeader = false;
        F filter;
        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(e.getKey());
                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) PrintWriterPrinter(android.util.PrintWriterPrinter) LogPrinter(android.util.LogPrinter) Printer(android.util.Printer) StringBuilderPrinter(android.util.StringBuilderPrinter) HashMap(java.util.HashMap) Map(java.util.Map)

Example 5 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project android_frameworks_base by ParanoidAndroid.

the class IntentResolverOld method dumpMap.

boolean dumpMap(PrintWriter out, String titlePrefix, String title, String prefix, Map<String, ArrayList<F>> map, String packageName, boolean printFilter) {
    String eprefix = prefix + "  ";
    String fprefix = prefix + "    ";
    boolean printedSomething = false;
    Printer printer = null;
    for (Map.Entry<String, ArrayList<F>> e : map.entrySet()) {
        ArrayList<F> a = e.getValue();
        final int N = a.size();
        boolean printedHeader = false;
        for (int i = 0; i < N; i++) {
            F filter = a.get(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(e.getKey());
                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) ArrayList(java.util.ArrayList) PrintWriterPrinter(android.util.PrintWriterPrinter) LogPrinter(android.util.LogPrinter) Printer(android.util.Printer) HashMap(java.util.HashMap) Map(java.util.Map)

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