我正在使用 BBBAndroid(beagleboneblack 的 android v4.4.4 w/ kernel 3.8)的项目中为 Android 定制启动器:http: //bbbandroid.sourceforge.net
我创建了aosp_stripped.mk来剥离一些不需要的 Android 包,并用我的 CustomLauncher 替换 Launcher2 和 HOME 包。这个启动器主要是一个普通的应用程序,在其 AndroidManifest.xml 中添加了 LAUNCHER 和 HOME 类别:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.customlauncher" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_people"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library
android:name="test.service.lib"
android:required="true" />
<activity
android:launchMode="singleTask"
android:stateNotNeeded="true"
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
它有效地取代了 Launcher2,但启动动画直到 40 秒后才停止,logcat 显示:
W/WindowManager( 591): ***** BOOT TIMEOUT: forcing display enabled
I/PowerManagerService( 591): Boot animation finished.
所以我的启动器必须缺少一些东西来告诉启动动画停止。我在这里找到了一些提示:http: //forum.xda-developers.com/showthread.php?t =2485118
确实,我在 logcat 中有一些缺少墙纸类的错误,但我没有删除 SystemUI 包。我注意到当使用 Launcher2/Home 时,这个错误只会在第一次启动时发生。使用我的自定义启动器,它会在每次启动时发生。除了这个错误,我没有发现任何差异:
W/WallpaperService( 591): Attempted wallpaper ComponentInfo{com.android.wallpaper/com.android.wallpaper.fall.FallWallpaper} is unavailable
W/WallpaperService( 591): Failure starting previous wallpaper
W/WallpaperService( 591): Attempted wallpaper ComponentInfo{com.android.wallpaper/com.android.wallpaper.fall.FallWallpaper} is unavailable
E/WallpaperService( 591): Default wallpaper component not found!
我在 packages/wallpapers/Basic (AOSP) 中的 LiveWallpapers 包中找到了这个类。它已经添加到 PRODUCT_PACKAGES 中,但是这个包不在 out/target/product/beagleboneblack/ 中:(
现在我正在挖掘 Launcher2 和 WallPaperManager 看看是什么触发了 BootAnimation 停止...
提前致谢 !
更新
我还尝试使用系统属性停止启动动画,但触摸屏在BOOT_TIMEOUT
事件发生之前无法使用:
import android.os.SystemProperties;
// inside a Service with system privileges
SystemProperties.set("service.bootanim.exit", "1");