Fix drag shadow does not render on screen when perform drag (1/2)

The drag shadow had been drawn in app process, we have to call
`DragState.updateDragSufraceLocked` so it could update the current
location and apply drag state's transaction directly.

Bug: 217279780
Test: atest DragDropTest
Change-Id: I97e74252e98cac0e6941bed58c8a64ae68cb6132
This commit is contained in:
Arthur Hung
2022-02-10 04:30:39 +00:00
parent 9950dab656
commit 741f63b4ec

View File

@@ -179,11 +179,9 @@ class DragDropController {
final SurfaceControl.Transaction transaction = mDragState.mTransaction;
transaction.setAlpha(surfaceControl, mDragState.mOriginalAlpha);
transaction.setPosition(
surfaceControl, touchX - thumbCenterX, touchY - thumbCenterY);
transaction.show(surfaceControl);
displayContent.reparentToOverlay(transaction, surfaceControl);
callingWin.scheduleAnimation();
mDragState.updateDragSurfaceLocked(true, touchX, touchY);
if (SHOW_LIGHT_TRANSACTIONS) {
Slog.i(TAG_WM, "<<< CLOSE TRANSACTION performDrag");
}