如何在ROM版本中安装默认的AOSP启动器快捷方式? [英] How are the default AOSP launcher shortcuts installed in a ROM build?

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

问题描述

我正在构建自己的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.)

我了解应用可以尝试通过发送

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".(

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...

AOSP原始链接

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

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