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

Commit b985e6e2 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
parent 97614b46
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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);

+8 −0
Original line number Diff line number Diff line
@@ -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();