Android16 让自定义launcher快速启动
在项目里面,很多时候会自定义launcher,在我们拥有了ROM开发能力条件下,可以适当的让自定义launcher启动加快。 我们知道Android系统正常情况下会先启动 FallbackHome(显示“Tablet is starting”),所以需要绕过这个FallbackHome。 在自定义Launcher 的 AndroidManifest.xml里面的application可以配置android:directBootAware="true" 属性,当有配置了这个属性后,directBootAware 使得 Launcher 可以在用户解锁前运行,因此会绕过FallbackHome提前启动,从而达到加速效果。 当然需要搭配android:sharedUserId="android.uid.system"和android:defaultToDeviceProtectedStorage="true"属性效果更好。 完整xml配置:?xml version="1.0" encoding="utf-8"? manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.xxx.launcher