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

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

Make sure to obtain the IC before requesting CursorAnchorInfo

RichInputConnection#requestUpdateCursorAnchorInfo must make
sure to obtain the input connection before calling methods
of it.

BUG: 17299587
Change-Id: I8e0cd473a4cc32583cd47634c227d702f7c69c6c
parent 37beaf15
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -924,8 +924,14 @@ public final class RichInputConnection {
     */
    public boolean requestUpdateCursorAnchorInfo(final boolean enableMonitor,
            final boolean requestImmediateCallback) {
        final boolean scheduled = InputConnectionCompatUtils.requestUpdateCursorAnchorInfo(mIC,
        mIC = mParent.getCurrentInputConnection();
        final boolean scheduled;
        if (null != mIC) {
            scheduled = InputConnectionCompatUtils.requestUpdateCursorAnchorInfo(mIC,
                    enableMonitor, requestImmediateCallback);
        } else {
            scheduled = false;
        }
        mCursorAnchorInfoMonitorEnabled = (scheduled && enableMonitor);
        return scheduled;
    }