From 821ebf219930b460d4dac20cd0a1a82a12eca0c8 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Thu, 21 Jul 2022 21:35:28 -0600 Subject: [PATCH] Skip syncing local window for rotation with shell transition The RenderThread might be blocked by waiting for free buffer. Then it will also block the ui thread of "Pointer location", which is "android.ui". And then watchdog will restart the system because the important thread is no response. This is a temporal workaround to unblock test. It is rare that system shows a window. So this doesn't affect common use cases. Bug: 234585256 Test: adb shell setprop persist.wm.debug.shell_transit 1; reboot Enable "Pointer location" in developer options. Rotate display many times and no watchdog timeout. Change-Id: I414a2c670aebb78a0418f550015e420eed5f25f4 --- .../com/android/server/wm/AsyncRotationController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java index 0af046281cc52..1898cc65b1078 100644 --- a/services/core/java/com/android/server/wm/AsyncRotationController.java +++ b/services/core/java/com/android/server/wm/AsyncRotationController.java @@ -204,8 +204,11 @@ class AsyncRotationController extends FadeAnimationController implements Consume for (int i = mTargetWindowTokens.size() - 1; i >= 0; i--) { final WindowToken token = mTargetWindowTokens.keyAt(i); for (int j = token.getChildCount() - 1; j >= 0; j--) { - // TODO(b/234585256): The consumer should be handleFinishDrawing(). - token.getChildAt(j).applyWithNextDraw(t -> {}); + // TODO(b/234585256): The consumer should be handleFinishDrawing(). And check why + // the local window might easily time out. + final WindowState w = token.getChildAt(j); + if (w.isClientLocal()) continue; + w.applyWithNextDraw(t -> {}); } } mIsSyncDrawRequested = true;