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

Commit 98ad74a3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix IME icon flicker when switching apps" into sc-dev am: 9e9caac6 am: 9cc367d1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14779650

Change-Id: Ia4e0cb0960b1767a8c746736ab5c975c659af465
parents 07c6be5b 9cc367d1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -126,8 +126,10 @@ public abstract class InputMethodManagerInternal {

    /**
     * Updates the IME visibility, back disposition and show IME picker status for SystemUI.
     * TODO(b/189923292): Making SystemUI to be true IME icon controller vs. presenter that
     *     controlled by IMMS.
     */
    public abstract void updateImeWindowStatus();
    public abstract void updateImeWindowStatus(boolean disableImeIcon);

    /**
     * Fake implementation of {@link InputMethodManagerInternal}.  All the methods do nothing.
@@ -182,7 +184,7 @@ public abstract class InputMethodManagerInternal {
                }

                @Override
                public void updateImeWindowStatus() {
                public void updateImeWindowStatus(boolean disableImeIcon) {
                }
            };

+10 −7
Original line number Diff line number Diff line
@@ -2862,11 +2862,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    private void updateImeWindowStatus() {
    private void updateImeWindowStatus(boolean disableImeIcon) {
        synchronized (mMethodMap) {
            if (disableImeIcon) {
                updateSystemUiLocked(0, mBackDisposition);
            } else {
                updateSystemUiLocked();
            }
        }
    }

    void updateSystemUiLocked() {
        updateSystemUiLocked(mImeWindowVis, mBackDisposition);
@@ -4413,9 +4417,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                return true;
            }
            case MSG_UPDATE_IME_WINDOW_STATUS: {
                synchronized (mMethodMap) {
                    updateSystemUiLocked();
                }
                updateImeWindowStatus(msg.arg1 == 1);
                return true;
            }
            // ---------------------------------------------------------
@@ -5085,9 +5087,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }

        @Override
        public void updateImeWindowStatus() {
        public void updateImeWindowStatus(boolean disableImeIcon) {
            mService.mHandler.sendMessage(
                    mService.mHandler.obtainMessage(MSG_UPDATE_IME_WINDOW_STATUS));
                    mService.mHandler.obtainMessage(MSG_UPDATE_IME_WINDOW_STATUS,
                            disableImeIcon ? 1 : 0, 0));
        }
    }

+4 −4
Original line number Diff line number Diff line
@@ -261,12 +261,12 @@ public class InputMethodMenuController {
            mSwitchingDialog.dismiss();
            mSwitchingDialog = null;
            mSwitchingDialogTitleView = null;
        }

            mService.updateSystemUiLocked();
            mDialogBuilder = null;
            mIms = null;
        }
    }

    HardKeyboardListener getHardKeyboardListener() {
        return mHardKeyboardListener;
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ public final class MultiClientInputMethodManagerService {
                        }

                        @Override
                        public void updateImeWindowStatus() {
                        public void updateImeWindowStatus(boolean disableImeIcon) {
                        }
                    });
        }
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ class KeyguardController {
        // state when evaluating visibilities.
        updateKeyguardSleepToken();
        mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
        InputMethodManagerInternal.get().updateImeWindowStatus();
        InputMethodManagerInternal.get().updateImeWindowStatus(false /* disableImeIcon */);
    }

    /**
Loading