Android Custom Launcher不会停止BootAnimation

时间:2015-07-24 19:11:42

标签: android android-4.4-kitkat android-source android-launcher boot-animation

我正在使用BBBAndroid开发一个Android自定义启动器(android v4.4.4 w /内核3.8用于beagleboneblack): 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中有一些缺少的Wallpaper类错误,但我没有删除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!

我在包/壁纸/基本(AOSP)的LiveWallpapers包中找到了这个类。它已经在PRODUCT_PACKAGES中添加,但是这个包没有出/ out / target / product / beagleboneblack / :(

现在我正在挖掘Launcher2和WallPaperManager以查看可能触发BootAnimation停止的内容......

提前致谢!

更新

我还尝试使用系统属性停止bootanimation,但触摸屏在BOOT_TIMEOUT事件之前无法使用:

    import android.os.SystemProperties;

    // inside a Service with system privileges
    SystemProperties.set("service.bootanim.exit", "1");

2 个答案:

答案 0 :(得分:3)

跟踪performEnableScreen()问题,它来自WindowManagerService // 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; } ,等待设置/激活壁纸,否则启动不会被认为是:

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,

我还注意到包/壁纸中的壁纸apks不是为目标构建的,因为bbbandroid repo现在缺乏opengl支持。

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

{{1}}

如果您不介意使用经过修改的Android源代码,则此解决方案有效。

答案 1 :(得分:1)

I think that the problem is not with your launcher app, in this case you would see in logcat errors from your app. Usually boot animation hangs when SystemUI can't start (due to a failure).

Launcher app itself doesn't stop boot animation, it doesn't have this functionality.

You probably disabled some critical component which breaks boot workflow. Yes, wallpapers can affect it. I would recommend to put everything back in your .mk file, check that it builds and boots OK, then replace launcher only with your app. Then you can cut mk file further to check which module creates the issue.

I do not remember exactly but Browser module may include webview component which is used by many components.

You should post full logcat output, and may be dmesg output as well.