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

Commit 82ae3ff4 authored by Mikael Gullstrand's avatar Mikael Gullstrand Committed by Zoran Jovanovic
Browse files

Call startInput on return from sleep mode

One manifestation of the problem was that input string disappeared when
returning from sleep mode. When editing a TextView with an IME in
landscape orientation, the text would disappear when returning from
sleep mode. The InputMethodManager would be deactivated when the screen
was put into sleep mode as well as the input connection. However when
returning from sleep mode the InputMethodManager was activated, but the
input connection would not be activated again.

The solution is to check focus of the InputMethodManager
which will create a new active input connection to use.

The change is however not specific to this one problem but fundamentally
addresses the issue of lack of startInput on return from sleep mode.

Change-Id: I95d05110bc1cf310fad23ea1bcbc5890f642d1fc
parent fc545733
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -494,12 +494,11 @@ public final class InputMethodManager {
                                mIInputContext.finishComposingText();
                            } catch (RemoteException e) {
                            }
                        }
                        // Check focus again in case that "onWindowFocus" is called before
                        // handling this message.
                        if (mServedView != null && mServedView.hasWindowFocus()) {
                                // "finishComposingText" has been already called above. So we
                                // should not call mServedInputConnection.finishComposingText here.
                                // Also, please note that this handler thread could be different
                            // Please note that this handler thread could be different
                            // from a thread that created mServedView. That could happen
                            // the current activity is running in the system process.
                            // In that case, we really should not call
@@ -509,7 +508,6 @@ public final class InputMethodManager {
                            }
                        }
                    }
                    }
                    return;
                }
                case MSG_SEND_INPUT_EVENT: {