Search in sources :

Example 71 with Printer

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

the class SQLiteConnectionPool method dump.

/**
     * Dumps debugging information about this connection pool.
     *
     * @param printer The printer to receive the dump, not null.
     * @param verbose True to dump more verbose information.
     */
public void dump(Printer printer, boolean verbose) {
    Printer indentedPrinter = PrefixPrinter.create(printer, "    ");
    synchronized (mLock) {
        printer.println("Connection pool for " + mConfiguration.path + ":");
        printer.println("  Open: " + mIsOpen);
        printer.println("  Max connections: " + mMaxConnectionPoolSize);
        printer.println("  Available primary connection:");
        if (mAvailablePrimaryConnection != null) {
            mAvailablePrimaryConnection.dump(indentedPrinter, verbose);
        } else {
            indentedPrinter.println("<none>");
        }
        printer.println("  Available non-primary connections:");
        if (!mAvailableNonPrimaryConnections.isEmpty()) {
            final int count = mAvailableNonPrimaryConnections.size();
            for (int i = 0; i < count; i++) {
                mAvailableNonPrimaryConnections.get(i).dump(indentedPrinter, verbose);
            }
        } else {
            indentedPrinter.println("<none>");
        }
        printer.println("  Acquired connections:");
        if (!mAcquiredConnections.isEmpty()) {
            for (Map.Entry<SQLiteConnection, AcquiredConnectionStatus> entry : mAcquiredConnections.entrySet()) {
                final SQLiteConnection connection = entry.getKey();
                connection.dumpUnsafe(indentedPrinter, verbose);
                indentedPrinter.println("  Status: " + entry.getValue());
            }
        } else {
            indentedPrinter.println("<none>");
        }
        printer.println("  Connection waiters:");
        if (mConnectionWaiterQueue != null) {
            int i = 0;
            final long now = SystemClock.uptimeMillis();
            for (ConnectionWaiter waiter = mConnectionWaiterQueue; waiter != null; waiter = waiter.mNext, i++) {
                indentedPrinter.println(i + ": waited for " + ((now - waiter.mStartTime) * 0.001f) + " ms - thread=" + waiter.mThread + ", priority=" + waiter.mPriority + ", sql='" + waiter.mSql + "'");
            }
        } else {
            indentedPrinter.println("<none>");
        }
    }
}
Also used : PrefixPrinter(android.util.PrefixPrinter) Printer(android.util.Printer) Map(java.util.Map) WeakHashMap(java.util.WeakHashMap)

Example 72 with Printer

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

the class InputMethodService method dump.

/**
     * Performs a dump of the InputMethodService's internal state.  Override
     * to add your own information to the dump.
     */
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
    final Printer p = new PrintWriterPrinter(fout);
    p.println("Input method service state for " + this + ":");
    p.println("  mWindowCreated=" + mWindowCreated + " mWindowAdded=" + mWindowAdded);
    p.println("  mWindowVisible=" + mWindowVisible + " mWindowWasVisible=" + mWindowWasVisible + " mInShowWindow=" + mInShowWindow);
    p.println("  Configuration=" + getResources().getConfiguration());
    p.println("  mToken=" + mToken);
    p.println("  mInputBinding=" + mInputBinding);
    p.println("  mInputConnection=" + mInputConnection);
    p.println("  mStartedInputConnection=" + mStartedInputConnection);
    p.println("  mInputStarted=" + mInputStarted + " mInputViewStarted=" + mInputViewStarted + " mCandidatesViewStarted=" + mCandidatesViewStarted);
    if (mInputEditorInfo != null) {
        p.println("  mInputEditorInfo:");
        mInputEditorInfo.dump(p, "    ");
    } else {
        p.println("  mInputEditorInfo: null");
    }
    p.println("  mShowInputRequested=" + mShowInputRequested + " mLastShowInputRequested=" + mLastShowInputRequested + " mShowInputFlags=0x" + Integer.toHexString(mShowInputFlags));
    p.println("  mCandidatesVisibility=" + mCandidatesVisibility + " mFullscreenApplied=" + mFullscreenApplied + " mIsFullscreen=" + mIsFullscreen + " mExtractViewHidden=" + mExtractViewHidden);
    if (mExtractedText != null) {
        p.println("  mExtractedText:");
        p.println("    text=" + mExtractedText.text.length() + " chars" + " startOffset=" + mExtractedText.startOffset);
        p.println("    selectionStart=" + mExtractedText.selectionStart + " selectionEnd=" + mExtractedText.selectionEnd + " flags=0x" + Integer.toHexString(mExtractedText.flags));
    } else {
        p.println("  mExtractedText: null");
    }
    p.println("  mExtractedToken=" + mExtractedToken);
    p.println("  mIsInputViewShown=" + mIsInputViewShown + " mStatusIcon=" + mStatusIcon);
    p.println("Last computed insets:");
    p.println("  contentTopInsets=" + mTmpInsets.contentTopInsets + " visibleTopInsets=" + mTmpInsets.visibleTopInsets + " touchableInsets=" + mTmpInsets.touchableInsets + " touchableRegion=" + mTmpInsets.touchableRegion);
    p.println(" mShouldClearInsetOfPreviousIme=" + mShouldClearInsetOfPreviousIme);
    p.println(" mSettingsObserver=" + mSettingsObserver);
}
Also used : PrintWriterPrinter(android.util.PrintWriterPrinter) PrintWriterPrinter(android.util.PrintWriterPrinter) Printer(android.util.Printer)

Aggregations

Printer (android.util.Printer)72 PrintWriterPrinter (android.util.PrintWriterPrinter)52 RemoteException (android.os.RemoteException)18 LogPrinter (android.util.LogPrinter)12 InputMethodInfo (android.view.inputmethod.InputMethodInfo)12 PrefixPrinter (android.util.PrefixPrinter)8 Map (java.util.Map)8 Uri (android.net.Uri)6 PrintStreamPrinter (android.util.PrintStreamPrinter)6 IInputMethod (com.android.internal.view.IInputMethod)6 PrintWriter (java.io.PrintWriter)6 WeakHashMap (java.util.WeakHashMap)6 ArrayMap (android.util.ArrayMap)5 MutableInt (android.util.MutableInt)5 FastPrintWriter (com.android.internal.util.FastPrintWriter)5 StringBuilderPrinter (android.util.StringBuilderPrinter)2 HashMap (java.util.HashMap)2 Resources (android.content.res.Resources)1 ViewGroup (android.view.ViewGroup)1 EditorInfo (android.view.inputmethod.EditorInfo)1