Search in sources :

Example 56 with Printer

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

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)

Example 57 with Printer

use of android.util.Printer 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 58 with Printer

use of android.util.Printer 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 59 with Printer

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

the class Ime method runList.

/**
     * Execute the list sub-command.
     */
private void runList() {
    String opt;
    boolean all = false;
    boolean brief = false;
    while ((opt = nextOption()) != null) {
        if (opt.equals("-a")) {
            all = true;
        } else if (opt.equals("-s")) {
            brief = true;
        } else {
            System.err.println("Error: Unknown option: " + opt);
            showUsage();
            return;
        }
    }
    List<InputMethodInfo> methods;
    if (!all) {
        try {
            methods = mImm.getEnabledInputMethodList();
        } catch (RemoteException e) {
            System.err.println(e.toString());
            System.err.println(IMM_NOT_RUNNING_ERR);
            return;
        }
    } else {
        try {
            methods = mImm.getInputMethodList();
        } catch (RemoteException e) {
            System.err.println(e.toString());
            System.err.println(IMM_NOT_RUNNING_ERR);
            return;
        }
    }
    if (methods != null) {
        Printer pr = new PrintStreamPrinter(System.out);
        for (int i = 0; i < methods.size(); i++) {
            InputMethodInfo imi = methods.get(i);
            if (brief) {
                System.out.println(imi.getId());
            } else {
                System.out.println(imi.getId() + ":");
                imi.dump(pr, "  ");
            }
        }
    }
}
Also used : PrintStreamPrinter(android.util.PrintStreamPrinter) RemoteException(android.os.RemoteException) PrintStreamPrinter(android.util.PrintStreamPrinter) Printer(android.util.Printer) InputMethodInfo(android.view.inputmethod.InputMethodInfo)

Example 60 with Printer

use of android.util.Printer 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)

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