New issue
Advanced search Search tips

Issue 763923 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

DeviceConditions.class Call requires API level 21 (current min is 16): `android.os.PowerManager#isPowerSaveMode`: NewApi

Project Member Reported by wnwen@chromium.org, Sep 11 2017

Issue description

org/chromium/chrome/browser/offlinepages/DeviceConditions.class Call requires API level 21 (current min is 16): `android.os.PowerManager#isPowerSaveMode`: NewApi [warning]

Introduced in e33804dac7a75cd090d3bfcca7a1b5f9c2538403

I will add a temporary local suppression with a TODO in https://chromium-review.googlesource.com/c/chromium/src/+/652964
 
Components: UI>Browser>Offline
Is this a problematic warning or a problematic API?

Comment 2 by wnwen@chromium.org, Sep 11 2017

The warning is correct, it just was turned off for a couple weeks while we updated platform tools. Unfortunately it let in a lot of API usages like this one.

See this for an example fix:  https://crbug.com/762550 

Comment 3 by wnwen@chromium.org, Sep 11 2017

Unless you know the code is going to be called and gated on API level 21 (which on a cursory look it isn't), then that will crash for users on lower API levels when called (assuming it wasn't a private API before in which case it's still bad practice to call it but won't crash).
This is crashing Canary, so we are reverting the original.

Comment 5 by wnwen@chromium.org, Sep 13 2017

Please remove the suppression if it is still there, either in reland or another CL.
It was removed, we will make a correct API call when the reland comes.

Comment 7 by wnwen@chromium.org, Sep 13 2017

Status: Fixed (was: Assigned)
Sounds great, thank you!

Sign in to add a comment