From fc7a1b5b34ad15bee492deab8123d7a548c8b8b3 Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Wed, 16 Jun 2021 20:26:34 +0800 Subject: Migrate InputMethodService to WindowProviderService Also introduce IWindowManager#getDisplayIdToLaunchIme to make IMS be aware of the launched display to prevent extra onConfigurationChanged callback Bug: 149463653 Test: atest MultiDisplaySystemDecorationTests CtsInputMethodTestCases Test: atest ContextTest ContextIsUiContextTest Test: manual - moving IME between 2 displays and displayArea within display - config change received Test: manual - the app to show IME crashed and focus is set to the next task - no config change Change-Id: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b --- core/java/android/inputmethodservice/InputMethodService.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 881e0cfb58d7..18c6256dff80 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -629,10 +629,13 @@ public class InputMethodService extends AbstractInputMethodService { throw new IllegalStateException( "attachToken() must be called at most once. token=" + token); } + attachToWindowToken(token); mToken = token; mWindow.setToken(token); } + // TODO(b/149463653): remove updateInputMethodDisplay(int displayId) since we'll get the + // right display by attachToWindowToken /** * {@inheritDoc} * @hide -- cgit v1.2.3