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

Commit 1514b047 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Inline IMMS#MSG_UPDATE_IME_WINDOW_STATUS handler" into main

parents 19f4d1a9 88174908
Loading
Loading
Loading
Loading
+14 −17
Original line number Original line Diff line number Diff line
@@ -258,7 +258,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    private static final int MSG_HIDE_ALL_INPUT_METHODS = 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 = 1060;
    private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061;
    private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061;
    private static final int MSG_UPDATE_IME_WINDOW_STATUS = 1070;


    private static final int MSG_RESET_HANDWRITING = 1090;
    private static final int MSG_RESET_HANDWRITING = 1090;
    private static final int MSG_START_HANDWRITING = 1100;
    private static final int MSG_START_HANDWRITING = 1100;
@@ -2743,9 +2742,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }
        }
    }
    }


    private void updateImeWindowStatus(boolean disableImeIcon) {
    @GuardedBy("ImfLock.class")
        synchronized (ImfLock.class) {
    private void updateImeWindowStatusLocked(boolean disableImeIcon, int displayId) {
            // TODO(b/350386877): Propagate userId from the caller.
        // TODO(b/350386877): Propagate userId from displayId.
        final int userId = mCurrentUserId;
        final int userId = mCurrentUserId;
        if (disableImeIcon) {
        if (disableImeIcon) {
            final var bindingController = getInputMethodBindingController(userId);
            final var bindingController = getInputMethodBindingController(userId);
@@ -2754,7 +2753,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            updateSystemUiLocked(userId);
            updateSystemUiLocked(userId);
        }
        }
    }
    }
    }


    // Caution! This method is called in this class. Handle multi-user carefully
    // Caution! This method is called in this class. Handle multi-user carefully
    @GuardedBy("ImfLock.class")
    @GuardedBy("ImfLock.class")
@@ -5092,10 +5090,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                }
                }
                return true;
                return true;
            }
            }
            case MSG_UPDATE_IME_WINDOW_STATUS: {
                updateImeWindowStatus(msg.arg1 == 1);
                return true;
            }


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


@@ -5925,8 +5919,11 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        @ImfLockFree
        @ImfLockFree
        @Override
        @Override
        public void updateImeWindowStatus(boolean disableImeIcon, int displayId) {
        public void updateImeWindowStatus(boolean disableImeIcon, int displayId) {
            mHandler.obtainMessage(MSG_UPDATE_IME_WINDOW_STATUS, disableImeIcon ? 1 : 0, 0)
            mHandler.post(() -> {
                    .sendToTarget();
                synchronized (ImfLock.class) {
                    updateImeWindowStatusLocked(disableImeIcon, displayId);
                }
            });
        }
        }


        @Override
        @Override