Skip to content

Commit

Permalink
[WebLayer] Use ApiHelper instead of calling the R API directly
Browse files Browse the repository at this point in the history
Forgot to use ApiHelperForR for getMaxmiumWindowMetrics() the last time
in http://crrev/c/3192314

Bug: 1241568
Change-Id: I7137493d2c63e80d84087d972d2ebad9150bb3e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3206538
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Auto-Submit: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#928404}
  • Loading branch information
Shimi Zhang authored and Chromium LUCI CQ committed Oct 5, 2021
1 parent 64d6366 commit 036a7ad
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import androidx.fragment.app.FragmentTransaction;

import org.chromium.base.IntentUtils;
import org.chromium.base.compat.ApiHelperForR;
import org.chromium.weblayer.Browser;
import org.chromium.weblayer.BrowsingDataType;
import org.chromium.weblayer.ContextMenuParams;
Expand Down Expand Up @@ -940,7 +941,7 @@ private Point getDisplaySize() {
Point point = new Point();
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
Rect rect = windowManager.getMaximumWindowMetrics().getBounds();
Rect rect = ApiHelperForR.getMaximumWindowMetricsBounds(windowManager);
point.set(rect.width(), rect.height());
} else {
Display display = windowManager.getDefaultDisplay();
Expand Down

0 comments on commit 036a7ad

Please sign in to comment.