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
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java
index 0af0462..1898cc6 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 @@
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;