Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
579 views
in Technique[技术] by (71.8m points)

android - How do I set the default launcher in an AOSP build?

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

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. Home Sample
  2. My app.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

For instance:

LOCAL_OVERRIDES_PACKAGES := Launcher2 Launcher3

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

Following that, you should do a

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.

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...