当前位置: 移动技术网 > IT编程>移动开发>Android > Android 6.0 默认关闭定位和GPS,开启后默认选省电

Android 6.0 默认关闭定位和GPS,开启后默认选省电

2019年04月23日  | 移动技术网IT编程  | 我要评论

太原公交,java书,定州新闻

默认关闭定位和gps 修改位置

frameworks/base/packages/settingsprovider/res/values/defaults.xml

<string name="def_location_providers_allowed" translatable="false">network,gps</string>
修改为
<string name="def_location_providers_allowed" translatable="false"></string>

默认省电 修改位置

com/android/settings/location/locationsettings.java

public class locationsettings extends locationsettingsbase
 @override
 public void onswitchchanged(switch switchview, boolean ischecked) {
     if (ischecked) {
     //setlocationmode(android.provider.settings.secure.location_mode_high_accuracy);   
         setlocationmode(android.provider.settings.secure.location_mode_battery_saving);
     } else {
         setlocationmode(android.provider.settings.secure.location_mode_off);
     }

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网