diff options
author | Robert Carr <racarr@google.com> | 2019-12-18 01:46:04 -0800 |
---|---|---|
committer | Robert Carr <racarr@google.com> | 2020-01-21 22:24:54 -0800 |
commit | 30ad618cfef9dd7fad12b14d7e0bdadb5d68cb82 (patch) | |
tree | e891d1f080b44ffc6a3bff70af67c2f5e53cc890 /tests/SurfaceControlViewHostTest/src | |
parent | e68e6deb3e7e59994b0306064dd49c93af81d542 (diff) |
SurfaceView: Add reparentSurfacePackage method
For use with SurfaceControlViewHost. Currently this just performs a reparent
but it's future use is to also automatically link the accessibility IDs
of the embedded content and the SurfaceView.
Test: No test, to unblock accessibility team. Builds.
Bug: 134365580
Change-Id: I990c0f29b439ed6e6f18bdfa4be2c1d46f502503
Diffstat (limited to 'tests/SurfaceControlViewHostTest/src')
-rw-r--r-- | tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java b/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java index 6687f83ad0db..4c8221c813b4 100644 --- a/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java +++ b/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java @@ -46,15 +46,15 @@ public class SurfaceControlViewHostTest extends Activity implements SurfaceHolde mView.setZOrderOnTop(true); mView.getHolder().addCallback(this); + + addEmbeddedView(); } - @Override - public void surfaceCreated(SurfaceHolder holder) { + void addEmbeddedView() { mVr = new SurfaceControlViewHost(this, this.getDisplay(), mView.getInputToken()); - final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); - t.reparent(mVr.getSurfacePackage().getSurfaceControl(), mView.getSurfaceControl()).apply(); + mView.setChildSurfacePackage(mVr.getSurfacePackage()); Button v = new Button(this); v.setBackgroundColor(Color.BLUE); @@ -70,6 +70,10 @@ public class SurfaceControlViewHostTest extends Activity implements SurfaceHolde } @Override + public void surfaceCreated(SurfaceHolder holder) { + } + + @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { Canvas canvas = holder.lockCanvas(); canvas.drawColor(Color.GREEN); |