version:m40se 3.0.2

fix:
update:优化耗电和管控逻辑
This commit is contained in:
2023-06-17 09:24:50 +08:00
parent a6fd0862e3
commit cf04e4c0b8
10 changed files with 73 additions and 51 deletions

View File

@@ -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);
}