Пример #1
0
  public void switchToShortcutIME() {
    if (mShortcutInputMethodInfo == null) {
      return;
    }

    final String imiId = mShortcutInputMethodInfo.getId();
    final InputMethodSubtypeCompatWrapper subtype = mShortcutSubtype;
    switchToTargetIME(imiId, subtype);
  }
Пример #2
0
 private void updateShortcutIME() {
   if (DBG) {
     Log.d(
         TAG,
         "Update shortcut IME from : "
             + (mShortcutInputMethodInfo == null ? "<null>" : mShortcutInputMethodInfo.getId())
             + ", "
             + (mShortcutSubtype == null
                 ? "<null>"
                 : (getSubtypeLocale(mShortcutSubtype) + ", " + mShortcutSubtype.getMode())));
   }
   // TODO: Update an icon for shortcut IME
   final Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>> shortcuts =
       mImm.getShortcutInputMethodsAndSubtypes();
   mShortcutInputMethodInfo = null;
   mShortcutSubtype = null;
   for (InputMethodInfoCompatWrapper imi : shortcuts.keySet()) {
     List<InputMethodSubtypeCompatWrapper> subtypes = shortcuts.get(imi);
     // TODO: Returns the first found IMI for now. Should handle all shortcuts as
     // appropriate.
     mShortcutInputMethodInfo = imi;
     // TODO: Pick up the first found subtype for now. Should handle all subtypes
     // as appropriate.
     mShortcutSubtype = subtypes.size() > 0 ? subtypes.get(0) : null;
     break;
   }
   if (DBG) {
     Log.d(
         TAG,
         "Update shortcut IME to : "
             + (mShortcutInputMethodInfo == null ? "<null>" : mShortcutInputMethodInfo.getId())
             + ", "
             + (mShortcutSubtype == null
                 ? "<null>"
                 : (getSubtypeLocale(mShortcutSubtype) + ", " + mShortcutSubtype.getMode())));
   }
 }