public AudioAndHapticFeedbackManager( final LatinIME latinIme, final SettingsValues settingsValues) { mSettingsValues = settingsValues; mVibratorUtils = VibratorUtils.getInstance(latinIme); mAudioManager = (AudioManager) latinIme.getSystemService(Context.AUDIO_SERVICE); mSoundOn = reevaluateIfSoundIsOn(); }
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()); }