自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
零打擾
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 7.0 支援下列請勿打擾 (DND) 設定。
第三方自動規則
第三方應用程式可使用 DND Access API 控管 DND 規則:
- 應用程式可以匯出及列出自訂 DND 規則,這些規則會顯示在 DND 設定中內建的 Android DND 規則旁邊。
- 使用者可以存取所有規則 (自動建立和手動建立的規則皆可) 的所有 DND 控制項。
- 平台可實作來自不同來源的 DND 規則,而不會造成意外狀態。
控制鬧鐘
啟用 DND 模式後,Android 設定 UI 會顯示使用者選項,讓使用者設定下列項目:
- 零打擾模式結束條件為下一個鬧鐘時間。允許使用者將 DND 結束條件設為鬧鐘。只有在鬧鐘設定為從現在起一週內的時間,且鬧鐘的星期幾「不是」與今天相同時,才會顯示。(不支援自動規則)。
- 鬧鐘優先於結束時間。使用者可將「請勿打擾」結束條件設為特定時間或下一個鬧鐘 (兩者取其先)。
抑制視覺干擾
Android 設定 UI 會顯示使用者選項,用於抑制視覺干擾,例如抬頭通知、全螢幕意圖、環境顯示螢幕和 LED 通知燈。
自訂勿擾模式設定
自訂設定時,原始設備製造商必須保留系統 API 的 Android 開放原始碼計畫行為,並維持 DND 設定的行為。具體來說,系統設定中的 DND 設定頁面必須包含下列項目:
- 應用程式提供的 DND 規則。這些自動 DND 規則必須包含「Add Rule」選單中的有效規則例項和規則清單。
- 預先載入的應用程式 DND 規則。OEM 可提供 DND 規則,顯示在使用者手動建立的規則旁邊。
如要進一步瞭解新的 DND API,請參閱 android.service.notification
參考說明文件。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Do not disturb\n\nAndroid 7.0 supports the following do not disturb (DND) configurations.\n\nThird-party automatic rules\n---------------------------\n\nThird-party applications can use the DND Access API to control DND rules:\n\n- **Applications** can export and list custom DND rules, which appear next to built-in Android DND rules in the DND settings.\n- **Users** can access all DND controls for all rules (both automatic and manually-created).\n- The **platform** can implement DND rules from different sources without creating unexpected states.\n\nControl alarms\n--------------\n\nWhen DND mode is enabled, the Android settings UI presents user options for\nconfiguring:\n\n- **DND end condition as next alarm time** . Enables user to set the DND end condition to an alarm. Appears only if an alarm is set for a time within a week from now *and* the day of the week for that alarm is *not* the same day of the week as today. (Not supported for automatic rules.)\n- **Alarm can override end time**. Enables users to configure the DND end condition as a specific time or next alarm (whichever comes first).\n\nSuppress visual distractions\n----------------------------\n\nThe Android settings UI presents user options for suppressing visual\ndistractions such as heads up notifications, fullscreen intents, ambient\ndisplay, and LED notification lights.\n\nCustomize DND settings\n----------------------\n\nWhen customizing settings, OEMs must preserve the AOSP behavior of the system\nAPIs and maintain the behavior of DND settings. Specifically, the DND settings\npage in system settings must include the following:\n\n- **Application-provided DND rules**. These automated DND rules must include active rules instances and rule listings in the Add Rule menu.\n- **Pre-loaded application DND rules**. OEMs can provide DND rules that appear next to end user manually-created rules.\n\nFor details on new DND APIs, refer to\n[android.service.notification](https://developer.android.com/reference/android/service/notification/package-summary.html)\nreference documentation."]]