Loading core/java/android/window/flags/large_screen_experiences_app_compat.aconfig +0 −10 Original line number Diff line number Diff line package: "com.android.window.flags" container: "system" flag { name: "disable_thin_letterboxing_policy" namespace: "large_screen_experiences_app_compat" description: "Whether reachability is disabled in case of thin letterboxing" bug: "341027847" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "allows_screen_size_decoupled_from_status_bar_and_cutout" namespace: "large_screen_experiences_app_compat" Loading services/core/java/com/android/server/wm/AppCompatReachabilityOverrides.java +4 −12 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import android.annotation.NonNull; import android.content.res.Configuration; import android.graphics.Rect; import com.android.window.flags.Flags; /** * Encapsulate overrides and configurations about app compat reachability. */ Loading Loading @@ -157,33 +155,27 @@ class AppCompatReachabilityOverrides { } /** * @return {@value true} if the vertical reachability should be allowed in case of * @return {@code true} if the vertical reachability should be allowed in case of * thin letterboxing. */ boolean allowVerticalReachabilityForThinLetterbox() { if (!Flags.disableThinLetterboxingPolicy()) { return true; } // When the flag is enabled we allow vertical reachability only if the // app is not thin letterboxed vertically. return !isVerticalThinLetterboxed(); } /** * @return {@value true} if the horizontal reachability should be enabled in case of * @return {@code true} if the horizontal reachability should be enabled in case of * thin letterboxing. */ boolean allowHorizontalReachabilityForThinLetterbox() { if (!Flags.disableThinLetterboxingPolicy()) { return true; } // When the flag is enabled we allow horizontal reachability only if the // app is not thin pillarboxed. return !isHorizontalThinLetterboxed(); } /** * @return {@value true} if the resulting app is letterboxed in a way defined as thin. * @return {@code true} if the resulting app is letterboxed in a way defined as thin. */ boolean isVerticalThinLetterboxed() { final int thinHeight = mAppCompatConfiguration.getThinLetterboxHeightPx(); Loading @@ -200,7 +192,7 @@ class AppCompatReachabilityOverrides { } /** * @return {@value true} if the resulting app is pillarboxed in a way defined as thin. * @return {@code true} if the resulting app is pillarboxed in a way defined as thin. */ boolean isHorizontalThinLetterboxed() { final int thinWidth = mAppCompatConfiguration.getThinLetterboxWidthPx(); Loading services/tests/wmtests/src/com/android/server/wm/AppCompatReachabilityOverridesTest.java +1 −24 Original line number Diff line number Diff line Loading @@ -23,14 +23,10 @@ import static org.mockito.Mockito.spy; import android.compat.testing.PlatformCompatChangeRule; import android.graphics.Rect; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import androidx.annotation.NonNull; import com.android.window.flags.Flags; import junit.framework.Assert; import org.junit.Rule; Loading Loading @@ -125,8 +121,7 @@ public class AppCompatReachabilityOverridesTest extends WindowTestsBase { } @Test @EnableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY) public void testAllowReachabilityForThinLetterboxWithFlagEnabled() { public void testAllowReachabilityForThinLetterbox_disableForThinLetterboxing() { runTestScenario((robot) -> { robot.activity().createActivityWithComponent(); Loading @@ -142,24 +137,6 @@ public class AppCompatReachabilityOverridesTest extends WindowTestsBase { }); } @Test @DisableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY) public void testAllowReachabilityForThinLetterboxWithFlagDisabled() { runTestScenario((robot) -> { robot.activity().createActivityWithComponent(); robot.configureIsVerticalThinLetterboxed(/* isThin */ true); robot.checkAllowVerticalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsHorizontalThinLetterboxed(/* isThin */ true); robot.checkAllowHorizontalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsVerticalThinLetterboxed(/* isThin */ false); robot.checkAllowVerticalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsHorizontalThinLetterboxed(/* isThin */ false); robot.checkAllowHorizontalReachabilityForThinLetterbox(/* expected */ true); }); } /** * Runs a test scenario providing a Robot. */ Loading Loading
core/java/android/window/flags/large_screen_experiences_app_compat.aconfig +0 −10 Original line number Diff line number Diff line package: "com.android.window.flags" container: "system" flag { name: "disable_thin_letterboxing_policy" namespace: "large_screen_experiences_app_compat" description: "Whether reachability is disabled in case of thin letterboxing" bug: "341027847" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "allows_screen_size_decoupled_from_status_bar_and_cutout" namespace: "large_screen_experiences_app_compat" Loading
services/core/java/com/android/server/wm/AppCompatReachabilityOverrides.java +4 −12 Original line number Diff line number Diff line Loading @@ -35,8 +35,6 @@ import android.annotation.NonNull; import android.content.res.Configuration; import android.graphics.Rect; import com.android.window.flags.Flags; /** * Encapsulate overrides and configurations about app compat reachability. */ Loading Loading @@ -157,33 +155,27 @@ class AppCompatReachabilityOverrides { } /** * @return {@value true} if the vertical reachability should be allowed in case of * @return {@code true} if the vertical reachability should be allowed in case of * thin letterboxing. */ boolean allowVerticalReachabilityForThinLetterbox() { if (!Flags.disableThinLetterboxingPolicy()) { return true; } // When the flag is enabled we allow vertical reachability only if the // app is not thin letterboxed vertically. return !isVerticalThinLetterboxed(); } /** * @return {@value true} if the horizontal reachability should be enabled in case of * @return {@code true} if the horizontal reachability should be enabled in case of * thin letterboxing. */ boolean allowHorizontalReachabilityForThinLetterbox() { if (!Flags.disableThinLetterboxingPolicy()) { return true; } // When the flag is enabled we allow horizontal reachability only if the // app is not thin pillarboxed. return !isHorizontalThinLetterboxed(); } /** * @return {@value true} if the resulting app is letterboxed in a way defined as thin. * @return {@code true} if the resulting app is letterboxed in a way defined as thin. */ boolean isVerticalThinLetterboxed() { final int thinHeight = mAppCompatConfiguration.getThinLetterboxHeightPx(); Loading @@ -200,7 +192,7 @@ class AppCompatReachabilityOverrides { } /** * @return {@value true} if the resulting app is pillarboxed in a way defined as thin. * @return {@code true} if the resulting app is pillarboxed in a way defined as thin. */ boolean isHorizontalThinLetterboxed() { final int thinWidth = mAppCompatConfiguration.getThinLetterboxWidthPx(); Loading
services/tests/wmtests/src/com/android/server/wm/AppCompatReachabilityOverridesTest.java +1 −24 Original line number Diff line number Diff line Loading @@ -23,14 +23,10 @@ import static org.mockito.Mockito.spy; import android.compat.testing.PlatformCompatChangeRule; import android.graphics.Rect; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import androidx.annotation.NonNull; import com.android.window.flags.Flags; import junit.framework.Assert; import org.junit.Rule; Loading Loading @@ -125,8 +121,7 @@ public class AppCompatReachabilityOverridesTest extends WindowTestsBase { } @Test @EnableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY) public void testAllowReachabilityForThinLetterboxWithFlagEnabled() { public void testAllowReachabilityForThinLetterbox_disableForThinLetterboxing() { runTestScenario((robot) -> { robot.activity().createActivityWithComponent(); Loading @@ -142,24 +137,6 @@ public class AppCompatReachabilityOverridesTest extends WindowTestsBase { }); } @Test @DisableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY) public void testAllowReachabilityForThinLetterboxWithFlagDisabled() { runTestScenario((robot) -> { robot.activity().createActivityWithComponent(); robot.configureIsVerticalThinLetterboxed(/* isThin */ true); robot.checkAllowVerticalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsHorizontalThinLetterboxed(/* isThin */ true); robot.checkAllowHorizontalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsVerticalThinLetterboxed(/* isThin */ false); robot.checkAllowVerticalReachabilityForThinLetterbox(/* expected */ true); robot.configureIsHorizontalThinLetterboxed(/* isThin */ false); robot.checkAllowHorizontalReachabilityForThinLetterbox(/* expected */ true); }); } /** * Runs a test scenario providing a Robot. */ Loading