Loading services/core/java/com/android/server/wm/LetterboxUiController.java +2 −3 Original line number Diff line number Diff line Loading @@ -1146,10 +1146,9 @@ final class LetterboxUiController { final ActivityRecord firstOpaqueActivityBeneath = mActivityRecord.getTask().getActivity( ActivityRecord::fillsParent, mActivityRecord, false /* includeBoundary */, true /* traverseTopToBottom */); if (firstOpaqueActivityBeneath == null || mActivityRecord.launchedFromUid != firstOpaqueActivityBeneath.getUid()) { if (firstOpaqueActivityBeneath == null) { // We skip letterboxing if the translucent activity doesn't have any opaque // activities beneath of if it's launched from a different user (e.g. notification) // activities beneath return; } inheritConfiguration(firstOpaqueActivityBeneath); Loading services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +0 −21 Original line number Diff line number Diff line Loading @@ -196,27 +196,6 @@ public class SizeCompatTests extends WindowTestsBase { assertEquals(1.5f, translucentActivity.getMaxAspectRatio(), 0.00001f); } @Test public void testNotApplyStrategyToTranslucentActivitiesWithDifferentUid() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2000, 1000); prepareUnresizable(mActivity, 1.5f /* maxAspect */, SCREEN_ORIENTATION_PORTRAIT); mActivity.info.setMinAspectRatio(1.2f); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); // Translucent Activity final ActivityRecord translucentActivity = new ActivityBuilder(mAtm) .setScreenOrientation(SCREEN_ORIENTATION_LANDSCAPE) .setMinAspectRatio(1.1f) .setMaxAspectRatio(3f) .build(); doReturn(false).when(translucentActivity).fillsParent(); mTask.addChild(translucentActivity); // We check bounds final Rect opaqueBounds = mActivity.getConfiguration().windowConfiguration.getBounds(); final Rect translucentRequestedBounds = translucentActivity.getRequestedOverrideBounds(); assertNotEquals(opaqueBounds, translucentRequestedBounds); } @Test public void testApplyStrategyToMultipleTranslucentActivities() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); Loading Loading
services/core/java/com/android/server/wm/LetterboxUiController.java +2 −3 Original line number Diff line number Diff line Loading @@ -1146,10 +1146,9 @@ final class LetterboxUiController { final ActivityRecord firstOpaqueActivityBeneath = mActivityRecord.getTask().getActivity( ActivityRecord::fillsParent, mActivityRecord, false /* includeBoundary */, true /* traverseTopToBottom */); if (firstOpaqueActivityBeneath == null || mActivityRecord.launchedFromUid != firstOpaqueActivityBeneath.getUid()) { if (firstOpaqueActivityBeneath == null) { // We skip letterboxing if the translucent activity doesn't have any opaque // activities beneath of if it's launched from a different user (e.g. notification) // activities beneath return; } inheritConfiguration(firstOpaqueActivityBeneath); Loading
services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +0 −21 Original line number Diff line number Diff line Loading @@ -196,27 +196,6 @@ public class SizeCompatTests extends WindowTestsBase { assertEquals(1.5f, translucentActivity.getMaxAspectRatio(), 0.00001f); } @Test public void testNotApplyStrategyToTranslucentActivitiesWithDifferentUid() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2000, 1000); prepareUnresizable(mActivity, 1.5f /* maxAspect */, SCREEN_ORIENTATION_PORTRAIT); mActivity.info.setMinAspectRatio(1.2f); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); // Translucent Activity final ActivityRecord translucentActivity = new ActivityBuilder(mAtm) .setScreenOrientation(SCREEN_ORIENTATION_LANDSCAPE) .setMinAspectRatio(1.1f) .setMaxAspectRatio(3f) .build(); doReturn(false).when(translucentActivity).fillsParent(); mTask.addChild(translucentActivity); // We check bounds final Rect opaqueBounds = mActivity.getConfiguration().windowConfiguration.getBounds(); final Rect translucentRequestedBounds = translucentActivity.getRequestedOverrideBounds(); assertNotEquals(opaqueBounds, translucentRequestedBounds); } @Test public void testApplyStrategyToMultipleTranslucentActivities() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); Loading