From 1881749f09010bf268c9e7c955f2646b0b9e2752 Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Wed, 8 Feb 2023 18:40:57 +0800 Subject: [PATCH] Make Settings show in two-pane on portrait tablet Test: manual - Change Display size and observe Bug: 211562623 Change-Id: I0c26a7443882cc28edb5500f8d135c5f00dee515 Merged-In: I0c26a7443882cc28edb5500f8d135c5f00dee515 (cherry picked from commit cf3199fc9e140b9db04827c7ebd6fe3fd7308721) --- .../activityembedding/ActivityEmbeddingRulesController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java b/src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java index dafa16819d8..381466f0031 100644 --- a/src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java +++ b/src/com/android/settings/activityembedding/ActivityEmbeddingRulesController.java @@ -26,6 +26,7 @@ import androidx.window.embedding.ActivityFilter; import androidx.window.embedding.ActivityRule; +import androidx.window.embedding.EmbeddingAspectRatio; import androidx.window.embedding.RuleController; import androidx.window.embedding.SplitAttributes; import androidx.window.embedding.SplitPairFilter; @@ -110,6 +111,7 @@ public static void registerTwoPanePairRule(Context context, .setClearTop(clearTop) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) + .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.alwaysAllow()) .setDefaultSplitAttributes(attributes) .build(); RuleController.getInstance(context).addRule(splitPairRule); @@ -230,6 +232,7 @@ private void registerHomepagePlaceholderRule() { activityFilters, intent) .setMinWidthDp(ActivityEmbeddingUtils.getMinCurrentScreenSplitWidthDp()) .setMinSmallestWidthDp(ActivityEmbeddingUtils.getMinSmallestScreenSplitWidthDp()) + .setMaxAspectRatioInPortrait(EmbeddingAspectRatio.alwaysAllow()) .setSticky(false) .setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ADJACENT) .setDefaultSplitAttributes(attributes)