Loading services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +17 −5 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Slog; import android.view.Display; import android.view.WindowManager; import android.view.inputmethod.InputMethod; import android.view.inputmethod.InputMethodInfo; Loading Loading @@ -78,6 +79,7 @@ final class InputMethodBindingController { @GuardedBy("ImfLock.class") @Nullable private IInputMethodInvoker mCurMethod; @GuardedBy("ImfLock.class") private int mCurMethodUid = Process.INVALID_UID; @GuardedBy("ImfLock.class") @Nullable private IBinder mCurToken; @GuardedBy("ImfLock.class") private int mCurTokenDisplayId = Display.INVALID_DISPLAY; @GuardedBy("ImfLock.class") private int mCurSeq; @GuardedBy("ImfLock.class") private boolean mVisibleBound; @GuardedBy("ImfLock.class") private boolean mSupportsStylusHw; Loading Loading @@ -192,6 +194,17 @@ final class InputMethodBindingController { return mCurToken; } /** * Returns the displayId associated with {@link #getCurToken()}. * * @return the displayId associated with {@link #getCurToken()}. {@link Display#INVALID_DISPLAY} * while {@link #getCurToken()} returns {@code null} */ @GuardedBy("ImfLock.class") int getCurTokenDisplayId() { return mCurTokenDisplayId; } /** * The Intent used to connect to the current input method. */ Loading Loading @@ -412,15 +425,14 @@ final class InputMethodBindingController { @GuardedBy("ImfLock.class") private void removeCurrentToken() { int curTokenDisplayId = mService.getCurTokenDisplayIdLocked(); if (DEBUG) { Slog.v(TAG, "Removing window token: " + mCurToken + " for display: " + curTokenDisplayId); "Removing window token: " + mCurToken + " for display: " + mCurTokenDisplayId); } mWindowManagerInternal.removeWindowToken(mCurToken, true /* removeWindows */, false /* animateExit */, curTokenDisplayId); false /* animateExit */, mCurTokenDisplayId); mCurToken = null; mCurTokenDisplayId = Display.INVALID_DISPLAY; } @GuardedBy("ImfLock.class") Loading @@ -445,7 +457,7 @@ final class InputMethodBindingController { final int displayIdToShowIme = mService.getDisplayIdToShowImeLocked(); mCurToken = new Binder(); mService.setCurTokenDisplayIdLocked(displayIdToShowIme); mCurTokenDisplayId = displayIdToShowIme; if (DEBUG) { Slog.v(TAG, "Adding window token: " + mCurToken + " for display: " + displayIdToShowIme); Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +2 −11 Original line number Diff line number Diff line Loading @@ -603,18 +603,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. */ @GuardedBy("ImfLock.class") int getCurTokenDisplayIdLocked() { return mCurTokenDisplayId; } @GuardedBy("ImfLock.class") void setCurTokenDisplayIdLocked(int curTokenDisplayId) { mCurTokenDisplayId = curTokenDisplayId; final var userData = mUserDataRepository.getOrCreate(mCurrentUserId); return userData.mBindingController.getCurTokenDisplayId(); } @GuardedBy("ImfLock.class") @MultiUserUnawareField private int mCurTokenDisplayId = INVALID_DISPLAY; /** * The display ID of the input method indicates the fallback display which returned by * {@link #computeImeDisplayIdForTarget}. Loading Loading @@ -2405,7 +2397,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mImeWindowVis = 0; mBackDisposition = InputMethodService.BACK_DISPOSITION_DEFAULT; updateSystemUiLocked(mImeWindowVis, mBackDisposition); mCurTokenDisplayId = INVALID_DISPLAY; mAutofillController.onResetSystemUi(); } Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodBindingController.java +17 −5 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Slog; import android.view.Display; import android.view.WindowManager; import android.view.inputmethod.InputMethod; import android.view.inputmethod.InputMethodInfo; Loading Loading @@ -78,6 +79,7 @@ final class InputMethodBindingController { @GuardedBy("ImfLock.class") @Nullable private IInputMethodInvoker mCurMethod; @GuardedBy("ImfLock.class") private int mCurMethodUid = Process.INVALID_UID; @GuardedBy("ImfLock.class") @Nullable private IBinder mCurToken; @GuardedBy("ImfLock.class") private int mCurTokenDisplayId = Display.INVALID_DISPLAY; @GuardedBy("ImfLock.class") private int mCurSeq; @GuardedBy("ImfLock.class") private boolean mVisibleBound; @GuardedBy("ImfLock.class") private boolean mSupportsStylusHw; Loading Loading @@ -192,6 +194,17 @@ final class InputMethodBindingController { return mCurToken; } /** * Returns the displayId associated with {@link #getCurToken()}. * * @return the displayId associated with {@link #getCurToken()}. {@link Display#INVALID_DISPLAY} * while {@link #getCurToken()} returns {@code null} */ @GuardedBy("ImfLock.class") int getCurTokenDisplayId() { return mCurTokenDisplayId; } /** * The Intent used to connect to the current input method. */ Loading Loading @@ -412,15 +425,14 @@ final class InputMethodBindingController { @GuardedBy("ImfLock.class") private void removeCurrentToken() { int curTokenDisplayId = mService.getCurTokenDisplayIdLocked(); if (DEBUG) { Slog.v(TAG, "Removing window token: " + mCurToken + " for display: " + curTokenDisplayId); "Removing window token: " + mCurToken + " for display: " + mCurTokenDisplayId); } mWindowManagerInternal.removeWindowToken(mCurToken, true /* removeWindows */, false /* animateExit */, curTokenDisplayId); false /* animateExit */, mCurTokenDisplayId); mCurToken = null; mCurTokenDisplayId = Display.INVALID_DISPLAY; } @GuardedBy("ImfLock.class") Loading @@ -445,7 +457,7 @@ final class InputMethodBindingController { final int displayIdToShowIme = mService.getDisplayIdToShowImeLocked(); mCurToken = new Binder(); mService.setCurTokenDisplayIdLocked(displayIdToShowIme); mCurTokenDisplayId = displayIdToShowIme; if (DEBUG) { Slog.v(TAG, "Adding window token: " + mCurToken + " for display: " + displayIdToShowIme); Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +2 −11 Original line number Diff line number Diff line Loading @@ -603,18 +603,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. */ @GuardedBy("ImfLock.class") int getCurTokenDisplayIdLocked() { return mCurTokenDisplayId; } @GuardedBy("ImfLock.class") void setCurTokenDisplayIdLocked(int curTokenDisplayId) { mCurTokenDisplayId = curTokenDisplayId; final var userData = mUserDataRepository.getOrCreate(mCurrentUserId); return userData.mBindingController.getCurTokenDisplayId(); } @GuardedBy("ImfLock.class") @MultiUserUnawareField private int mCurTokenDisplayId = INVALID_DISPLAY; /** * The display ID of the input method indicates the fallback display which returned by * {@link #computeImeDisplayIdForTarget}. Loading Loading @@ -2405,7 +2397,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. mImeWindowVis = 0; mBackDisposition = InputMethodService.BACK_DISPOSITION_DEFAULT; updateSystemUiLocked(mImeWindowVis, mBackDisposition); mCurTokenDisplayId = INVALID_DISPLAY; mAutofillController.onResetSystemUi(); } Loading