From 5df4951c1f8f9c73b8af38d650c92505bcd7c43b Mon Sep 17 00:00:00 2001 From: lumark Date: Tue, 2 Apr 2019 14:56:46 +0800 Subject: [PATCH] Don't update process-level configutaion for MSIME process Currently, process-level display configuration change for IME process is only for single-client IME window moving to another display to update UI layout according display configuration. It's not applicable for MSIME use case since other IMEs on other displays will also receive this configuration change due to IME services use the same application config/context, so add a check to fix this issue. Fix: 129723692 Test: atest MultiDisplaySystemDecorationTests Test: manual 1. Enable config_perDisplayFocusEnabled config, 2. Install MultiClientInputMethod app 3. Set multi client IME component by "adb shell setprop persist.debug.multi_client_ime \ com.example.android.multiclientinputmethod/.MultiClientInputMethod" 4. Reboot device to initiate MultiClientInputMethod 5. In Settings -> developer options -> Enable Simulated display & Force desktop mode. 6. Reboot device to enable multi-display test environment. 7. In primary & external display, launch app with EditText. 8. Focus EditText in both displays and see if keyboard can displayed with correct layout. Change-Id: Ic556ca212d285de183e3709b032427d5d97e0623 (cherry picked from commit 7234a64355adaea72f566e15cdca62eefd7e6515) --- .../com/android/server/wm/ActivityTaskManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index b64abdb48fba3..10ae78297a41d 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -224,6 +224,7 @@ import android.view.IRecentsAnimationRunner; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationDefinition; import android.view.WindowManager; +import android.view.inputmethod.InputMethodSystemProperty; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; @@ -6436,6 +6437,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { */ @Override public void onImeWindowSetOnDisplay(final int pid, final int displayId) { + // Update display configuration for IME process only when Single-client IME window + // moving to another display. + if (!InputMethodSystemProperty.MULTI_CLIENT_IME_ENABLED) return; + if (pid == MY_PID || pid < 0) { if (DEBUG_CONFIGURATION) { Slog.w(TAG,