From 7234a64355adaea72f566e15cdca62eefd7e6515 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 --- .../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 7ea7cf1cd0155..4379a334e840d 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -223,6 +223,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; @@ -6396,6 +6397,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,