2

我正在使用 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");
4

2 回答 2

4

跟踪BOOT TIMEOUT问题,它来自 WindowManagerServiceperformEnableScreen()等待设置/激活壁纸,否则不认为启动完成:

            // If we are turning on the screen after the boot is completed
            // normally, don't do so until we have the application and
            // wallpaper.
            if (mSystemBooted && ((!haveApp && !haveKeyguard) ||
                    (wallpaperEnabled && !haveWallpaper))) {
                return;
            }

我还注意到包/壁纸中的壁纸 apk 不是为目标构建的,因为 bbbandroid 存储库目前缺乏对 opengl 的支持。

我目前针对此问题的解决方法是通过其内部 config.xml 文件禁用 WallpaperService:

diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml
index 6efb4a4..0c873b7 100644
--- a/frameworks/base/core/res/res/values/config.xml
+++ b/frameworks/base/core/res/res/values/config.xml
@@ -701,7 +701,7 @@
     <string name="default_wallpaper_component" translatable="false">@null</string>

     <!-- True if WallpaperService is enabled -->
-    <bool name="config_enableWallpaperService">true</bool>
+    <bool name="config_enableWallpaperService">false</bool>

     <!-- Whether to enable network location overlay which allows network
          location provider to be replaced by an app at run-time. When disabled,

如果您不介意使用修改后的 android 源,则此解决方案有效。

于 2015-07-27T16:31:24.900 回答
1

我认为问题不在于您的启动器应用程序,在这种情况下,您会在应用程序的 logcat 错误中看到。通常,当 SystemUI 无法启动(由于故障)时,启动动画会挂起。

启动器应用程序本身不会停止启动动画,它没有此功能。

您可能禁用了一些破坏启动工作流程的关键组件。是的,壁纸会影响它。我建议将所有内容放回您的 .mk 文件中,检查它是否可以构建和启动,然后仅将启动器替换为您的应用程序。然后您可以进一步剪切 mk 文件以检查哪个模块产生了问题。

我不记得确切,但Browser模块可能包含许多组件使用的 webview 组件。

您应该发布完整的 logcat 输出,也可能是 dmesg 输出。

于 2015-07-28T23:13:21.313 回答