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.
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.
Kể từ Android 14, API Ghi lại nội dung cho ghi chú cho phép người dùng chụp ảnh màn hình trực tiếp thông qua ứng dụng ghi chú mặc định. Với các API này, người dùng có thể có trải nghiệm ghi chú đa nhiệm bằng cách cắt nội dung ưu tiên trên màn hình và dán nội dung đó vào ghi chú.
API Ghi lại nội dung cho ghi chú được thiết kế dành riêng cho các ứng dụng có vai trò NOTES. Android 14 sử dụng quyền LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE để đảm bảo rằng chỉ các ứng dụng của chủ sở hữu vai trò NOTES mới có thể sử dụng API Ghi chú để chụp nội dung. Các ứng dụng phải kiểm tra xem có quyền hay không trước khi gọi API. Nhà sản xuất thiết bị gốc (OEM) có thể cho phép người dùng đặt ứng dụng ghi chú mặc định bằng cách bật vai trò NOTES.
Hãy xem phần sau để biết thêm thông tin về API Ghi lại nội dung cho Ghi chú:
Tuỳ chỉnh của nhà sản xuất thiết bị gốc (OEM) cho tính năng Ghi lại nội dung cho ứng dụng Ghi chú
Vai trò NOTES cho phép người dùng chọn một ứng dụng ghi chú đủ điều kiện làm ứng dụng ghi chú mặc định. Nhà sản xuất thiết bị gốc (OEM) có thể kiểm soát khả năng sử dụng vai trò NOTES trên thiết bị bằng cách đặt config_enableDefaultNotes. Theo mặc định, giá trị của config_enableDefaultNotes được đặt thành false.
Nếu bật vai trò NOTES, OEM phải hỗ trợ API Ghi lại nội dung cho Ghi chú bằng cách cung cấp các tuỳ chỉnh cần thiết và tích hợp tính năng ghi chú của hệ thống. Nhà sản xuất thiết bị gốc (OEM) có thể chọn tuỳ chỉnh cách triển khai AOSP mặc định hoặc cung cấp cách triển khai của riêng họ bằng cách ghi đè config_screenshotAppClipsServiceComponent hoặc config_screenshotAppClipsActivityComponent.
Tham khảo gói notetask để triển khai tính năng tích hợp ghi chú mặc định của hệ thống.
Bạn cần thực hiện thay đổi trong Giao diện người dùng hệ thống để triển khai API Ghi chú cho tính năng Ghi lại nội dung. Nhà sản xuất thiết bị gốc (OEM) có thể tuỳ chỉnh giao diện người dùng để kích hoạt và chỉnh sửa ảnh chụp màn hình, đồng thời cung cấp phương thức triển khai trong Giao diện người dùng hệ thống Android. Ví dụ về việc tích hợp tuỳ chỉnh của OEM, Giao diện người dùng hệ thống có thể chạy ứng dụng chủ sở hữu vai trò NOTES trên màn hình khoá bằng lối tắt màn hình khoá, chẳng hạn như nút hoặc biểu tượng trên màn hình khoá hoặc cử chỉ dựa trên bút cảm ứng. Tương tự, trên màn hình chính, giao diện người dùng hệ thống có thể chạy ứng dụng chủ sở hữu vai trò NOTES ở chế độ cửa sổ đa nhiệm, chẳng hạn như cửa sổ bong bóng trò chuyện hoặc cửa sổ nổi, bằng cử chỉ dựa trên bút cảm ứng.
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,["# Capture Content for Notes\n\nStarting with Android 14, the Capture Content for Notes\nAPIs let users capture a screenshot directly through the default\nnote-taking app. With these APIs, users can have a multitasking note-taking\nexperience by clipping preferred content on their\nscreen and pasting it into a note.\n\nThe Capture Content for Notes APIs are designed specifically for apps holding the\n[`NOTES`](/docs/core/permissions/android-roles) role. Android\n14 uses the\n[`LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/AndroidManifest.xml#2571) permission to ensure that only\n`NOTES` role holder apps can use the Capture\nContent for Notes APIs. Apps must check if they have the permission before\ncalling the APIs. OEMs can let users set their default note-taking app by\nenabling the [`NOTES`](/docs/core/permissions/android-roles)\nrole.\n\nSee the following for more information about the Capture Content for Notes\nAPIs:\n\n- [`Intent#ACTION_LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE`](https://developer.android.com/reference/android/content/Intent#ACTION_LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE)\n\n- [`Intent#EXTRA_CAPTURE_CONTENT_FOR_NOTE_STATUS_CODE`](https://developer.android.com/reference/android/content/Intent#EXTRA_CAPTURE_CONTENT_FOR_NOTE_STATUS_CODE)\n\n- [`android.permission.LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE`](https://developer.android.com/reference/android/Manifest.permission#LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE)\n\n- [`StatusBarManager#canLaunchCaptureContentActivityForNote`](https://developer.android.com/reference/android/app/StatusBarManager#canLaunchCaptureContentActivityForNote(android.app.Activity))\n\nOEM customization for Capture Content for Notes\n-----------------------------------------------\n\nThe `NOTES` role lets users select an\neligible note taking app to be the default notes app. An OEM can control the\navailability of the `NOTES` role on a device by setting\n[`config_enableDefaultNotes`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/res/values/config.xml#2243). The value of `config_enableDefaultNotes` is\nset to `false` by default.\n\nIf the `NOTES` role is enabled, the OEM must support the Capture Content for\nNotes APIs by providing the necessary customizations and system note-taking\nintegrations. OEMs can choose to customize the [default AOSP\nimplementation](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/packages/SystemUI/src/com/android/systemui/screenshot/appclips), or provide their\nimplementation by overriding\n[`config_screenshotAppClipsServiceComponent`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/res/values/config.xml#3356) or [`config_screenshotAppClipsActivityComponent`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/packages/SystemUI/res/values/config.xml#466).\nRefer to the [`notetask`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/packages/SystemUI/src/com/android/systemui/notetask)\npackage for a default system note-taking integration implementation.\n\nChanges are required in System UI for implementing the Capture Content for\nNotes APIs. OEMs can customize the UI to trigger and edit a screenshot and\nprovide the implementation in the Android System UI. As an example of OEM\ncustomized integration, the System UI can launch a `NOTES` role holder app on\nthe lock screen using a lock screen shortcut, such as a button or icon on the\nlock screen or a stylus-based gesture. Similarly, on the home screen the\nSystem UI can launch the `NOTES` role holder app in a multitasking window\nmode, such as a bubble window or floating window, by a stylus-based gesture.\n| **Note:** An OEM can restrict the availability of the Capture Content for Notes APIs based on windowing mode. As an example, the API can return a status code of `CAPTURE_CONTENT_FOR_NOTE_WINDOW_MODE_UNSUPPORTED` if the default note-taking app isn't running in a floating window. Apps must check if the screenshot functionality is available by calling [`StatusBarManager#canLaunchCaptureContentActivityForNote`](https://developer.android.com/reference/android/app/StatusBarManager#canLaunchCaptureContentActivityForNote(android.app.Activity)).\n\nValidation of Capture Content for Notes\n---------------------------------------\n\nFor CTS-Verifier testing, see\n[Capture Content for Notes test](/docs/compatibility/cts/cts-verifier#content-capture-test).\n| **Note:** Based on the implementation, to test the API, OEMs might require hardware such as a stylus to trigger the system note-taking integration."]]