AI 144372: Cleanup Settings support for enabling and disabling location providers:

LocationManagerService now listens for changes to settings,
  making LocationManager.updateProviders() unnecessary.
  Removed LocationManager.updateProviders()
  Added Settings.Secure.setLocationProviderEnabled(), which is a thread-safe way
  of enabling or disabling a single location provider.
  This is safer than reading, modifying and writing the LOCATION_PROVIDERS_ALLOWED directly.
  BUG=1729031

Automated import of CL 144372
This commit is contained in:
Mike Lockwood
2009-04-02 21:41:55 -07:00
committed by The Android Open Source Project
parent 2e990b97d3
commit a98128aff5

View File

@@ -38,9 +38,7 @@ public class DefaultActivity extends Activity {
// Enable the GPS.
// Not needed since this SDK will contain the Settings app.
LocationManager locationManager = (LocationManager)getSystemService(LOCATION_SERVICE);
Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, LocationManager.GPS_PROVIDER);
locationManager.updateProviders();
// enable install from non market
Settings.Secure.putInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS, 1);