summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2024-10-17 03:25:04 +0000
committer Riddle Hsu <riddlehsu@google.com> 2024-10-17 04:31:48 +0000
commit6fb9caf5fdf4b5b48117faff9f0ce8264e44458c (patch)
tree41ddf3ef9d03c5ad532ad0d2d93399fc64aa8513
parent6dcdf8bc8162c6510409004e38aa3854d2084979 (diff)
Always allow updating config from input during booting
There could be pending CONFIG_SCREEN_LAYOUT change (unrelated to input), which was sent by the way from the callback. If it is skipped by no input device changes, the change may send on next time when a change is detected. But that may run on main thread rather than input reader thread, which could delay boot time. Bug: 373067702 Flag: com.android.window.flags.filter_irrelevant_input_device_change Test: BootTimeTest Change-Id: I2c569793b926aadd17fd07b688bdeed44ab82539
-rw-r--r--services/core/java/com/android/server/wm/InputManagerCallback.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/InputManagerCallback.java b/services/core/java/com/android/server/wm/InputManagerCallback.java
index a4fe0647ea79..9d21183c6c03 100644
--- a/services/core/java/com/android/server/wm/InputManagerCallback.java
+++ b/services/core/java/com/android/server/wm/InputManagerCallback.java
@@ -131,7 +131,9 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal
final boolean changed = !com.android.window.flags.Flags.filterIrrelevantInputDeviceChange()
|| updateLastInputConfigurationSources();
- if (changed) {
+ // Even if the input devices are not changed, there could be other pending changes
+ // during booting. It's fine to apply earlier.
+ if (changed || !mService.mDisplayEnabled) {
synchronized (mService.mGlobalLock) {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "inputDeviceConfigChanged");
mService.mRoot.forAllDisplays(DisplayContent::sendNewConfiguration);