Android10 system development realizes the default configuration such as skipping the boot wizard, plugging in the power cord and not sleeping

I. Introduction

In the process of flashing and playing, often encounter annoying boot settings after flashing. Especially people with obsessive-compulsive disorder, hope to jump to the main interface after booting. After some research, you can skip the boot boot by modifying the default settings in the Android source code. In addition, there are many other functions, such as whether to turn on Bluetooth, lock screen, etc., which can be modified through the default configuration.

2. Introduction to Android system default configuration settings

The default attribute configuration storage path in the Android source code is as follows:

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

There are a lot of system initialization configuration information in this file, the following are a few:

<!--默认是否打开蓝牙-->
 <bool name="def_bluetooth_on">true</bool>
<!--默认是打开安装非应用市场的app-->
<bool name="def_install_non_market_apps">false</bool>
<!--默认是否开启包验证-->
<bool name="def_package_verifier_enable">true</bool>
<!--默认是否开启数据线连接电源情况下不休眠-->
<bool name="def_stay_on_while_plugged_in">false</bool>
<!--本文的关键属性======默认是否开启跳过开机向导-->
<bool name="def_user_setup_complete">false</bool>

From the above attributes, the values ​​of most attributes in defaults.xml are either false or true, which is very convenient to modify.

Three, modify the default attribute actual combat

We change the attribute values ​​listed above from true to false and false to true. as follows:

<!--关闭蓝牙-->
 <bool name="def_bluetooth_on">false</bool>
<!--允许-->
<bool name="def_install_non_market_apps">true</bool>
<!--关闭包验证-->
<bool name="def_package_verifier_enable">true</bool>
<!--连接电源情况下不休眠-->
<bool name="def_stay_on_while_plugged_in">true</bool>
<!--本文的关键属性======开启跳过开机向导-->
<bool name="def_user_setup_complete">true</bool>

Compile after modifying the above attributes. Double-clear mobile phone flashing, you can see that the modified attributes take effect, for example, you can directly enter the main interface after turning on the phone.

 

[ Previous ] Fun with Android10 source code development and customization (14) Modify Android source code, mobile phone never sleeps

 

The big guys keep a concern before leaving, and follow-up wonderful articles continueimage

image

Guess you like

Origin blog.csdn.net/u011426115/article/details/112760587