Android8.1 MTK 去掉锁屏功能
1、源码:
*****\vendor\mediatek\proprietary\packages\apps\SettingsProvider\res\values\defaults.xml
<string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>
//将false改为true即可,false锁屏,true不锁屏
<bool name="def_lockscreen_disabled">true</bool>
<bool name="def_device_provisioned">false</bool>
<integer name="def_dock_audio_media_enabled">1</integer>
2、源码:
*****\vendor\mediatek\proprietary\packages\apps\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java
loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD,
R.bool.def_accessibility_speak_password);
//将false改为true
if (SystemProperties.getBoolean("ro.lockscreen.disable.default", true) == true) {
loadSetting(stmt, Settings.System.LOCKSCREEN_DISABLED, "1");
} else {
loadBooleanSetting(stmt, Settings.System.LOCKSCREEN_DISABLED,
R.bool.def_lockscreen_disabled);
}
loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ENABLED,
com.android.internal.R.bool.config_dreamsEnabledByDefault);
注意:改之前,需要根据自己的项目配置,看清楚用的是哪个目录下的SettingsProvider