summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2021-03-15 18:06:55 -0700
committer Yohei Yukawa <yukawa@google.com> 2021-03-15 18:06:55 -0700
commit2487cabc7dec0daafce898d1e6ec10a7be349765 (patch)
treed9436a048b7e5211b3bd4597ff38e1c0776e4a29
parentb4dfa621f7b8e4f16efb9532b8936dc174f9ea6c (diff)
Rename #updateInputMethodWindowStatus() to #setDismissImeOnBackKeyPressed()
This is a purely mechanical method renaming. There should be no behavior chagne. To summarize, WindowManagerInternal#updateInputMethodWindowStatus() should be renamed to WindowManagerInternal#setDismissImeOnBackKeyPressed() and this CL actually does so with also removing unused parameters. The method in question was originally added by me for the true-IME-target-window project [1] at Bug 34628091 then updated to propagate one more boolean value from InputMethodManagerService to PhoneWindowManager to address a feature request from Wear team [2] at Bug 33824860. After that, we also introduced another method WindowManagerInternal#updateInputMethodTargetWindow() for the true-IME-target-window project [3] and that's what we ended up having relied on. Given that #updateInputMethodWindowStatus() is used only for Bug 33824860 to propagate "dismissImeOnBackKeyPressed" parameter from IMMS to PhoneWindowManager, it'd make more sense to rename its method name as well. [1]: I54fb1faf513883a54293a756e4c9d2ae9453d778 69e68024220d3f18b08cbb314c7991f8f76cbe49 [2]: I20721547c73360a70b5fc5cbe06824d577d1768a d6475a682d9651a651f60856baef9b17b4633b13 [3]: I032b91ce722a16b17518a5d88015c574d7d3e51b 99e1f6e04b63a4d85f42fda292001e8b77060093 Bug: 171827834 Test: presubmit Change-Id: I3b32d43615453d94d5df1565fe1ce81dc08526de
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java3
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerInternal.java13
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java3
3 files changed, 4 insertions, 15 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index e9c3ec392d38..ffb532ebcca4 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -2923,8 +2923,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
dismissImeOnBackKeyPressed = ((vis & InputMethodService.IME_VISIBLE) != 0);
break;
}
- mWindowManagerInternal.updateInputMethodWindowStatus(token,
- (vis & InputMethodService.IME_VISIBLE) != 0, dismissImeOnBackKeyPressed);
+ mWindowManagerInternal.setDismissImeOnBackKeyPressed(dismissImeOnBackKeyPressed);
}
@BinderThread
diff --git a/services/core/java/com/android/server/wm/WindowManagerInternal.java b/services/core/java/com/android/server/wm/WindowManagerInternal.java
index 53ebfb2c6e0e..8148f15981b3 100644
--- a/services/core/java/com/android/server/wm/WindowManagerInternal.java
+++ b/services/core/java/com/android/server/wm/WindowManagerInternal.java
@@ -451,24 +451,15 @@ public abstract class WindowManagerInternal {
public abstract int getInputMethodWindowVisibleHeight(int displayId);
/**
- * Notifies WindowManagerService that the current IME window status is being changed.
+ * Notifies WindowManagerService that the expected back-button behavior might have changed.
*
* <p>Only {@link com.android.server.inputmethod.InputMethodManagerService} is the expected and
* tested caller of this method.</p>
*
- * @param imeToken token to track the active input method. Corresponding IME windows can be
- * identified by checking {@link android.view.WindowManager.LayoutParams#token}.
- * Note that there is no guarantee that the corresponding window is already
- * created
- * @param imeWindowVisible whether the active IME thinks that its window should be visible or
- * hidden, no matter how WindowManagerService will react / has reacted
- * to corresponding API calls. Note that this state is not guaranteed
- * to be synchronized with state in WindowManagerService.
* @param dismissImeOnBackKeyPressed {@code true} if the software keyboard is shown and the back
* key is expected to dismiss the software keyboard.
*/
- public abstract void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
- boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed);
+ public abstract void setDismissImeOnBackKeyPressed(boolean dismissImeOnBackKeyPressed);
/**
* Notifies WindowManagerService that the current IME window status is being changed.
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index f0dc7fe08c66..bb1bbbdaf7f6 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -7713,8 +7713,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
@Override
- public void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
- boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed) {
+ public void setDismissImeOnBackKeyPressed(boolean dismissImeOnBackKeyPressed) {
mPolicy.setDismissImeOnBackKeyPressed(dismissImeOnBackKeyPressed);
}