File tree Expand file tree Collapse file tree
core/java/com/android/server/wm
tests/wmtests/src/com/android/server/wm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1595,9 +1595,9 @@ void onActivityParentChanged(WindowContainer<?> parent) {
15951595 FIRST_OPAQUE_NOT_FINISHING_ACTIVITY_PREDICATE /* callback */ ,
15961596 mActivityRecord /* boundary */ , false /* includeBoundary */ ,
15971597 true /* traverseTopToBottom */ );
1598- if (firstOpaqueActivityBeneath == null ) {
1598+ if (firstOpaqueActivityBeneath == null || firstOpaqueActivityBeneath . isEmbedded () ) {
15991599 // We skip letterboxing if the translucent activity doesn't have any opaque
1600- // activities beneath
1600+ // activities beneath or the activity below is embedded which never has letterbox.
16011601 return ;
16021602 }
16031603 inheritConfiguration (firstOpaqueActivityBeneath );
Original file line number Diff line number Diff line change @@ -475,7 +475,25 @@ public void testApplyStrategyToMultipleTranslucentActivities() {
475475 }
476476
477477 @ Test
478- public void testTranslucentActivitiesDontGoInSizeCompatMode () {
478+ public void testNotApplyStrategyToTranslucentActivitiesOverEmbeddedActivities () {
479+ mWm .mLetterboxConfiguration .setTranslucentLetterboxingOverrideEnabled (true );
480+ setUpDisplaySizeWithApp (2000 , 1000 );
481+ mActivity .info .screenOrientation = SCREEN_ORIENTATION_PORTRAIT ;
482+ mActivity .mDisplayContent .setIgnoreOrientationRequest (true /* ignoreOrientationRequest */ );
483+ // Mock the activity as embedded without additional TaskFragment layer in the task for
484+ // simplicity.
485+ doReturn (true ).when (mActivity ).isEmbedded ();
486+ // Translucent Activity
487+ final ActivityRecord translucentActivity = new ActivityBuilder (mAtm ).build ();
488+ doReturn (false ).when (translucentActivity ).matchParentBounds ();
489+ doReturn (false ).when (translucentActivity ).fillsParent ();
490+ mTask .addChild (translucentActivity );
491+ // Check the strategy has not being applied
492+ assertFalse (translucentActivity .mLetterboxUiController .hasInheritedLetterboxBehavior ());
493+ }
494+
495+ @ Test
496+ public void testTranslucentActivitiesDontGoInSizeCompactMode () {
479497 mWm .mLetterboxConfiguration .setTranslucentLetterboxingOverrideEnabled (true );
480498 setUpDisplaySizeWithApp (2800 , 1400 );
481499 mActivity .mDisplayContent .setIgnoreOrientationRequest (true /* ignoreOrientationRequest */ );
You can’t perform that action at this time.
0 commit comments