Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
OnDevicePersonalization
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mô-đun OnDevicePersonalization được giới thiệu trong Android 13 cung cấp một bộ các khối xây dựng được phát triển với quyền riêng tư của người dùng làm nguyên tắc cốt lõi để hỗ trợ việc phát triển các tệp APK mang lại trải nghiệm được cá nhân hoá cho người dùng. Ví dụ về các khối xây dựng được cung cấp bao gồm một công cụ chính sách để bảo vệ các hoạt động vào, ra và được liệt kê trong danh sách cho phép của dữ liệu người dùng. Các chế độ kiểm soát của người dùng có thể được thể hiện dưới dạng các chính sách do công cụ chính sách này thực thi.
Một ví dụ khác về các khối xây dựng được cung cấp bao gồm nhiều phép tính liên kết, chẳng hạn như học liên kết và phân tích liên kết, cho phép huấn luyện cộng tác các mô hình học máy và phân tích dữ liệu thô cục bộ mà không cần thu thập dữ liệu tập trung.
OnDevicePersonalization cố gắng tạo ra trải nghiệm cho nhà phát triển giúp loại bỏ các nút thắt cổ chai phát sinh từ việc thu thập dữ liệu, sự đồng ý, quyền kiểm soát và tuân thủ.
Điều này cho phép nhà sản xuất thiết bị gốc (OEM) và nhà phát triển ứng dụng tập trung vào các phần mới lạ và thú vị về ngữ nghĩa của ứng dụng, đồng thời tận dụng dữ liệu siêu phong phú và theo thời gian thực chỉ có trên các thiết bị.
Động lực
Mục tiêu của mô-đun OnDevicePersonalization là xây dựng công nghệ mới để OEM và nhà phát triển ứng dụng có thể tiếp tục cung cấp trải nghiệm cá nhân hoá chất lượng cao cho người dùng cuối, đồng thời vẫn bảo mật thông tin của người dùng.
Ranh giới mô-đun
Đây là toàn bộ mã mới không có ranh giới mô-đun.
Vị trí mã: packages/modules/OnDevicePersonalization
Hình 1 cho thấy thiết kế API mô-đun OnDevicePersonalization.
Hình 1. Thiết kế API mô-đun OnDevicePersonalization
Chức năng chính của gói sẽ có trong APEX
com.google.android.ondevicepersonalization
.
Chức năng API OnDevicePersonalization sẽ có trong tệp APK com.google.android.ondevicepersonalization
.
Chức năng API FederatedCompute sẽ có trong tệp APK com.google.android.federatedcompute
.
Phần phụ thuộc
- Các thay đổi trong PackageManager để diễn giải thẻ tệp kê khai mới
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],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"]]