AI 144415: am: CL 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 Original author: lockwood Automated import of CL 144415
This commit is contained in:
committed by
The Android Open Source Project
parent
247286697f
commit
8dc883fe46
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user