diff options
| author | 2022-07-28 23:51:39 +0000 | |
|---|---|---|
| committer | 2022-07-28 23:51:39 +0000 | |
| commit | dd1483a69c5feafaf8c764d36d4264f961dc68e5 (patch) | |
| tree | 9b0ad2fcc1ddf0eac8f2f7c6037bece3d2af6505 | |
| parent | 622f67e870cf0d44d027c4787e2bfe9d630395fd (diff) | |
| parent | d3f1cdffa596ecd5b8d58645f9ac67e8a4a17ec9 (diff) | |
Merge "Make a copy for draw transaction of local window" into tm-qpr-dev am: 0897c09ee7 am: d3f1cdffa5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19429367
Change-Id: Ic6c9c94faffafbc3b493fb9bca029a8653e22284
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/wm/AsyncRotationController.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java index 1898cc65b107..219092baface 100644 --- a/services/core/java/com/android/server/wm/AsyncRotationController.java +++ b/services/core/java/com/android/server/wm/AsyncRotationController.java @@ -204,11 +204,8 @@ 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(). And check why - // the local window might easily time out. - final WindowState w = token.getChildAt(j); - if (w.isClientLocal()) continue; - w.applyWithNextDraw(t -> {}); + // TODO(b/234585256): The consumer should be handleFinishDrawing(). + token.getChildAt(j).applyWithNextDraw(t -> {}); } } mIsSyncDrawRequested = true; @@ -484,7 +481,16 @@ class AsyncRotationController extends FadeAnimationController implements Consume if (op == null) return false; if (DEBUG) Slog.d(TAG, "handleFinishDrawing " + w); if (op.mDrawTransaction == null) { - op.mDrawTransaction = postDrawTransaction; + if (w.isClientLocal()) { + // Use a new transaction to merge the draw transaction of local window because the + // same instance will be cleared (Transaction#clear()) after reporting draw. + op.mDrawTransaction = mService.mTransactionFactory.get(); + op.mDrawTransaction.merge(postDrawTransaction); + } else { + // The transaction read from parcel (the client is in a different process) is + // already a copy, so just reference it directly. + op.mDrawTransaction = postDrawTransaction; + } } else { op.mDrawTransaction.merge(postDrawTransaction); } |