summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2018-09-05 17:07:52 -0700
committer Yohei Yukawa <yukawa@google.com> 2018-09-05 17:07:52 -0700
commitb985e6e24589f1b92f11e30e1c821560bf73d9d9 (patch)
tree2e50cf4266eee93a4d92cebcc67e456755094b78
parent97614b4693dceb2d23f6e7655e4697deabf643e3 (diff)
Add TODO about IMM#getInputMethodWindowVisibleHeight()
InputMethodManager#getInputMethodWindowVisibleHeight() has been kind of unintentionally exposed to all the IME client processes and we know some apps are already relying on this hidden API via reflection, which is bad especially because it would be getting harder and harder to keep maintaining the semantics of this not-well-defined hidden API once we start supporting features like multi display. Thust this CL adds TODO comments there to warn people who are going to touch this method. This CL does nothing except for adding comments. Hence there should be no behavior change. Bug: 113914148 Test: compile Change-Id: Id2084530bdb82deef226d8207d2f311d2e78b28d
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java8
-rw-r--r--core/java/com/android/internal/view/IInputMethodManager.aidl2
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java8
3 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index d3fd0cfc0b22..0ecd09fa8d71 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -2333,7 +2333,13 @@ public final class InputMethodManager {
}
/**
- * @return The current height of the input method window.
+ * This is kept due to {@link android.annotation.UnsupportedAppUsage}.
+ *
+ * <p>TODO(Bug 113914148): Check if we can remove this. We have accidentally exposed
+ * WindowManagerInternal#getInputMethodWindowVisibleHeight to app developers and some of them
+ * started relying on it.</p>
+ *
+ * @return Something that is not well-defined.
* @hide
*/
@UnsupportedAppUsage
diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl
index 4b004e2952b9..09ccf67a775e 100644
--- a/core/java/com/android/internal/view/IInputMethodManager.aidl
+++ b/core/java/com/android/internal/view/IInputMethodManager.aidl
@@ -79,6 +79,8 @@ interface IInputMethodManager {
boolean switchToNextInputMethod(in IBinder token, boolean onlyCurrentIme);
boolean shouldOfferSwitchingToNextInputMethod(in IBinder token);
void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
+ // This is kept due to @UnsupportedAppUsage.
+ // TODO(Bug 113914148): Consider removing this.
int getInputMethodWindowVisibleHeight();
void clearLastInputMethodWindowForTransition(in IBinder token);
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 4d3468e21e75..e8f6382bec38 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -3145,6 +3145,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
return;
}
+ /**
+ * This is kept due to {@link android.annotation.UnsupportedAppUsage} in
+ * {@link InputMethodManager#getInputMethodWindowVisibleHeight()} and a dependency in
+ * {@link InputMethodService#onCreate()}.
+ *
+ * <p>TODO(Bug 113914148): Check if we can remove this.</p>
+ * @return {@link WindowManagerInternal#getInputMethodWindowVisibleHeight()}
+ */
@Override
public int getInputMethodWindowVisibleHeight() {
return mWindowManagerInternal.getInputMethodWindowVisibleHeight();