问题描述
我正在构建自己的AOSP版本(使用中的代码为自定义设备编写代码Aurora 存储库),并尝试确定如何将某些应用程序的快捷方式自动添加到启动器的数据库中(具体来说,棉花糖上的Launcher3).我想更改这些位置并删除/重新放置其中的一些位置. (在此特定情况下,所涉及的应用是GMS套件中的应用.)
I'm building my own version of AOSP (using code from the Code Aurora repos for a custom device) and trying to determine how shortcuts to certain apps are being added automatically to the launcher's db (Launcher3 on Marshmallow to be more specific). I want to change these around and remove/reposition some of them. (In this particular instance the apps in question are those from the GMS suite.)
我了解应用可以尝试通过发送 ACTION_CREATE_SHORTCUT 意向.这些应用中的某些在首次启动之后但在启动器首次启动之前是否发送这些意图?
I understand that apps can try to get their shortcuts onto the launcher's workspace by sending a ACTION_CREATE_SHORTCUT intent. Are some of these apps sending these intents after first boot but before the launcher launches for the first time?
在构建时,我找不到任何将这些值添加到db的步骤或代码.
I couldn't find any steps or code that adds these values to the db as a prestep at build time.
推荐答案
您要查找的是位于platform/packages/apps/Launcher3/res/xml/default_workspace_*.xml
下的启动程序的"workspace
".(此处)
您会注意到,不同的屏幕尺寸(例如4X4/5X5/5X6)有不同的工作空间.
要添加新应用,只需添加下一个标记:
What you're looking for is the "workspace
" of the launcher which located under platform/packages/apps/Launcher3/res/xml/default_workspace_*.xml
.(here)
You will notice there are different workspace for different screen sizes (e.g 4X4 / 5X5 / 5X6).
To add new apps just add the next tag:
<favorite
launcher:packageName="com.android.gallery3d" //Your app name
launcher:className="com.android.gallery3d.app.Gallery" // Your launcher Activity
launcher:screen="3" // The screen number
launcher:x="1" // X Location on screen
launcher:y="3" /> // Y Location on screen
Xml标签-
1. favorite
-特定应用程序.
2. resolve
-解决默认应用(例如默认消息应用)
3. appwidget
-小部件...
Xml tags -
1. favorite
- Specific app.
2. resolve
- Resolve default app (e.g default messages app)
3. appwidget
- Widget...
这篇关于如何在ROM版本中安装默认的AOSP启动器快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!