Loading services/core/java/com/android/server/wm/LetterboxUiController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1595,9 +1595,9 @@ final class LetterboxUiController { FIRST_OPAQUE_NOT_FINISHING_ACTIVITY_PREDICATE /* callback */, mActivityRecord /* boundary */, false /* includeBoundary */, true /* traverseTopToBottom */); if (firstOpaqueActivityBeneath == null) { if (firstOpaqueActivityBeneath == null || firstOpaqueActivityBeneath.isEmbedded()) { // We skip letterboxing if the translucent activity doesn't have any opaque // activities beneath // activities beneath or the activity below is embedded which never has letterbox. return; } inheritConfiguration(firstOpaqueActivityBeneath); Loading services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +19 −1 Original line number Diff line number Diff line Loading @@ -475,7 +475,25 @@ public class SizeCompatTests extends WindowTestsBase { } @Test public void testTranslucentActivitiesDontGoInSizeCompatMode() { public void testNotApplyStrategyToTranslucentActivitiesOverEmbeddedActivities() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2000, 1000); mActivity.info.screenOrientation = SCREEN_ORIENTATION_PORTRAIT; mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); // Mock the activity as embedded without additional TaskFragment layer in the task for // simplicity. doReturn(true).when(mActivity).isEmbedded(); // Translucent Activity final ActivityRecord translucentActivity = new ActivityBuilder(mAtm).build(); doReturn(false).when(translucentActivity).matchParentBounds(); doReturn(false).when(translucentActivity).fillsParent(); mTask.addChild(translucentActivity); // Check the strategy has not being applied assertFalse(translucentActivity.mLetterboxUiController.hasInheritedLetterboxBehavior()); } @Test public void testTranslucentActivitiesDontGoInSizeCompactMode() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2800, 1400); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); Loading Loading
services/core/java/com/android/server/wm/LetterboxUiController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1595,9 +1595,9 @@ final class LetterboxUiController { FIRST_OPAQUE_NOT_FINISHING_ACTIVITY_PREDICATE /* callback */, mActivityRecord /* boundary */, false /* includeBoundary */, true /* traverseTopToBottom */); if (firstOpaqueActivityBeneath == null) { if (firstOpaqueActivityBeneath == null || firstOpaqueActivityBeneath.isEmbedded()) { // We skip letterboxing if the translucent activity doesn't have any opaque // activities beneath // activities beneath or the activity below is embedded which never has letterbox. return; } inheritConfiguration(firstOpaqueActivityBeneath); Loading
services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +19 −1 Original line number Diff line number Diff line Loading @@ -475,7 +475,25 @@ public class SizeCompatTests extends WindowTestsBase { } @Test public void testTranslucentActivitiesDontGoInSizeCompatMode() { public void testNotApplyStrategyToTranslucentActivitiesOverEmbeddedActivities() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2000, 1000); mActivity.info.screenOrientation = SCREEN_ORIENTATION_PORTRAIT; mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); // Mock the activity as embedded without additional TaskFragment layer in the task for // simplicity. doReturn(true).when(mActivity).isEmbedded(); // Translucent Activity final ActivityRecord translucentActivity = new ActivityBuilder(mAtm).build(); doReturn(false).when(translucentActivity).matchParentBounds(); doReturn(false).when(translucentActivity).fillsParent(); mTask.addChild(translucentActivity); // Check the strategy has not being applied assertFalse(translucentActivity.mLetterboxUiController.hasInheritedLetterboxBehavior()); } @Test public void testTranslucentActivitiesDontGoInSizeCompactMode() { mWm.mLetterboxConfiguration.setTranslucentLetterboxingOverrideEnabled(true); setUpDisplaySizeWithApp(2800, 1400); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); Loading