LocationUtils.java uses deprecated LOCATION_PROVIDERS_ALLOWED |
||
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.
,
Feb 8 2017
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?
,
Feb 9 2017
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"?
,
Aug 1
|
||
►
Sign in to add a comment |
||
Comment 1 by thakis@chromium.org
, Feb 8 2017