Android 开机向导定制
采用 rro_overlays 机制来定制开机向导,定制文件如下:
GmsSampleIntegrationOverlay$ tree
.
├── Android.bp
├── AndroidManifest.xml
└── res
└── raw
├── wizard_script_common_flow.xml
├── wizard_script_customize_flow.xml
└── wizard_script.xml
Android.bp
runtime_resource_overlay {
name: "GmsSampleIntegrationOverlay",
product_specific: true,
}
在项目对应的.mk 文件添加编译引用
PRODUCT_PACKAGES += \
GmsSampleIntegrationOverlay
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
#/*
# * Copyright (C) 2023 Lens Technology (Xiangtan) Co.,Ltd, All rights reserved.
# * Author: XT900109
# */
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxxx.gmssampleintegrationsoverlay"
android:versionCode="1"
android:versionName="1.0">
<application android:hasCode="false" />
<overlay android:targetPackage="com.google.android.gmsintegration"
android:priority="0"
android:isStatic="true" />
</manifest>
rro_overlays/GmsSampleIntegrationOverlay/res/raw/wizard_script_lens_customize_flow.xml
自定义 wizard_script_customize_flow.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
The wizard:uris recorded here have the inconvenience of being generated by hand, but they allow
for the full spread of launch flags (we need FLAG_ACTIVITY_NEW_TASK [0x10000000]), where the
<intent> tag processed by Intent.parseIntent() does not.
adb shell am to-intent-uri -a com.android.setupwizard.WELCOME -f 0x10000000 \-\-ez firstRun true
-->
<WizardScript xmlns:wizard="http://schemas.android.com/apk/res/com.google.android.setupwizard"
wizard:firstAction="user_terms_of_service1">
<WizardAction id="user_terms_of_service1"
wizard:uri="intent:#Intent;action=com.android.setupwizard.USER_TERMS_OF_SERVICE;end" >
<result wizard:action="user_service_notice" />
</WizardAction>
<WizardAction id="user_service_notice"
wizard:uri="intent:#Intent;action=com.android.setupwizard.USER_SETUP_FINISH;end" >
</WizardAction>
<!-- <WizardAction id="END_OF_SCRIPT"
wizard:uri="intent:#Intent;action=com.android.setupwizard.EXIT;end" />-->