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

Issue 690145 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 690155



Sign in to add a comment

LocationUtils.java uses deprecated LOCATION_PROVIDERS_ALLOWED

Project Member Reported by thakis@chromium.org, Feb 8 2017

Issue description

While building chrome/android:

[14281/23223] ACTION //components/location/android:location_java__compile_java__javac(//build/toolchain/android:android_clang_arm)
../../components/location/android/java/src/org/chromium/components/location/LocationUtils.java:81: warning: [deprecation] LOCATION_PROVIDERS_ALLOWED in Secure has been deprecated
                    context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED));
                                                                 ^
1 warning


We try to have a silent build. Please fix.

https://developer.android.com/reference/android/provider/Settings.Secure.html says "This constant was deprecated in API level 19. use LOCATION_MODE and MODE_CHANGED_ACTION (or PROVIDERS_CHANGED_ACTION)", so hopefully a fairly easy fix.
 
Blocking: 690155
Unfortunately, our min_sdk_version is 16, and the replacements for LOCATION_PROVIDERS_ALLOWED weren't introduced until 19. Is @SuppressWarnings("deprecation") like https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java?l=403-404&rcl=39f049e94f28f0c26dba4aae5fe7d2818d4c570d acceptable?
Oh wow, the Android NDK marks things deprecated unconditionally of deployment target? That's kind of lame :-(

Then I guess @SuppressWarnings with a "// TODO use $replacement once deployment version is 19" is the best we can do.

Can you file an internal bug on the Android folks to get something like https://clang.llvm.org/docs/AttributeReference.html#availability going so that they can say "this is deprecated, but only if deployment target is at least N"?
Status: Assigned (was: Untriaged)

Sign in to add a comment