diff options
author | Robert Carr <racarr@google.com> | 2019-12-18 00:38:40 -0800 |
---|---|---|
committer | Robert Carr <racarr@google.com> | 2019-12-30 20:59:39 -0800 |
commit | 59b1888bb95544a57e29d8a3c29960087d9f7ae9 (patch) | |
tree | 2eb97f0fcc30e78b07890fa084f254e9976c01c3 /tests | |
parent | f06d584d39723ed4ddfb326c256d67121d5e5d5a (diff) |
Rename WindowlessViewRoot to SurfaceControlViewHost and rework API
Should be a little more clear. The internal IWindowSession implementation
keeps the WindowlessWindowManager name, but the API section definitely
needs a more usable name. Instead of passing in a root Surface we want it
to be owned by the SurfaceControlViewHost itself. This way we can ensure
we only return a SurfacePackage. In follow up CLs we will add an
accessibility ID to the SurfacePackage so we can ensure the Control
is passed around with the accessibility ID.
Test: Builds
Bug: 134365580
Change-Id: I30520e8b169d3744a66ccedf61cc4515cfef4dee
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SurfaceControlViewHostTest/Android.bp (renamed from tests/WindowlessWmTest/Android.bp) | 2 | ||||
-rw-r--r-- | tests/SurfaceControlViewHostTest/AndroidManifest.xml (renamed from tests/WindowlessWmTest/AndroidManifest.xml) | 2 | ||||
-rw-r--r-- | tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java (renamed from tests/WindowlessWmTest/src/com/android/test/viewembed/WindowlessWmTest.java) | 13 |
3 files changed, 11 insertions, 6 deletions
diff --git a/tests/WindowlessWmTest/Android.bp b/tests/SurfaceControlViewHostTest/Android.bp index 2ace3f363ef9..e4e060010eea 100644 --- a/tests/WindowlessWmTest/Android.bp +++ b/tests/SurfaceControlViewHostTest/Android.bp @@ -15,7 +15,7 @@ // android_test { - name: "WindowlessWmTest", + name: "SurfaceControlViewHostTest", srcs: ["**/*.java"], platform_apis: true, certificate: "platform", diff --git a/tests/WindowlessWmTest/AndroidManifest.xml b/tests/SurfaceControlViewHostTest/AndroidManifest.xml index babfd76d91e8..ee95763453f7 100644 --- a/tests/WindowlessWmTest/AndroidManifest.xml +++ b/tests/SurfaceControlViewHostTest/AndroidManifest.xml @@ -16,7 +16,7 @@ package="com.android.test.viewembed"> <application> - <activity android:name="WindowlessWmTest" android:label="View Embedding Test"> + <activity android:name="SurfaceControlViewHostTest" android:label="View Embedding Test"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> diff --git a/tests/WindowlessWmTest/src/com/android/test/viewembed/WindowlessWmTest.java b/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java index 5c1e830e1382..6687f83ad0db 100644 --- a/tests/WindowlessWmTest/src/com/android/test/viewembed/WindowlessWmTest.java +++ b/tests/SurfaceControlViewHostTest/src/com/android/test/viewembed/SurfaceControlViewHostTest.java @@ -22,18 +22,19 @@ import android.graphics.Color; import android.graphics.PixelFormat; import android.os.Bundle; import android.view.Gravity; +import android.view.SurfaceControl; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.WindowManager; -import android.view.WindowlessViewRoot; +import android.view.SurfaceControlViewHost; import android.widget.Button; import android.widget.FrameLayout; -public class WindowlessWmTest extends Activity implements SurfaceHolder.Callback{ +public class SurfaceControlViewHostTest extends Activity implements SurfaceHolder.Callback{ SurfaceView mView; - WindowlessViewRoot mVr; + SurfaceControlViewHost mVr; protected void onCreate(Bundle savedInstanceState) { FrameLayout content = new FrameLayout(this); @@ -49,8 +50,12 @@ public class WindowlessWmTest extends Activity implements SurfaceHolder.Callback @Override public void surfaceCreated(SurfaceHolder holder) { - mVr = new WindowlessViewRoot(this, this.getDisplay(), mView.getSurfaceControl(), + mVr = new SurfaceControlViewHost(this, this.getDisplay(), mView.getInputToken()); + + final SurfaceControl.Transaction t = new SurfaceControl.Transaction(); + t.reparent(mVr.getSurfacePackage().getSurfaceControl(), mView.getSurfaceControl()).apply(); + Button v = new Button(this); v.setBackgroundColor(Color.BLUE); v.setOnClickListener(new View.OnClickListener() { |