From 2595f146fecd3828231c6611362cce65acd9afb6 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Mon, 22 Jun 2009 12:18:15 -0700 Subject: [PATCH] Use the new Secure settings for location. Also added the code to invoke the consent dialog. --- src/com/android/browser/BrowserActivity.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index eae24f1..4fce8c2 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -1000,10 +1000,15 @@ public class BrowserActivity extends Activity && intent.getBooleanExtra(Browser.EXTRA_APPEND_LOCATION, false)) { ContentResolver cr = getContentResolver(); - int use = Settings.Gservices.getInt(cr, - Settings.Gservices.USE_LOCATION_FOR_SERVICES, -1); + int use = Settings.Secure.getInt(cr, + Settings.Secure.USE_LOCATION_FOR_SERVICES, -1); if (use == -1) { - // TODO: bring up the consent dialog + // bring up the consent dialog if it is undefined. And we + // will not send the location info for this query. + Intent consent = new Intent( + Settings.ACTION_SECURITY_SETTINGS); + consent.putExtra("SHOW_USE_LOCATION", true); + startActivity(consent); } else if (use == 1 && Settings.Secure.isLocationProviderEnabled(cr, LocationManager.NETWORK_PROVIDER)) { -- 2.11.0