自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
自定义准则
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AOSP 中包含的“拨号器”实现提供基本主题和结构,您可以按原样采用,也可以对其进行修改。
在下表中,“应”和“可以”的说明符合 RFC 中用于指定要求级别的关键字 (RFC 2119) 中定义的 IETF 标准,这也是 Android 10 兼容性定义中所用的标准。
自定义准则
您可以采用基本主题和结构,也可以按照以下限制条件对其进行修改。
下表介绍了 OEM 在自定义方面的责任。
自定义 |
说明 |
应 |
可自定义的行为或接口:
- 通过资源叠加层调整整体主题背景和样式
- 调色板
- 大小
- 文本外观
- 微件外观
- 对话框外观
- 可绘制对象
- 启用或停用受配置限制的功能,或更改由资源配置的参数
|
可以 |
Google 为确保最佳用户体验而推荐但不强制要求使用的行为或接口。
- 修改自适应响应规则。
- 修改拨号器的高级界面结构。应遵循用户体验限制的布局界面组件。
|
拨号器是系统应用套件(包括媒体、通知中心和应用启动器)的一部分,所有这些应用都共享在 AOSP 结构的不同级别定义的通用样式和资源:
-
framework/base/core
此处定义了所有 Android 基本样式。具体来说,所有系统应用主题都基于 Theme.DeviceDefault
,即专为供 OEM 用于自定义设备默认外观而设计的主题。
-
packages/services/Car/car_product/overlay
此文件夹中包含 Theme.DeviceDefault
的替换项,用于为 Android Automotive 生成 AOSP 式的外观和风格。OEM 可能会选择排除此叠加层,改用自己的叠加层。
-
packages/apps/Car/libs/car-apps-common
AOSP 提供的系统应用之间共用的常见颜色和样式。OEM 可使用 path/to/overlay/packages/apps/Car/libs/car-apps-common
下的叠加层自定义这些元素。
-
packages/apps/Car/Dialer
拨号器使用自己的从 Theme.DeviceDefault
(在 framework/base
中定义)扩展而来的类。也可通过使用叠加层自定义拨号器的布局、颜色、样式以及其他资源。与上述 libs
类似,资源替换项可以位于 path/to/overlay/packages/apps/Car/Dialer
中。
更多文档
如需详细了解 AOSP 主题和叠加层,请参阅利用资源叠加层自定义 build。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Customization guidelines\n\nThe Dialer implementation included in AOSP provides a base theme and structure you can adopt as\nis or modify.\n\nIn the table below, the descriptions of \"SHOULD\" and \"MAY\" are per the IETF standard defined\nin [Key words for use in RFCs to\nIndicate Requirement Levels (RFC 2119)](http://www.ietf.org/rfc/rfc2119.txt), the same standard used in the\n[Android 10 Compatibility Definition](/docs/compatibility/10/android-10-cdd).\n\nCustomization guidelines\n------------------------\n\nYou can adapt or modify the base theme and structure as per the restrictions mentioned below.\nThe following table describes\nthe OEM responsibilities regarding customization.\n\n| Customization | Description |\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **SHOULD** | Behaviors or interfaces that may be customized: - Adjust overall theming and styling through a resource overlay - Color pallette - Sizing - Text appearance - Widget appearance - Dialog appearance - Drawables - Enable or disable a feature gated by a config or change parameters configured by resources |\n| **MAY** | Behaviors or interfaces Google recommends for an optimal user experience, but does not enforce. - Modify adaptive-responsive rules. - Modify the high-level UI structure of Dialer. The Layout UI component must follow the User Experience Restrictions. |\n\nDialer belongs to a suite of system apps (including Media, Notification Center, and\nApp Launcher), all of which share common styles and assets that are defined at different levels in\nthe AOSP structure:\n\n- `framework/base/core` \n\n All Android base styles are defined here. Specifically, all system app themes are\n based on `Theme.DeviceDefault`, the theme designed for use by OEMs to customize\n device default appearance.\n\n- `packages/services/Car/car_product/overlay` \n\n This folder contains overrides to `Theme.DeviceDefault` which are used to produce\n the AOSP look and feel of Android Automotive. OEMs might opt for excluding this overlay and\n use their own\n instead.\n\n- `packages/apps/Car/libs/car-apps-common` \n\n Common colors and styles shared among AOSP provided system apps. These elements can\n be customized by OEMs using overlays under\n `path/to/overlay/packages/apps/Car/libs/car-apps-common`.\n\n- `packages/apps/Car/Dialer` \n\n Dialer uses its own theme, which extends from `Theme.DeviceDefault` (defined in\n `framework/base`). The layouts, colors, styles, and other resources of Dialer can\n also be customized through the use of an Overlay. Similar to `libs` mentioned\n above, the resource override can be located in\n `path/to/overlay/packages/apps/Car/Dialer`.\n\nMore documentation\n------------------\n\nFor more information about AOSP theming and overlays, see\n[Customize the build with resource\noverlays](/docs/setup/create/new-device#use-resource-overlays)."]]