Java 类android.util.PrintWriterPrinter 实例源码

项目:keepass2android    文件:KP2AKeyboard.java   
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode());
    p.println("  mCapsLock=" + mCapsLock);
    p.println("  mComposing=" + mComposing.toString());
    p.println("  mPredictionOn=" + mPredictionOn);
    p.println("  mCorrectionMode=" + mCorrectionMode);
    p.println("  mPredicting=" + mPredicting);
    p.println("  mAutoCorrectOn=" + mAutoCorrectOn);
    p.println("  mAutoSpace=" + mAutoSpace);
    p.println("  mCompletionOn=" + mCompletionOn);
    p.println("  TextEntryState.state=" + TextEntryState.getState());
    p.println("  mSoundOn=" + mSoundOn);
    p.println("  mVibrateOn=" + mVibrateOn);
    p.println("  mPopupOn=" + mPopupOn);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:AOSP-Kayboard-7.1.2    文件:LatinIME.java   
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  VersionCode = " + ApplicationUtils.getVersionCode(this));
    p.println("  VersionName = " + ApplicationUtils.getVersionName(this));
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
    final SettingsValues settingsValues = mSettings.getCurrent();
    p.println(settingsValues.dump());
    p.println(mDictionaryFacilitator.dump(this /* context */));
    // TODO: Dump all settings values
}
项目:KeePass2Android    文件:KP2AKeyboard.java   
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode());
    p.println("  mCapsLock=" + mCapsLock);
    p.println("  mComposing=" + mComposing.toString());
    p.println("  mPredictionOn=" + mPredictionOn);
    p.println("  mCorrectionMode=" + mCorrectionMode);
    p.println("  mPredicting=" + mPredicting);
    p.println("  mAutoCorrectOn=" + mAutoCorrectOn);
    p.println("  mAutoSpace=" + mAutoSpace);
    p.println("  mCompletionOn=" + mCompletionOn);
    p.println("  TextEntryState.state=" + TextEntryState.getState());
    p.println("  mSoundOn=" + mSoundOn);
    p.println("  mVibrateOn=" + mVibrateOn);
    p.println("  mPopupOn=" + mPopupOn);
}
项目:hackerskeyboard    文件:LatinIME.java   
@Override
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  Keyboard mode = " + mKeyboardSwitcher.getKeyboardMode());
    p.println("  mComposing=" + mComposing.toString());
    p.println("  mPredictionOnForMode=" + mPredictionOnForMode);
    p.println("  mCorrectionMode=" + mCorrectionMode);
    p.println("  mPredicting=" + mPredicting);
    p.println("  mAutoCorrectOn=" + mAutoCorrectOn);
    p.println("  mAutoSpace=" + mAutoSpace);
    p.println("  mCompletionOn=" + mCompletionOn);
    p.println("  TextEntryState.state=" + TextEntryState.getState());
    p.println("  mSoundOn=" + mSoundOn);
    p.println("  mVibrateOn=" + mVibrateOn);
    p.println("  mPopupOn=" + mPopupOn);
}
项目:android-kioskime    文件:LatinIME.java   
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
    final SettingsValues settingsValues = mSettings.getCurrent();
    p.println("  mIsSuggestionsSuggestionsRequested = "
            + settingsValues.isSuggestionsRequested(mDisplayOrientation));
    p.println("  mCorrectionEnabled=" + settingsValues.mCorrectionEnabled);
    p.println("  isComposingWord=" + mWordComposer.isComposingWord());
    p.println("  mSoundOn=" + settingsValues.mSoundOn);
    p.println("  mVibrateOn=" + settingsValues.mVibrateOn);
    p.println("  mKeyPreviewPopupOn=" + settingsValues.mKeyPreviewPopupOn);
    p.println("  inputAttributes=" + settingsValues.mInputAttributes);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:ProgressManager    文件:a.java   
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);
}
项目:simple-keyboard    文件:LatinIME.java   
@Override
protected void dump(final FileDescriptor fd, final PrintWriter fout, final String[] args) {
    super.dump(fd, fout, args);

    final Printer p = new PrintWriterPrinter(fout);
    p.println("LatinIME state :");
    p.println("  VersionCode = " + ApplicationUtils.getVersionCode(this));
    p.println("  VersionName = " + ApplicationUtils.getVersionName(this));
    final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
    final int keyboardMode = keyboard != null ? keyboard.mId.mMode : -1;
    p.println("  Keyboard mode = " + keyboardMode);
}
项目:LiteSDK    文件:AppCrashHandler.java   
private void dump(CrashInfo crashInfo) {
    try {
        File dir = FileUtils.getExternalCacheDir(mContext, String.format(CRASH_LOG_DIR, mContext.getPackageName()));
        File file = new File(dir, String.format(CRASH_LOG_FILE_NAME, System.currentTimeMillis()));
        OutputStream outputStream = new FileOutputStream(file);
        crashInfo.dump(new PrintWriterPrinter(new PrintWriter(outputStream)), "");
    } catch (FileNotFoundException ex) {
        ex.printStackTrace();
    }
}
项目:Asynchronous-Android-Programming    文件:CancelMessagesActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Handler handler = new SpeakHandler();

    String stringRef1 = new String("Welcome!");
    String stringRef2 = new String("Welcome Home!");
    Message msg1 =  Message.obtain(handler,
            SpeakHandler.SAY_WORD,stringRef1);
    Message msg2 =  Message.obtain(handler,
            SpeakHandler.SAY_WORD, stringRef2);

    // Enqueue the messages to be processed later
    handler.sendMessageDelayed(msg1,600000);
    handler.sendMessageDelayed(msg2, 600000);

    // try to remove the messages
    handler.removeMessages(SpeakHandler.SAY_WORD,
            stringRef1);
    handler.removeMessages(SpeakHandler.SAY_WORD,
            new String("Welcome Home!"));

    PrintWriterPrinter out= new PrintWriterPrinter(new PrintWriter(System.out,true));

    if ( handler.hasMessages(SpeakHandler.SAY_WORD,stringRef2) ) {
        Log.i("RefComparison", "Sorry, we failed to " +
                "remove the 'Welcome Home' message!!");
    }
    handler.getLooper().dump(out,">>> Looper Queue Dump ");
}
项目:Asynchronous-Android-Programming    文件:HandlerExampleActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.handler_example_layout);

    TextView console = (TextView)findViewById(R.id.title);
    console.setText("Chapter 2 - Multithread Handler");

    final WeatherPresenter presHandler = new WeatherPresenter();
    HandlerThread handlerThread = new HandlerThread("background",
            Process.THREAD_PRIORITY_URGENT_DISPLAY);
    handlerThread.start();

    final WeatherRetriever retHandler = new WeatherRetriever(
            handlerThread.getLooper(),presHandler);

    Button todayBut = (Button)findViewById(R.id.todayBut);
    todayBut.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            retHandler.sendEmptyMessage(WeatherRetriever.GET_TODAY_FORECAST);
        }
    });

    retHandler.removeCallbacksAndMessages(null);
    retHandler.hasMessages(WeatherRetriever.GET_TODAY_FORECAST);


  //  retHandler.sendEmptyMessage(WeatherRetriever.GET_TODAY_FORECAST);

    PrintWriterPrinter out= new PrintWriterPrinter(new PrintWriter(System.out,true));
    handlerThread.getLooper().setMessageLogging(out);
}
项目:droidel    文件:ActivityThread.java   
@Override
public void dumpDbInfo(FileDescriptor fd, String[] args) {
    PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd));
    PrintWriterPrinter printer = new PrintWriterPrinter(pw);
    SQLiteDebug.dump(printer, args);
    pw.flush();
}