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

Commit e1fa64a7 authored by Taran Singh's avatar Taran Singh
Browse files

Update EditorInfo if servedView's orientation changes

IME's fullscreen mode relies on app's orientation. This info may be out
of date in EditorInfo post orientation change. this CL calls
restartInput to update editorInfo.

Fix: 193202504
Test: CtsInputMethodTestCases
Change-Id: I0b87a6fb73182a08ab7486255e5d26ec1ee4e85c
parent 73588b3f
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -567,6 +567,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private float mShadowDy;
    private float mShadowDy;
    private int mShadowColor;
    private int mShadowColor;
    private int mLastOrientation;
    private boolean mPreDrawRegistered;
    private boolean mPreDrawRegistered;
    private boolean mPreDrawListenerDetached;
    private boolean mPreDrawListenerDetached;
@@ -1193,6 +1195,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        mBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
        mBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
        mHyphenationFrequency = Layout.HYPHENATION_FREQUENCY_NONE;
        mHyphenationFrequency = Layout.HYPHENATION_FREQUENCY_NONE;
        mJustificationMode = Layout.JUSTIFICATION_MODE_NONE;
        mJustificationMode = Layout.JUSTIFICATION_MODE_NONE;
        mLastOrientation = getResources().getConfiguration().orientation;
        final Resources.Theme theme = context.getTheme();
        final Resources.Theme theme = context.getTheme();
@@ -4591,6 +4594,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            mFontWeightAdjustment = newConfig.fontWeightAdjustment;
            mFontWeightAdjustment = newConfig.fontWeightAdjustment;
            setTypeface(getTypeface());
            setTypeface(getTypeface());
        }
        }
        InputMethodManager imm = getInputMethodManager();
        // if orientation changed and this TextView is currently served.
        if (mLastOrientation != newConfig.orientation
                && imm != null && imm.hasActiveInputConnection(this)) {
            // EditorInfo.internalImeOptions are out of date.
            imm.restartInput(this);
        }
        mLastOrientation = newConfig.orientation;
    }
    }
    /**
    /**