From 3bf26b6f2f7fcf47346f55f4e712f4b846393ab1 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Fri, 11 Oct 2013 13:16:23 -0400 Subject: [PATCH] Ensure fitSystemWindows is called on the IME at least once. InputMethodService will recreate the entire layout on config changes. Until the system insets change again, the new instance will not hear about the insets. This change ensures fitSystemWindows is called at least once for all input method root views that are added to a window. Bug:11174545 Change-Id: Id0f02f32c0d6e9c2d6b6aeef74a12a13acfbb9e6 --- .../com/android/internal/inputmethod/InputMethodRoot.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/java/com/android/internal/inputmethod/InputMethodRoot.java b/core/java/com/android/internal/inputmethod/InputMethodRoot.java index 40a424bcdd92f..eddea99f92890 100644 --- a/core/java/com/android/internal/inputmethod/InputMethodRoot.java +++ b/core/java/com/android/internal/inputmethod/InputMethodRoot.java @@ -39,6 +39,12 @@ public class InputMethodRoot extends LinearLayout { super(context, attrs); } + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + requestFitSystemWindows(); + } + @Override protected boolean fitSystemWindows(Rect insets) { if (mNavigationGuard == null) {