如何在 AOSP 版本中设置默认启动器? [英] How do I set the default launcher in an AOSP build?

查看:58
本文介绍了如何在 AOSP 版本中设置默认启动器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在修改 AOSP 源代码,因为我的应用需要在自助服务终端环境中运行.

I am modifying the AOSP source code because my app needs to run in a kiosk environment.

我希望 Android 直接启动到应用程序中.我已经从 generic_no_telephony.mk 中排除了 launcher2,并在那里添加了应用程序.现在 Android 一直提示我选择默认启动器.

I want Android to boot directly into the app. I've excluded launcher2 from generic_no_telephony.mk, and added the app there. Now Android prompts me all the time to choose default launcher.

弹出窗口中可用的两个选项:

The two choices that are available on the pop-up:

  1. 首页示例
  2. 我的应用.

如何排除 Android Home Sample Launcher?或者还有其他方法可以在 AOSP 版本中设置默认启动器吗?

How can I exclude the Android Home Sample Launcher? Or is there another way to set the default launcher in an AOSP build?

推荐答案

与其修改 AOSP 生成文件(这很烦人,因为您需要跟踪更改),不如将 LOCAL_OVERRIDES_PACKAGES 行添加到应用的生成文件中.

Instead of modifying the AOSP make files (which is annoying because then you need to track your changes) it is easier to add a LOCAL_OVERRIDES_PACKAGES line to your app's make file.

例如:

LOCAL_OVERRIDES_PACKAGES := Launcher2 Launcher3

添加到您的 Android.mk 文件将确保这些包不会添加到任何添加此包的构建中.

added to your Android.mk file will ensure that those packages are not added to any build where this package is added.

接下来,你应该做一个

make installclean

然后以与构建构建相同的方式开始构建.make installclean 对于删除之前构建留下的包很重要.

and then start your build the same way you always make your build. The make installclean is important to remove the packages that are left behind by the previous build.

我也刚刚在另一个问题中找到了如何做到这一点的好答案,请参阅:我将如何制作嵌入式 Android 操作系统只有一个应用程序?

I also just found a nice answer to how to do this in another question, see: How would I make an embedded Android OS with just one app?

这篇关于如何在 AOSP 版本中设置默认启动器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆