public void onNetworkStateChanged(Intent intent) {
    final boolean noConnection =
        intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
    mIsNetworkConnected = !noConnection;

    final KeyboardSwitcher switcher = KeyboardSwitcher.getInstance();
    final LatinKeyboard keyboard = switcher.getLatinKeyboard();
    if (keyboard != null) {
      keyboard.updateShortcutKey(isShortcutImeReady(), switcher.getKeyboardView());
    }
  }