From 923c0dc070aaba6ac1eccc4ce5aa2261ca6176f2 Mon Sep 17 00:00:00 2001 From: Tom O'Neill Date: Mon, 3 Mar 2014 11:07:55 -0800 Subject: [PATCH] Discourage content observers on LOCATION_PROVIDERS_ALLOWED - Bug: 12176905 Change-Id: I79bfdbba5ad0d11d82169c0897418f5b3963be0a --- core/java/android/provider/Settings.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index bf0be40a60f01..7777334e68118 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3360,21 +3360,29 @@ public final class Settings { public static final String INSTALL_NON_MARKET_APPS = Global.INSTALL_NON_MARKET_APPS; /** - * Comma-separated list of location providers that activities may access. + * Comma-separated list of location providers that activities may access. Do not rely on + * this value being present in settings.db or on ContentObserver notifications on the + * corresponding Uri. * - * @deprecated use {@link #LOCATION_MODE} + * @deprecated use {@link #LOCATION_MODE} and + * {@link LocationManager#MODE_CHANGED_ACTION} (or + * {@link LocationManager#PROVIDERS_CHANGED_ACTION}) */ @Deprecated public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; /** * The degree of location access enabled by the user. - *

+ *

* When used with {@link #putInt(ContentResolver, String, int)}, must be one of {@link * #LOCATION_MODE_HIGH_ACCURACY}, {@link #LOCATION_MODE_SENSORS_ONLY}, {@link * #LOCATION_MODE_BATTERY_SAVING}, or {@link #LOCATION_MODE_OFF}. When used with {@link * #getInt(ContentResolver, String)}, the caller must gracefully handle additional location * modes that might be added in the future. + *

+ * Note: do not rely on this value being present in settings.db or on ContentObserver + * notifications for the corresponding Uri. Use {@link LocationManager#MODE_CHANGED_ACTION} + * to receive changes in this value. */ public static final String LOCATION_MODE = "location_mode";