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.
AdServices
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 AdServices được giới thiệu trong Android 13, hỗ trợ sáng kiến Hộp cát về quyền riêng tư nhằm tạo ra các công nghệ vừa bảo vệ quyền riêng tư của người dùng trên mạng, vừa cung cấp cho các công ty và nhà phát triển công cụ để xây dựng doanh nghiệp kỹ thuật số vững mạnh.
Bạn có thể xem thêm thông tin trên trang web dành cho nhà phát triển Android.
Động lực
Mục tiêu của Sáng kiến Hộp cát về quyền riêng tư là:
- Xây dựng công nghệ mới nhằm bảo mật thông tin của người dùng
- Giúp các nhà xuất bản và nhà phát triển tiếp tục cung cấp nội dung miễn phí trên mạng
- Cộng tác với ngành để xây dựng các tiêu chuẩn mới về quyền riêng tư trên Internet
Ranh giới mô-đun
Cấu trúc AdServices: Đây là tất cả mã mới không có ranh giới mô-đun.
Vị trí mã: packages/modules/AdServices
Hình 1 cho thấy cách thiết lập mô-đun AdServices.
Hình 1. Thiết kế API mô-đun AdServices
Hình 2. Thiết lập mô-đun AdServices
Chức năng chính của gói sẽ có trong APEX:
com.google.android.adservices
.
Chức năng của API Bảo đảm quyền riêng tư sẽ có trong tệp APK com.google.android.adservices.api
.
Chức năng Thời gian chạy SDK sẽ có trong com.google.android.app.sdksandbox
APK.
Bạn có thể tìm hiểu thêm về AdServices trên các trang sau:
Phần phụ thuộc
- Miền sepolicy mới cho SDKSandbox
- Các hạn chế đối với SDKSandbox: bộ nhớ, ý định, thông báo truyền tin, v.v. bị hạn chế
- Xác định rõ các quyền; SDK quảng cáo không kế thừa quyền từ ứng dụng
- Thay đổi về hệ điều hành để xử lý UID hộp cát
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,["# AdServices\n\nThe AdServices module, introduced in Android 13,\nsupports the Privacy Sandbox initiative that aims to\ncreate technologies that both protect people's privacy online and give companies\nand developers tools to build thriving digital businesses.\n\nMore information is available on the\n[Android Developer site](https://developer.android.com/privacy-sandbox).\n\nMotivation\n----------\n\nThe goals of the Privacy Sandbox Initiative are:\n\n- Build new technology to keep user information private\n- Enable publishers and developers to keep online content free\n- Collaborate with the industry to build to new internet privacy standards\n\nModule boundary\n---------------\n\nAdServices architecture: This is all new code with no module boundary.\n\nCode location: `packages/modules/AdServices`\n\nFigure 1 shows the AdServices module setup.\n\n**Figure 1.** AdServices module API design\n\n**Figure 2.** AdServices module setup\n\nPackage format\n--------------\n\nMain functionality for the package will be available in APEX:\n`com.google.android.adservices`.\n\nPrivacy Preserving APIs functionality will be available in APK\n`com.google.android.adservices.api`.\n\nSDK Runtime functionality will be available in APK\n`com.google.android.app.sdksandbox`.\n\nYou can learn more about AdServices on the following pages:\n\n- [Privacy Sandbox Overview](https://developer.android.com/design-for-safety/ads/introduction)\n- [SDK Runtime Design](https://developer.android.com/design-for-safety/ads/sdk-runtime)\n- [Topics Design](https://developer.android.com/design-for-safety/ads/topics)\n- [FLEDGE on Android Design](https://developer.android.com/design-for-safety/ads/fledge)\n- [Attribution Reporting Design](https://developer.android.com/design-for-safety/ads/attribution)\n\nDependencies\n------------\n\n- New sepolicy domain for SDKSandbox\n- Restrictions for SDKSandbox: limited storage, intents, broadcasts, etc.\n- Well defined permissions; ad SDKs do not inherit permissions from apps\n- OS changes to deal with sandbox UIDs"]]