Search in sources :

Example 61 with PrintWriterPrinter

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

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

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

the class InputMethodManager method doDump.

void doDump(FileDescriptor fd, PrintWriter fout, String[] args) {
    final Printer p = new PrintWriterPrinter(fout);
    p.println("Input method client state for " + this + ":");
    p.println("  mService=" + mService);
    p.println("  mMainLooper=" + mMainLooper);
    p.println("  mIInputContext=" + mIInputContext);
    p.println("  mActive=" + mActive + " mHasBeenInactive=" + mHasBeenInactive + " mBindSequence=" + mBindSequence + " mCurId=" + mCurId);
    p.println("  mCurMethod=" + mCurMethod);
    p.println("  mCurRootView=" + mCurRootView);
    p.println("  mServedView=" + mServedView);
    p.println("  mNextServedView=" + mNextServedView);
    p.println("  mServedConnecting=" + mServedConnecting);
    if (mCurrentTextBoxAttribute != null) {
        p.println("  mCurrentTextBoxAttribute:");
        mCurrentTextBoxAttribute.dump(p, "    ");
    } else {
        p.println("  mCurrentTextBoxAttribute: null");
    }
    p.println("  mServedInputConnectionWrapper=" + mServedInputConnectionWrapper);
    p.println("  mCompletions=" + Arrays.toString(mCompletions));
    p.println("  mCursorRect=" + mCursorRect);
    p.println("  mCursorSelStart=" + mCursorSelStart + " mCursorSelEnd=" + mCursorSelEnd + " mCursorCandStart=" + mCursorCandStart + " mCursorCandEnd=" + mCursorCandEnd);
    p.println("  mNextUserActionNotificationSequenceNumber=" + mNextUserActionNotificationSequenceNumber + " mLastSentUserActionNotificationSequenceNumber=" + mLastSentUserActionNotificationSequenceNumber);
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Example 63 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project platform_frameworks_base by android.

the class Activity method dumpInner.

void dumpInner(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    writer.print(prefix);
    writer.print("Local Activity ");
    writer.print(Integer.toHexString(System.identityHashCode(this)));
    writer.println(" State:");
    String innerPrefix = prefix + "  ";
    writer.print(innerPrefix);
    writer.print("mResumed=");
    writer.print(mResumed);
    writer.print(" mStopped=");
    writer.print(mStopped);
    writer.print(" mFinished=");
    writer.println(mFinished);
    writer.print(innerPrefix);
    writer.print("mChangingConfigurations=");
    writer.println(mChangingConfigurations);
    writer.print(innerPrefix);
    writer.print("mCurrentConfig=");
    writer.println(mCurrentConfig);
    mFragments.dumpLoaders(innerPrefix, fd, writer, args);
    mFragments.getFragmentManager().dump(innerPrefix, fd, writer, args);
    if (mVoiceInteractor != null) {
        mVoiceInteractor.dump(innerPrefix, fd, writer, args);
    }
    if (getWindow() != null && getWindow().peekDecorView() != null && getWindow().peekDecorView().getViewRootImpl() != null) {
        getWindow().peekDecorView().getViewRootImpl().dump(prefix, fd, writer, args);
    }
    mHandler.getLooper().dump(new PrintWriterPrinter(writer), prefix);
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter)

Example 64 with PrintWriterPrinter

use of android.util.PrintWriterPrinter in project platform_frameworks_base by android.

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

use of android.util.PrintWriterPrinter in project platform_frameworks_base by android.

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