New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 736138 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 726844



Sign in to add a comment

Stop using Physical Web APIs on low-end devices

Project Member Reported by mariakho...@chromium.org, Jun 22 2017

Issue description

We can avoid loading "nearby" GMS Core module into memory by ensuring that physical web features are completely turned off at run-time on low-end devices.
 
Blocking: 726844

Comment 2 by mmo...@chromium.org, Jun 26 2017

I haven't looked: is Physical Web the only Nearby client in Chrome?  AFAIK there were other clients.  Perhaps those are also/already disabled on low-end devices?
I did a search for gms.nearby imports and all of them showed up under physicalweb/ folder. I am not aware of other clients -- but if you think there would be more, I'd appreciate pointers.
This is pretty important for Android Go, so I would really appreciate some help from the physical web team for this.

Comment 5 by mmo...@chromium.org, Jun 28 2017

Conley and Matt (our Android devs) are now working on another project, so I cannot speak for them, but I can try to help here.

If its just a matter of not enabling PW scans at runtime on Android Go devices, this is trivial.  If you point me at a CL which already tests for android-go/low-end devices at runtime (`IsAndroidGo()`) then I can make the change.

If this is a separate compile time build target, perhaps you could point me to some more information?
Owner: mmo...@chromium.org
Thanks, Michal.

This would be a run-time check. You can use SysUtils::IsLowEndDevice (and it's java equivalent SysUtils.isLowEndDevice()). Seems okay to disable for all low-end phones. If you think there's a reason to target Go devices only, the check would be SysUtils.isLowEndDevice && BuildInfo.isAtLeastO()
From email thread with Conley:
"Pretty easy.  I think the most appropriate thing would be to add a check here:
https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java?rcl=1ca17a65441b857f1448bb4fcded88ffa4b43494&l=129

There is still one other call made to Nearby since we can't guarantee the user isn't coming from an enabled state to a disabled state:
https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java?rcl=1ca17a65441b857f1448bb4fcded88ffa4b43494&l=100"

If you can make sure that all calls to the nearby APIs are guarded, that would be great.
Any progress with this? Would really like to make sure this lands in time for M-61.

Comment 9 by conleyo@google.com, Jul 11 2017

Sorry, I can take a stab at this tomorrow.
Owner: cco3@chromium.org
I'm participating in a week-long event this week.  Conley, if you take a stab, that is appreciated.
Project Member

Comment 11 by bugdroid1@chromium.org, Jul 12 2017

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

commit 73911c56d5b85d3fc6fae301b376643c74ddbcca
Author: Conley Owens <cco3@chromium.org>
Date: Wed Jul 12 18:29:56 2017

Do not run Nearby on low end devices

This change checks if we are running on a low-end device before making
a call to Nearby.

BUG= 736138 

Change-Id: Ic3848725e752306c774a61a1cc9e26dd750e7a24
Reviewed-on: https://chromium-review.googlesource.com/567699
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Conley Owens <cco3@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486032}
[modify] https://crrev.com/73911c56d5b85d3fc6fae301b376643c74ddbcca/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java

Status: Fixed (was: Assigned)
Thanks!
Status: Assigned (was: Fixed)
Still seeing Nearby service getting started. Sending CL.
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 28 2017

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

commit 46197af46f511258624e5acc9d7e3ac34d732693
Author: Maria Khomenko <mariakhomenko@chromium.org>
Date: Fri Jul 28 23:01:17 2017

Don't send nearby subscription jobs on low-end devices.

BUG= 736138 

Change-Id: I5ba9555a71c571c2e3ccb90f489da89e53823b65
Reviewed-on: https://chromium-review.googlesource.com/590949
Reviewed-by: Conley Owens <cco3@chromium.org>
Commit-Queue: Maria Khomenko <mariakhomenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490532}
[modify] https://crrev.com/46197af46f511258624e5acc9d7e3ac34d732693/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java

Labels: ReleaseBlock-Stable
Adding RBS because we need this for Chrome Go.
Labels: Merge-Request-61
Merge request for CL in #14, which has a bug fix for the originally landed issue in #11(that landed before the branch). The bug fix ensures that the Physical Web APIs are not used on low-end devices. This is needed for Android Go.
Project Member

Comment 17 by sheriffbot@chromium.org, Aug 7 2017

Labels: -Merge-Request-61 Merge-Review-61 Hotlist-Merge-Review
This bug requires manual review: M61 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-61 Merge-Approved-61
Merge approved for M61 branch 3163.
Project Member

Comment 19 by bugdroid1@chromium.org, Aug 10 2017

Labels: -merge-approved-61 merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/888a8b846ce8d20d6db334758c274a61224d1f65

commit 888a8b846ce8d20d6db334758c274a61224d1f65
Author: Maria Khomenko <mariakhomenko@chromium.org>
Date: Thu Aug 10 02:48:18 2017

Don't send nearby subscription jobs on low-end devices.

BUG= 736138 
TBR=mariakhomenko@chromium.org

(cherry picked from commit 46197af46f511258624e5acc9d7e3ac34d732693)

Change-Id: I5ba9555a71c571c2e3ccb90f489da89e53823b65
Reviewed-on: https://chromium-review.googlesource.com/590949
Reviewed-by: Conley Owens <cco3@chromium.org>
Commit-Queue: Maria Khomenko <mariakhomenko@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#490532}
Reviewed-on: https://chromium-review.googlesource.com/609593
Reviewed-by: Maria Khomenko <mariakhomenko@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#426}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/888a8b846ce8d20d6db334758c274a61224d1f65/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java

Status: Fixed (was: Assigned)

Comment 21 by kravula@google.com, Aug 16 2017

Do we show the option under Privacy->Physical Web for low-end devices?
Good question, I suspect yes it will still show setting, and enabling the feature will not work.  (I will need to double check, don't have a low-end device to test on)

I think we should go one of two routes:
1. Make PW impossible to turn on, and remove the privacy setting entirely.
2. Make PW default-off, but leave the privacy setting for those who want to enable it explicitly.

It looks like today we make it impossible to turn on, but leave the setting, which is a bad combination.

I prefer option (2), but think option (1) is probably fine.

Sign in to add a comment