Skip to content

Commit

Permalink
[M106][Android] Don't use landscape layout on large screens
Browse files Browse the repository at this point in the history
On large and extra-large displays, FirstRunActivity is displayed
within a dialog (due to using DialogWhenLarge theme).
This CL suppresses landscape layouts for FRE views if the dialog is
used (as the dialog always has portrait proportions).

(cherry picked from commit 045a42e)

Bug: 1350917
Change-Id: Ib9534ff4bb7cd001b0e885477726cede8c38d009
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3845163
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1037699}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3850119
Owners-Override: Krishna Govind <govind@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Krishna Govind <govind@chromium.org>
Commit-Queue: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#47}
Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
  • Loading branch information
Boris Sazonov authored and Chromium LUCI CQ committed Aug 23, 2022
1 parent a55abc3 commit b5c8fd5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package org.chromium.chrome.browser.firstrun;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
Expand Down Expand Up @@ -621,7 +622,8 @@ public Promise<Void> getNativeInitializationPromise() {

@Override
public boolean canUseLandscapeLayout() {
return true;
return !getResources().getConfiguration().isLayoutSizeAtLeast(
Configuration.SCREENLAYOUT_SIZE_LARGE);
}

@VisibleForTesting
Expand Down

0 comments on commit b5c8fd5

Please sign in to comment.