public AudioAndHapticFeedbackManager(
     final LatinIME latinIme, final SettingsValues settingsValues) {
   mSettingsValues = settingsValues;
   mVibratorUtils = VibratorUtils.getInstance(latinIme);
   mAudioManager = (AudioManager) latinIme.getSystemService(Context.AUDIO_SERVICE);
   mSoundOn = reevaluateIfSoundIsOn();
 }
Пример #2
0
  private void initialize(LatinIME service) {
    mService = service;
    mResources = service.getResources();
    mImm = InputMethodManagerCompatWrapper.getInstance();
    mConnectivityManager =
        (ConnectivityManager) service.getSystemService(Context.CONNECTIVITY_SERVICE);
    mEnabledKeyboardSubtypesOfCurrentInputMethod.clear();
    mEnabledLanguagesOfCurrentInputMethod.clear();
    mSystemLocale = null;
    mInputLocale = null;
    mInputLocaleStr = null;
    mCurrentSubtype = null;
    mAllEnabledSubtypesOfCurrentInputMethod = null;
    mVoiceInputWrapper = null;

    final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
    mIsNetworkConnected = (info != null && info.isConnected());
  }