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

Commit 47cd377e authored by Antonio Kantek's avatar Antonio Kantek Committed by Android (Google) Code Review
Browse files

Merge "Clean up InputMethodService" into main

parents a23f2c00 e0f6c226
Loading
Loading
Loading
Loading
+12 −22
Original line number Diff line number Diff line
@@ -650,8 +650,6 @@ public class InputMethodService extends AbstractInputMethodService {

    private InlineSuggestionSessionController mInlineSuggestionSessionController;

    private boolean mHideNavBarForKeyboard;
    private boolean mIsAutomotive;
    private @NonNull OptionalInt mHandwritingRequestId = OptionalInt.empty();
    private InputEventReceiver mHandwritingEventReceiver;
    private Handler mHandler;
@@ -1622,7 +1620,7 @@ public class InputMethodService extends AbstractInputMethodService {
        // shown the first time (cold start).
        mSettingsObserver.shouldShowImeWithHardKeyboard();

        mHideNavBarForKeyboard = getApplicationContext().getResources().getBoolean(
        final boolean hideNavBarForKeyboard = getApplicationContext().getResources().getBoolean(
                com.android.internal.R.bool.config_hideNavBarForKeyboard);

        initConfigurationTracker();
@@ -1668,7 +1666,7 @@ public class InputMethodService extends AbstractInputMethodService {
            // screen real estate. When this happens, the IME window should animate from the
            // bottom of the screen to reduce the jank that happens from the lack of synchronization
            // between the bottom system window and the IME window.
            if (mHideNavBarForKeyboard) {
            if (hideNavBarForKeyboard) {
                window.setDecorFitsSystemWindows(false);
            }
        }
@@ -2366,9 +2364,7 @@ public class InputMethodService extends AbstractInputMethodService {

    public void setExtractView(View view) {
        mExtractFrame.removeAllViews();
        mExtractFrame.addView(view, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        mExtractFrame.addView(view, new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
        mExtractView = view;
        if (view != null) {
            mExtractEditText = view.findViewById(
@@ -2396,9 +2392,7 @@ public class InputMethodService extends AbstractInputMethodService {
     */
    public void setCandidatesView(View view) {
        mCandidatesFrame.removeAllViews();
        mCandidatesFrame.addView(view, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        mCandidatesFrame.addView(view, new FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
    }

    /**
@@ -2409,9 +2403,7 @@ public class InputMethodService extends AbstractInputMethodService {
     */
    public void setInputView(View view) {
        mInputFrame.removeAllViews();
        mInputFrame.addView(view, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        mInputFrame.addView(view, new FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
        mInputView = view;
    }

@@ -3448,6 +3440,9 @@ public class InputMethodService extends AbstractInputMethodService {
        return false;
    }

    /**
     * Not implemented in this class.
     */
    public void onAppPrivateCommand(String action, Bundle data) {
    }

@@ -4092,11 +4087,6 @@ public class InputMethodService extends AbstractInputMethodService {
                | (isInputViewShown() ? IME_VISIBLE : 0);
    }

    private boolean isAutomotive() {
        return getApplicationContext().getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_AUTOMOTIVE);
    }

    /**
     * Performs a dump of the InputMethodService's internal state.  Override
     * to add your own information to the dump.