diff options
-rw-r--r-- | core/java/android/view/SurfaceControl.java | 3 | ||||
-rw-r--r-- | tests/CtsSurfaceControlTestsStaging/src/main/java/android/view/surfacecontroltests/SurfaceControlPictureProfileTest.java | 12 |
2 files changed, 6 insertions, 9 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index dd9a95e58bd1..f22505b80948 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -4671,8 +4671,7 @@ public final class SurfaceControl implements Parcelable { * Sets the importance the layer's contents has to the app's user experience. * <p> * When a two layers within the same app are competing for a limited rendering resource, - * the priority will determine which layer gets access to the resource. The lower the - * priority, the more likely the layer will get access to the resource. + * the layer with the highest priority will gets access to the resource. * <p> * Resources managed by this priority: * <ul> diff --git a/tests/CtsSurfaceControlTestsStaging/src/main/java/android/view/surfacecontroltests/SurfaceControlPictureProfileTest.java b/tests/CtsSurfaceControlTestsStaging/src/main/java/android/view/surfacecontroltests/SurfaceControlPictureProfileTest.java index 135f7102b8a9..9ac08ed449fd 100644 --- a/tests/CtsSurfaceControlTestsStaging/src/main/java/android/view/surfacecontroltests/SurfaceControlPictureProfileTest.java +++ b/tests/CtsSurfaceControlTestsStaging/src/main/java/android/view/surfacecontroltests/SurfaceControlPictureProfileTest.java @@ -203,12 +203,10 @@ public class SurfaceControlPictureProfileTest { transaction .setBuffer(mSurfaceControls[i], buffer) .setPictureProfileHandle(mSurfaceControls[i], handle) - .setContentPriority(mSurfaceControls[i], 0); + .setContentPriority(mSurfaceControls[i], 1); } - // Make the first layer low priority (high value) - transaction.setContentPriority(mSurfaceControls[0], 2); - // Make the last layer higher priority (lower value) - transaction.setContentPriority(mSurfaceControls[maxPictureProfiles], 1); + transaction.setContentPriority(mSurfaceControls[0], -1); + transaction.setContentPriority(mSurfaceControls[maxPictureProfiles], 0); transaction.apply(); pictures = pollMs(picturesQueue, 200); @@ -219,8 +217,8 @@ public class SurfaceControlPictureProfileTest { assertThat(stream(pictures).map(picture -> picture.getPictureProfileHandle().getId())) .containsExactlyElementsIn(toIterableRange(2, maxPictureProfiles + 1)); - // Change priority and ensure that the first layer gets access - new SurfaceControl.Transaction().setContentPriority(mSurfaceControls[0], 0).apply(); + // Elevate priority for the first layer and verify it gets to use a profile + new SurfaceControl.Transaction().setContentPriority(mSurfaceControls[0], 2).apply(); pictures = pollMs(picturesQueue, 200); assertThat(pictures).isNotNull(); // Expect all but the last layer to be listed as an active picture |