自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
OnDevicePersonalization
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 13 中引入的 OnDevicePersonalization 模块提供了一组构建块,这些构建块以用户隐私为核心原则,旨在支持开发能够为用户提供个性化体验的 APK。提供的构建块示例包括政策引擎,用于保护用户数据的入站流量、出站流量和列入许可名单的操作。用户控件可以表示为由此政策引擎强制执行的政策。
提供的另一个构建块示例包含各种联邦计算,例如联邦学习和联邦分析,使技术人员能够对机器学习模型进行协作训练以及分析本地原始数据而无需集中收集数据
OnDevicePersonalization 试图为开发者打造一种良好的体验,消除因数据收集、征得用户同意、控制和法规遵从而产生的瓶颈。这样一来,原始设备制造商 (OEM) 和应用开发者便能够集中精力处理应用中新的、在语义上有意义的部分,并充分利用仅在设备上提供的无比丰富的实时数据。
动机
OnDevicePersonalization 模块的目标是构建新技术,使 OEM 和应用开发者能够继续为最终用户提供高质量的个性化体验,同时保护用户信息的私密性。
模块边界
这是全新代码,不存在任何模块边界。
代码位置:packages/modules/OnDevicePersonalization
图 1 显示了 OnDevicePersonalization 模块的 API 设计。
图 1. OnDevicePersonalization 模块的 API 设计
软件包的主要功能将在 APEX com.google.android.ondevicepersonalization
中提供。
OnDevicePersonalization API 功能将在 APK com.google.android.ondevicepersonalization
中提供。
FederatedCompute API 功能将在 APK com.google.android.federatedcompute
中提供。
依赖项
- 在 PackageManager 中进行了更改,以解读新的清单标记
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-11。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-11。"],[],[],null,["# OnDevicePersonalization\n\nThe OnDevicePersonalization module, introduced in Android 13,\nprovides a set of building blocks developed with user privacy as their core\ntenet, to support development of APKs that offer a personalized experience for\ntheir users. Examples of the building blocks provided include a policy engine\nto guard the ingress, egress, and allow-listed operations of user data. User\ncontrols can be expressed as policies that are enforced by this policy engine.\nAnother example of the building blocks provided includes various federated\ncomputations, such as\n[federated learning](https://ai.googleblog.com/2017/04/federated-learning-collaborative.html)\nand [federated analytics](https://ai.googleblog.com/2020/05/federated-analytics-collaborative-data.html),\nthat enable collaborative training of machine learning models and analysis of\nlocal raw data without central data collection.\n\nOnDevicePersonalization attempts to create a developer experience that removes\nbottlenecks that arose from data collection, consent, control and compliance.\nThis allows OEMs and app developers to focus on the novel and semantically\ninteresting parts of their applications and take advantage of the super-rich and\nreal-time data that's available only on the devices.\n\nMotivation\n----------\n\nThe goal of the OnDevicePersonalization module is to build new technology to\nenable OEMs and app developers to continue to offer a quality personalization\nexperience to their end users while keeping user information private.\n\nModule boundary\n---------------\n\nThis is all new code with no module boundary.\n\nCode Location: `packages/modules/OnDevicePersonalization`\n\nFigure 1 shows the OnDevicePersonalization module API design.\n\n**Figure 1.** OnDevicePersonalization module API design\n\nPackage format\n--------------\n\nMain functionality for the package will be available in APEX\n`com.google.android.ondevicepersonalization`.\n\nOnDevicePersonalization API functionality will be available in APK\n`com.google.android.ondevicepersonalization`.\n\nFederatedCompute APIs functionality will be available in APK\n`com.google.android.federatedcompute`.\n\nDependencies\n------------\n\n- Changes in PackageManager to interpret the new manifest tag"]]