version:m40se 3.0.2
fix: update:优化耗电和管控逻辑
This commit is contained in:
@@ -22,7 +22,7 @@ public class AmapManager {
|
||||
|
||||
private AmapManager(Context context) {
|
||||
this.mContext = context;
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
// Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+network");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 1);
|
||||
initAmap();
|
||||
@@ -48,7 +48,7 @@ public class AmapManager {
|
||||
if (mLocationClient == null) {
|
||||
mLocationClient = new LocationClient(mContext);
|
||||
}
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
// Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+gps");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "+network");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 1);
|
||||
mLocationClient.setLocOption(getDefaultLocationClientOption());
|
||||
@@ -132,8 +132,9 @@ public class AmapManager {
|
||||
}
|
||||
Log.e(TAG, "AmapAddress: " + (String) SPUtils.get(mContext, "AmapAddress", "-"));
|
||||
Log.e(TAG, "AmapError: " + (String) SPUtils.get(mContext, "AmapError", "-"));
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-gps");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user