| <html devsite><head> |
| <title>配置 DND</title> |
| <meta name="project_path" value="/_project.yaml"/> |
| <meta name="book_path" value="/_book.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2017 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <p>Android 7.0 支持以下勿扰 (DND) 配置。</p> |
| |
| <h2 id="third_party">第三方自动规则</h2> |
| <p>第三方应用可以使用 DND Access API 控制 DND 规则:</p> |
| <ul> |
| <li><strong>应用</strong>可以导出并列出自定义 DND 规则,这些规则在 DND 设置中显示在内置 Android DND 规则的旁边。</li> |
| <li><strong>用户</strong>可以访问所有规则(包括自动规则和手动创建的规则)的所有 DND 控件。</li> |
| <li>Android <strong>平台</strong>可以实现来自不同来源的 DND 规则,而不会产生意外状态。</li> |
| </ul> |
| |
| <h2 id="control_alarms">控制闹钟</h2> |
| <p>启用 DND 模式后,Android 设置界面会向用户显示可配置的选项:</p> |
| <ul> |
| <li><strong>DND 结束条件作为下次闹钟响铃时间</strong>。允许用户将 DND 结束条件设为闹钟。仅当闹钟设置时间位于从现在起的一周内,并且闹钟属于的星期几与今天属于的星期几不一样时才会出现。<em></em><em></em>(自动规则不支持。)</li> |
| <li><strong>闹钟响铃时间可覆盖结束时间</strong>。允许用户将 DND 结束条件设为特定时间或下次闹钟响铃时间(以先发生者为准)。</li> |
| </ul> |
| |
| <h2 id="suppress_vis_distract">抑制视觉干扰</h2> |
| <p>Android 设置界面会向用户显示抑制视觉干扰(例如提醒通知、全屏 intent、主动显示和 LED 通知指示灯)的选项。</p> |
| |
| <h2 id="implementation">自定义 DND 设置</h2> |
| <p>自定义设置时,OEM 必须保留系统 API 的 AOSP 行为并维持 DND 设置的行为。具体而言,系统设置中的 DND 设置页面必须包括以下内容:</p> |
| <ul> |
| <li><strong>应用提供的 DND 规则</strong>。这些自动 DND 规则必须包含“添加规则”菜单中的有效规则实例和规则详情。</li> |
| <li><strong>预加载的应用 DND 规则</strong>。OEM 可以提供在最终用户手动创建的规则旁边显示的 DND 规则。</li> |
| </ul> |
| <p>要详细了解新的 DND API,请参阅 <code><a href="https://developer.android.com/reference/android/service/notification/package-summary.html">android.service.notification</a></code> 参考文档。</p> |
| |
| </body></html> |