OSDN Git Service

Revert "Always show auxiliary subtypes from NavBar keyboard icon."
authorBart Sears <bsears@google.com>
Thu, 7 May 2015 01:51:28 +0000 (01:51 +0000)
committerBart Sears <bsears@google.com>
Thu, 7 May 2015 01:51:28 +0000 (01:51 +0000)
CL is breaking the build.  Discussed with Seigo and verting until he can take a look at it.

This reverts commit 80ff4ed6bb8dbdad7192d679a01096aa888e090b.

Change-Id: I3decaf37198e5864a1763a059df4a36ebc70c5a7

core/java/android/view/inputmethod/InputMethodManager.java
core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java
core/java/com/android/internal/view/IInputMethodManager.aidl
packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
services/core/java/com/android/server/InputMethodManagerService.java

index 040fd37..78604bf 100644 (file)
@@ -247,13 +247,6 @@ public final class InputMethodManager {
     /** @hide */
     public static final int DISPATCH_HANDLED = 1;
 
-    /** @hide */
-    public static final int SHOW_IM_PICKER_MODE_AUTO = 0;
-    /** @hide */
-    public static final int SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES = 1;
-    /** @hide */
-    public static final int SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES = 2;
-
     final IInputMethodManager mService;
     final Looper mMainLooper;
     
@@ -1897,28 +1890,9 @@ public final class InputMethodManager {
         }
     }
 
-    /**
-     * Shows the input method chooser dialog.
-     *
-     * @param showAuxiliarySubtypes Set true to show auxiliary input methods.
-     * @hide
-     */
-    public void showInputMethodPicker(boolean showAuxiliarySubtypes) {
-        synchronized (mH) {
-            try {
-                final int mode = showAuxiliarySubtypes ?
-                        SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES:
-                        SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES;
-                mService.showInputMethodPickerFromClient(mClient, mode);
-            } catch (RemoteException e) {
-                Log.w(TAG, "IME died: " + mCurId, e);
-            }
-        }
-    }
-
     private void showInputMethodPickerLocked() {
         try {
-            mService.showInputMethodPickerFromClient(mClient, SHOW_IM_PICKER_MODE_AUTO);
+            mService.showInputMethodPickerFromClient(mClient);
         } catch (RemoteException e) {
             Log.w(TAG, "IME died: " + mCurId, e);
         }
index ce94727..52485dd 100644 (file)
@@ -196,7 +196,7 @@ public class InputMethodSubtypeSwitchingController {
         }
 
         public List<ImeSubtypeListItem> getSortedInputMethodAndSubtypeList(
-                boolean showSubtypes, boolean includeAuxiliarySubtypes, boolean isScreenLocked) {
+                boolean showSubtypes, boolean inputShown, boolean isScreenLocked) {
             final ArrayList<ImeSubtypeListItem> imList =
                     new ArrayList<ImeSubtypeListItem>();
             final HashMap<InputMethodInfo, List<InputMethodSubtype>> immis =
@@ -205,12 +205,6 @@ public class InputMethodSubtypeSwitchingController {
             if (immis == null || immis.size() == 0) {
                 return Collections.emptyList();
             }
-            if (isScreenLocked && includeAuxiliarySubtypes) {
-                if (DEBUG) {
-                    Slog.w(TAG, "Auxiliary subtypes are not allowed to be shown in lock screen.");
-                }
-                includeAuxiliarySubtypes = false;
-            }
             mSortedImmis.clear();
             mSortedImmis.putAll(immis);
             for (InputMethodInfo imi : mSortedImmis.keySet()) {
@@ -233,7 +227,7 @@ public class InputMethodSubtypeSwitchingController {
                         final String subtypeHashCode = String.valueOf(subtype.hashCode());
                         // We show all enabled IMEs and subtypes when an IME is shown.
                         if (enabledSubtypeSet.contains(subtypeHashCode)
-                                && (includeAuxiliarySubtypes || !subtype.isAuxiliary())) {
+                                && ((inputShown && !isScreenLocked) || !subtype.isAuxiliary())) {
                             final CharSequence subtypeLabel =
                                     subtype.overridesImplicitlyEnabledSubtype() ? null : subtype
                                             .getDisplayName(mContext, imi.getPackageName(),
@@ -522,8 +516,8 @@ public class InputMethodSubtypeSwitchingController {
     }
 
     public List<ImeSubtypeListItem> getSortedInputMethodAndSubtypeListLocked(boolean showSubtypes,
-            boolean includingAuxiliarySubtypes, boolean isScreenLocked) {
+            boolean inputShown, boolean isScreenLocked) {
         return mSubtypeList.getSortedInputMethodAndSubtypeList(
-                showSubtypes, includingAuxiliarySubtypes, isScreenLocked);
+                showSubtypes, inputShown, isScreenLocked);
     }
 }
index 60c5e42..6f104dd 100644 (file)
@@ -59,8 +59,7 @@ interface IInputMethodManager {
             int controlFlags, int softInputMode, int windowFlags,
             in EditorInfo attribute, IInputContext inputContext);
 
-    void showInputMethodPickerFromClient(in IInputMethodClient client,
-            int auxiliarySubtypeMode);
+    void showInputMethodPickerFromClient(in IInputMethodClient client);
     void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId);
     void setInputMethod(in IBinder token, String id);
     void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype);
index 929258d..845d53a 100644 (file)
@@ -162,8 +162,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
             switchImeButton.setOnClickListener(new OnClickListener() {
                 public void onClick(View v) {
                     mCallback.userActivity(); // Leave the screen on a bit longer
-                    // Do not show auxiliary subtypes in password lock screen.
-                    mImm.showInputMethodPicker(false /* showAuxiliarySubtypes */);
+                    mImm.showInputMethodPicker();
                 }
             });
         }
index 7077a17..c62ad66 100644 (file)
@@ -144,7 +144,7 @@ public class NavigationBarView extends LinearLayout {
         @Override
         public void onClick(View view) {
             ((InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE))
-                    .showInputMethodPicker(true /* showAuxiliarySubtypes */);
+                    .showInputMethodPicker();
         }
     };
 
index 759a6be..45909db 100644 (file)
@@ -2238,8 +2238,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
     }
 
     @Override
-    public void showInputMethodPickerFromClient(
-            IInputMethodClient client, int auxiliarySubtypeMode) {
+    public void showInputMethodPickerFromClient(IInputMethodClient client) {
         if (!calledFromValidUser()) {
             return;
         }
@@ -2252,8 +2251,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
 
             // Always call subtype picker, because subtype picker is a superset of input method
             // picker.
-            mHandler.sendMessage(mCaller.obtainMessageI(
-                    MSG_SHOW_IM_SUBTYPE_PICKER, auxiliarySubtypeMode));
+            mHandler.sendEmptyMessage(MSG_SHOW_IM_SUBTYPE_PICKER);
         }
     }
 
@@ -2599,25 +2597,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
         SomeArgs args;
         switch (msg.what) {
             case MSG_SHOW_IM_SUBTYPE_PICKER:
-                final boolean showAuxSubtypes;
-                switch (msg.arg1) {
-                    case InputMethodManager.SHOW_IM_PICKER_MODE_AUTO:
-                        // This is undocumented so far, but IMM#showInputMethodPicker() has been
-                        // implemented so that auxiliary subtypes will be excluded when the soft
-                        // keyboard is invisible.
-                        showAuxSubtypes = mInputShown;
-                        break;
-                    case InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES:
-                        showAuxSubtypes = true;
-                        break;
-                    case InputMethodManager.SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES:
-                        showAuxSubtypes = false;
-                        break;
-                    default:
-                        Slog.e(TAG, "Unknown subtype picker mode = " + msg.arg1);
-                        return false;
-                }
-                showInputMethodMenu(showAuxSubtypes);
+                showInputMethodMenu();
                 return true;
 
             case MSG_SHOW_IM_SUBTYPE_ENABLER:
@@ -2900,8 +2880,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                 && mKeyguardManager.isKeyguardLocked() && mKeyguardManager.isKeyguardSecure();
     }
 
-    private void showInputMethodMenu(boolean showAuxSubtypes) {
-        if (DEBUG) Slog.v(TAG, "Show switching menu. showAuxSubtypes=" + showAuxSubtypes);
+    private void showInputMethodMenu() {
+        if (DEBUG) Slog.v(TAG, "Show switching menu");
 
         final Context context = mContext;
         final boolean isScreenLocked = isScreenLocked();
@@ -2922,7 +2902,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
 
             final List<ImeSubtypeListItem> imList =
                     mSwitchingController.getSortedInputMethodAndSubtypeListLocked(
-                            true /* showSubtypes */, showAuxSubtypes, isScreenLocked);
+                            true /* showSubtypes */, mInputShown, isScreenLocked);
 
             if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) {
                 final InputMethodSubtype currentSubtype = getCurrentInputMethodSubtypeLocked();