Set MediaController floating window token.

This enables using MediaController within SurfaceControlViewHost embedded view.

Bug: 256993334
Test: presubmits
Change-Id: I68a65f147efe1f18fbafa7bee9bb8f440aa18bb3
This commit is contained in:
Patrick Williams
2022-12-14 11:46:26 -06:00
parent b6bb3b656b
commit 742227ca69

View File

@@ -218,6 +218,7 @@ public class MediaController extends FrameLayout {
p.width = mAnchor.getWidth();
p.x = anchorPos[0] + (mAnchor.getWidth() - p.width) / 2;
p.y = anchorPos[1] + mAnchor.getHeight() - mDecor.getMeasuredHeight();
p.token = mAnchor.getWindowToken();
}
// This is called whenever mAnchor's layout bound changes