Android 6.0 默认关闭定位和GPS,开启后默认选省电
程序员文章站
2022-05-25 21:10:47
默认关闭定位和GPS 修改位置 frameworks/base/packages/SettingsProvider/res/values/defaults.xml network,gps 修改为 默认省电 修改位置 com/android/settings/location/LocationSett ......
默认关闭定位和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); }
上一篇: PHP 命令行参数详解及应用