Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 896dc787 authored by Yabin Huang's avatar Yabin Huang Committed by Android (Google) Code Review
Browse files

Merge "Rename hideCurrentInputMethod() and pass a display ID" into main

parents 6ba83fe8 553a5a6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ interface IStatusBarService
    void onNotificationSettingsViewed(String key);
    void onNotificationBubbleChanged(String key, boolean isBubble, int flags);
    void onBubbleMetadataFlagChanged(String key, int flags);
    void hideCurrentInputMethodForBubbles();
    void hideCurrentInputMethodForBubbles(int displayId);
    void grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName);
    oneway void clearInlineReplyUriPermissions(String key);
    void onNotificationFeedbackReceived(String key, in Bundle feedback);
+2 −1
Original line number Diff line number Diff line
@@ -553,8 +553,9 @@ public class BubbleController implements ConfigurationChangeListener,
     * Hides the current input method, wherever it may be focused, via InputMethodManagerInternal.
     */
    void hideCurrentInputMethod() {
        int displayId = mWindowManager.getDefaultDisplay().getDisplayId();
        try {
            mBarService.hideCurrentInputMethodForBubbles();
            mBarService.hideCurrentInputMethodForBubbles(displayId);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.Pair;
import android.util.SparseArray;
import android.view.Display;
import android.view.IWindowManager;
import android.view.View;
import android.view.ViewTreeObserver;
@@ -337,6 +338,8 @@ public class BubblesTest extends SysuiTestCase {
    private NotifPipelineFlags mNotifPipelineFlags;
    @Mock
    private Icon mAppBubbleIcon;
    @Mock
    private Display mDefaultDisplay;

    private final SceneTestUtils mUtils = new SceneTestUtils(this);
    private final TestScope mTestScope = mUtils.getTestScope();
@@ -378,6 +381,7 @@ public class BubblesTest extends SysuiTestCase {
        when(mColorExtractor.getNeutralColors()).thenReturn(mGradientColors);
        when(mNotificationShadeWindowView.getViewTreeObserver())
                .thenReturn(mock(ViewTreeObserver.class));
        when(mWindowManager.getDefaultDisplay()).thenReturn(mDefaultDisplay);


        FakeDeviceProvisioningRepository deviceProvisioningRepository =
+8 −3
Original line number Diff line number Diff line
@@ -56,9 +56,13 @@ public abstract class InputMethodManagerInternal {
    public abstract void setInteractive(boolean interactive);

    /**
     * Hides the current input method, if visible.
     * Hides the input methods for all the users, if visible.
     *
     * @param reason               the reason for hiding the current input method
     * @param originatingDisplayId the display ID the request is originated
     */
    public abstract void hideCurrentInputMethod(@SoftInputShowHideReason int reason);
    public abstract void hideAllInputMethods(@SoftInputShowHideReason int reason,
            int originatingDisplayId);

    /**
     * Returns the list of installed input methods for the specified user.
@@ -210,7 +214,8 @@ public abstract class InputMethodManagerInternal {
                }

                @Override
                public void hideCurrentInputMethod(@SoftInputShowHideReason int reason) {
                public void hideAllInputMethods(@SoftInputShowHideReason int reason,
                        int originatingDisplayId) {
                }

                @Override
+6 −5
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub

    private static final int MSG_SHOW_IM_SUBTYPE_PICKER = 1;

    private static final int MSG_HIDE_CURRENT_INPUT_METHOD = 1035;
    private static final int MSG_HIDE_ALL_INPUT_METHODS = 1035;
    private static final int MSG_REMOVE_IME_SURFACE = 1060;
    private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061;
    private static final int MSG_UPDATE_IME_WINDOW_STATUS = 1070;
@@ -4835,7 +4835,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub

            // ---------------------------------------------------------

            case MSG_HIDE_CURRENT_INPUT_METHOD:
            case MSG_HIDE_ALL_INPUT_METHODS:
                synchronized (ImfLock.class) {
                    final @SoftInputShowHideReason int reason = (int) msg.obj;
                    hideCurrentInputLocked(mCurFocusedWindow, null /* statsToken */, 0 /* flags */,
@@ -5591,9 +5591,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        }

        @Override
        public void hideCurrentInputMethod(@SoftInputShowHideReason int reason) {
            mHandler.removeMessages(MSG_HIDE_CURRENT_INPUT_METHOD);
            mHandler.obtainMessage(MSG_HIDE_CURRENT_INPUT_METHOD, reason).sendToTarget();
        public void hideAllInputMethods(@SoftInputShowHideReason int reason,
                int originatingDisplayId) {
            mHandler.removeMessages(MSG_HIDE_ALL_INPUT_METHODS);
            mHandler.obtainMessage(MSG_HIDE_ALL_INPUT_METHODS, reason).sendToTarget();
        }

        @Override
Loading