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:
committed by
The Android Open Source Project
parent
2e990b97d3
commit
a98128aff5
@@ -38,9 +38,7 @@ public class DefaultActivity extends Activity {
|
|||||||
|
|
||||||
// Enable the GPS.
|
// Enable the GPS.
|
||||||
// Not needed since this SDK will contain the Settings app.
|
// 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);
|
Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, LocationManager.GPS_PROVIDER);
|
||||||
locationManager.updateProviders();
|
|
||||||
|
|
||||||
// enable install from non market
|
// enable install from non market
|
||||||
Settings.Secure.putInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS, 1);
|
Settings.Secure.putInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user