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

Issue 707302 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Stop using BuildInfo#isGreaterThanN.

Project Member Reported by khushals...@chromium.org, Mar 31 2017

Issue description

BuildInfo#isGreaterThanN actually returns true for N, which is misleading. We should have code that actually needs to know if we are greater than N use isAtLeastO, and remove this API.

Assigning to twellington@ since it looks like there is only a couple of uses of it remaining in ChromeTabbedActivity and ApiCompatibilityUtils. Do you mind taking a look?

https://cs.chromium.org/search/?q=isGreaterThanN&type=cs


 
The method is intended to detect NMR1, which is when launcher shortcuts were added.

Why is this RBS for M58?
Note that the method returns false for regular N (level 24 API) and true for N-MR1 (level 25 API).
I asked khushalsagar@ to mark this as an RB-Stable for M58 to ensure if we had any other leftover checks in place related to N they were evaluated (and updated if necessary) before we shipped O.  If all the existing uses are correct then we can close this out.
Labels: OS-Android
Labels: -ReleaseBlock-Stable -M-58
The existing checks are correct (they're both for NMR1 features -- shortcuts and Nexus retail mode). Since the NMR1 SDK isn't public yet, we still need this method. I can change the method name to isAtLeastNMR1 to match the new isAtLeastO if that's helpful?
Labels: -Pri-1 Pri-3
Actually, it looks like NMR1 was moved to our upstream repro as of 3/16: https://chromium.googlesource.com/android_tools.git/+/b65c4776dac2cf1b80e969b3b2d4e081b9c84f29

I can remove the ApiCompatibilityUtils method, but this definitely doesn't need to get merged to M58.
I think just changing the name to isAtLeastNMR1 would keep people from accidentally using it incorrectly in the future. So that would definitely be awesome. :)
I have a patch out for review that removes the method and cleans up the reflection introduced for NMR1. https://codereview.chromium.org/2785373004/
Thanks Theresa!
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 4 2017

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

commit df46c2242e4635dc77fce945bfc0ea0089efee31
Author: twellington <twellington@chromium.org>
Date: Tue Apr 04 18:46:21 2017

Remove BuildInfo#isGreaterThanN()

The NMR1 SDK has been published upstream, so BuildInfo#isGreaterThanN is
no longer needed. This patch also removes reflection for
UserManager#isDemoUser() and ShortcutManager#reportShortcutUsed(),
and updates AndroidManifest.xml to remove the conditional include
of launchershortcut.xml and network_security_config.xml.

BUG= 707302 

Review-Url: https://codereview.chromium.org/2785373004
Cr-Commit-Position: refs/heads/master@{#461787}

[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java
[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/base/android/java/src/org/chromium/base/BuildInfo.java
[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/build/android/lint/suppressions.xml
[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/chrome/android/BUILD.gn
[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/chrome/android/java/AndroidManifest.xml
[modify] https://crrev.com/df46c2242e4635dc77fce945bfc0ea0089efee31/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 6 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/46b5adcb1c2e9281dcf812b16dd3e4f46e7c804e

commit 46b5adcb1c2e9281dcf812b16dd3e4f46e7c804e
Author: Theresa Wellington <twellington@google.com>
Date: Thu Apr 06 19:11:25 2017

Status: Fixed (was: Assigned)

Sign in to add a comment