New issue
Advanced search Search tips

Issue 831670 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 24
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

[Android] Remote desktop canvas is partially obscurred on Android P device with cutout

Project Member Reported by joedow@chromium.org, Apr 11 2018

Issue description

I tested the CRD client using a Pixel2 XL with the Android P SDK with a few of the cutout modes set and noticed that a portion of the desktop is cut off when the cutout is used.

I'm assuming this is due to sreen calculations which do not take cutout size into account (and thus would reproduce on hardware with a real cutout).  We can determine the size of the cutout by calling this API:
https://developer.android.com/reference/android/view/WindowInsets.html#getDisplayCutout()
 

Comment 1 by joedow@chromium.org, Apr 11 2018

Also, the desktop canvas shifts several pixels (it is quite jarring visually) when entering exclusive fullscreen mode.  This is due to the system tray size calculation used for our animation.  We should make sure this functionality also works on Android P phones with a cutout.
Owner: yuweih@chromium.org
Status: Assigned (was: Untriaged)
We probably can't do anything about this until the SDK is rolled into Chromium.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/24073a6b27c97e752b1611ceb68f09a4f8aae19d

commit 24073a6b27c97e752b1611ceb68f09a4f8aae19d
Author: Yuwei Huang <yuweih@chromium.org>
Date: Mon Aug 20 19:36:46 2018

[Remoting Android] Allow panning canvas out of the cutout area

Currently the Android app doesn't adjust the desktop canvas for cutouts
on a notched device, so part of the desktop will get obstructed by the
cutout.

This CL fixes this by introducing a concept of safe area to
DesktopCanvas. User can still see through and interact with the content
in the unsafe area and pan the canvas out of it, while we use the safe
area to calculate the minimum zoom level.

Bug:  831670 
Change-Id: I6a42bab8f383fa682bd2d2363b41bc6bb7a6d1c3
Reviewed-on: https://chromium-review.googlesource.com/1174982
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584535}
[modify] https://crrev.com/24073a6b27c97e752b1611ceb68f09a4f8aae19d/remoting/android/java/src/org/chromium/chromoting/Desktop.java
[modify] https://crrev.com/24073a6b27c97e752b1611ceb68f09a4f8aae19d/remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java
[modify] https://crrev.com/24073a6b27c97e752b1611ceb68f09a4f8aae19d/remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java

Status: Fixed (was: Assigned)
Status: Started (was: Fixed)
Reopening this. Looks like it has bug in single cutout scenario :P
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 22

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0a840142e1fa6bbd141df64b768a5f5ba43bbe49

commit 0a840142e1fa6bbd141df64b768a5f5ba43bbe49
Author: Yuwei Huang <yuweih@chromium.org>
Date: Wed Aug 22 22:15:51 2018

[Remoting Android] Fix cutout bugs

CL 1174982 only fixes layout issues when the screen has two cutouts that
cancels each other when calculating the center of the safe area. We
still have layout issues in single cutout scenario. This CL fixes these
bugs:

* Fix the calculation of the safe area center. It should be
  (width + inset.left - inset.right) / 2 instead of
  width / 2 + inset.left - inset.right. Same thing for y coordinate
  calculation.
* The letterbox padding doesn't need to account for the safe insets
  since GetViewportScreenCenter() and GetViewportBounds() already
  account for that. Undoing the letterbox changes.
* The SystemUIRect already takes cutouts into consideration. Since we
  no longer include safe insets in the letterbox padding, this CL makes
  DesktopCanvas ignore safe insets during calculation when the
  SystemUIRect is provided so that we don't double-apply the adjustment.

Scenarios manually tested:
{no cutout, 1 cutout, 2 symmetrical cutouts on top and bottom} x
{portrait mode, landscape mode} x
{touch input mode, trackpad input mode} x
{desktop < screen (letterboxes showing),
 desktop >= screen (no letterbox)} x
{keyboard showing, keyboard not showing}

Bug:  831670 
Change-Id: I0ad192b2a199c8c1d4d7740b52d4b074c3626640
Reviewed-on: https://chromium-review.googlesource.com/1185631
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585277}
[modify] https://crrev.com/0a840142e1fa6bbd141df64b768a5f5ba43bbe49/remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java

Owner: ajnolley@chromium.org
Status: Assigned (was: Started)
Hi AJ, could you try to play with the app on an Android P device and see if there is any issue doing desktop zoom-and-pan? 

Here are the steps to set up the device:
1. Enable developer mode on the device.
2. Go to Settings>System>Advanced>Developer options>Simulate a display with cutout
3. Select each of the options in the menu then play with it

And to verify this, connect to a host then try doing zoom-and-pan with different input modes, with the soft keyboard open and closed, and with the screen in portrait and landscape mode. Make sure you can pan the desktop into and out of the cutout area, and the desktop is not blocked by the cutout when you zoom all the way out.

Thanks!
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b3c874a34227a5b981b0f7493bee508e9eca327f

commit b3c874a34227a5b981b0f7493bee508e9eca327f
Author: Yuwei Huang <yuweih@chromium.org>
Date: Fri Aug 24 22:48:24 2018

[Remoting Android] Change target SDK version to 28

This CL bumps the targetSdkVersion to 28 since our app should be fully
supporting Pie features (i.e. cutout adjustments).

Bug:  831670 
Change-Id: I7e1507f4c3c56ed802de3af75eafea3b9024d826
Reviewed-on: https://chromium-review.googlesource.com/1188897
Reviewed-by: Joe Downing <joedow@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586031}
[modify] https://crrev.com/b3c874a34227a5b981b0f7493bee508e9eca327f/remoting/android/java/AndroidManifest.xml.jinja2

Owner: yuweih@chromium.org
The cutout does show up in the corner of the Chromoting screen when in landscape mode, and zoomed in a bit, but this does not affect functionality in any way. In portrait mode, or in landscape mode zoomed out, it is contained within black space outside the bounds of Chromoting.
Status: Fixed (was: Assigned)
Yep, this is intended behavior. As long as you don't have trouble interacting with things under the cutouts then that's fine. I'd call it fixed.

Sign in to add a comment