Docs: Changes to source.android.com

  - 181204744 Devsite localized content from translation request b4bd44... by Android Partner Docs <[email protected]>
  - 181204738 Devsite localized content from translation request 6e2e74... by Android Partner Docs <[email protected]>
  - 181204731 Devsite localized content from translation request c6da36... by Android Partner Docs <[email protected]>
  - 181184337 Adding nav for vndk build system support file (includes v... by Heidi von Markham <[email protected]>
  - 181184012 Add details on enabling vndk for a partner codebase. by Heidi von Markham <[email protected]>
  - 181181304 Drop path prefix "platform/" in human readable reference ... by Android Partner Docs <[email protected]>
  - 180959465 Update public documentation around versions of OpenJDK bu... by Android Partner Docs <[email protected]>
  - 180959038 Update home page with Jan 2018 bulletins by Danielle Roberts <[email protected]>
  - 180944987 Update january 2018 bulletin with AOSP links by Danielle Roberts <[email protected]>
  - 180939327 Devsite localized content from translation request 9d7ae6... by Android Partner Docs <[email protected]>
  - 180939213 Devsite localized content from translation request 761984... by Android Partner Docs <[email protected]>
  - 180939203 Devsite localized content from translation request 37ad64... by Android Partner Docs <[email protected]>
  - 180813220 Devsite localized content from translation request 45f650... by Android Partner Docs <[email protected]>
  - 180813011 Devsite localized content from translation request 7a3ee2... by Android Partner Docs <[email protected]>
  - 180813003 Devsite localized content from translation request 52d1dd... by Android Partner Docs <[email protected]>
  - 180721815 Update Jan 2018 bulletin with announcement about CVE-2017... by Danielle Roberts <[email protected]>
  - 180718550 Update to January 2018 bulletin for coordinated disclosure by Danielle Roberts <[email protected]>
  - 180689483 Devsite localized content from translation request 015eda... by Android Partner Docs <[email protected]>
  - 180689471 Devsite localized content from translation request 86e026... by Android Partner Docs <[email protected]>
  - 180688614 Added note about requirement to restart the audioserver by Android Partner Docs <[email protected]>
  - 180681938 Add tags for January Security Release. by Android Partner Docs <[email protected]>
  - 180580440 Publish Dec 2017 Pixel bulletins by Danielle Roberts <[email protected]>
  - 180574446 Clarify OTA updates instructions in FBE docs by Danielle Roberts <[email protected]>
  - 180566242 Update researcher acknowledgement for CVE-2017-13221 by Danielle Roberts <[email protected]>
  - 180562297 January 2018 Pixel and Android Security bulletins by Danielle Roberts <[email protected]>
  - 180562227 Devsite localized content from translation request a4ca37... by Android Partner Docs <[email protected]>
  - 180562222 Devsite localized content from translation request f65459... by Android Partner Docs <[email protected]>
  - 180561535 Devsite localized content from translation request 881cd3... by Android Partner Docs <[email protected]>
  - 180561527 Devsite localized content from translation request 51b684... by Android Partner Docs <[email protected]>
  - 180561524 Devsite localized content from translation request 226f2c... by Android Partner Docs <[email protected]>
  - 180560907 Devsite localized content from translation request 9b462a... by Android Partner Docs <[email protected]>
  - 180560904 Devsite localized content from translation request 1e3945... by Android Partner Docs <[email protected]>
  - 180560895 Devsite localized content from translation request 60fa89... by Android Partner Docs <[email protected]>
  - 180560177 Devsite localized content from translation request 9f6556... by Android Partner Docs <[email protected]>
  - 180560173 Devsite localized content from translation request 37eb85... by Android Partner Docs <[email protected]>
  - 180560169 Devsite localized content from translation request abf551... by Android Partner Docs <[email protected]>
  - 180214623 Devsite localized content from translation request 69a1b1... by Android Partner Docs <[email protected]>
  - 180214622 Devsite localized content from translation request abe464... by Android Partner Docs <[email protected]>
  - 180214009 Devsite localized content from translation request 1c13f2... by Android Partner Docs <[email protected]>
  - 180214006 Devsite localized content from translation request 9237e3... by Android Partner Docs <[email protected]>
  - 180214003 Devsite localized content from translation request 1116f7... by Android Partner Docs <[email protected]>
  - 179974666 Devsite localized content from translation request afb4de... by Android Partner Docs <[email protected]>
  - 179932481 Devsite localized content from translation request 499773... by Android Partner Docs <[email protected]>
  - 179932464 Devsite localized content from translation request 6bcb66... by Android Partner Docs <[email protected]>
  - 179932462 Devsite localized content from translation request 6c13a3... by Android Partner Docs <[email protected]>
  - 179931339 Correct out of place punctuation by Danielle Roberts <[email protected]>
  - 179874281 Add libFuzzer docs to SAC. by Danielle Roberts <[email protected]>
  - 179859323 Exclude compatibility/source from localization by Danielle Roberts <[email protected]>
  - 179836094 Devsite localized content from translation request 3dae55... by Android Partner Docs <[email protected]>
  - 179835757 Devsite localized content from translation request 76210b... by Android Partner Docs <[email protected]>
  - 179835692 Devsite localized content from translation request eab645... by Android Partner Docs <[email protected]>
  - 179835686 Devsite localized content from translation request 23e94d... by Android Partner Docs <[email protected]>
  - 179778362 Devsite localized content from translation request 6406f2... by Android Partner Docs <[email protected]>
  - 179688064 Devsite localized content from translation request 713535... by Android Partner Docs <[email protected]>
  - 179622714 Add information about where to find OTA logs for both A/B... by Christina Nguyen <[email protected]>
  - 179617573 Incorporate CDD source assets in google3 to allow buildin... by Clay Murphy <[email protected]>

PiperOrigin-RevId: 181204744
Change-Id: If0130be7bf5d5544f5b0ddda0977243b884b9943
diff --git a/zh-cn/devices/tech/settings/info-architecture.html b/zh-cn/devices/tech/settings/info-architecture.html
new file mode 100644
index 0000000..6deb57e
--- /dev/null
+++ b/zh-cn/devices/tech/settings/info-architecture.html
@@ -0,0 +1,224 @@
+<html devsite><head>
+    <title>已更新的信息架构</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 8.0 为“设置”应用引入了全新的信息架构。新信息架构的目标是简化设置的整理方式,便于用户快速查找自定义 Android 设备所需的设置。
+</p>
+
+<h2 id="examples-and-source">示例和源代码</h2>
+
+<p>
+“设置”中的大多数页面目前都是使用新框架实现的。一个很好的例子是 DisplaySettings:<code>packages/apps/Settings/src/com/android/settings/DisplaySettings.java</code>
+</p>
+
+<p>
+重要组件的文件路径如下所示:
+</p>
+
+<h3 id="categorykey">CategoryKey</h3>
+
+<code>packages/SettingsLib/src/com/android/settingslib/drawer/CategoryKey.java</code>
+
+<h3 id="dashboardfragmentregistry">DashboardFragmentRegistry</h3>
+
+<code>packages/apps/Settings/src/com/android/settings/dashboard/DashboardFragmentRegistry.java</code>
+
+<h3 id="dashboardfragment">DashboardFragment</h3>
+
+<code>packages/apps/Settings/src/com/android/settings/dashboard/DashboardFragment.java</code>
+
+<h3 id="preferencecontrollers">AbstractPreferenceController 和 PreferenceController</h3>
+
+<code>frameworks/base/packages/SettingsLib/src/com/android/settingslib/core/AbstractPreferenceController.java</code>
+
+<code>packages/apps/Settings/src/com/android/settings/core/PreferenceController.java</code>
+
+<h2 id="implementation">实现</h2>
+
+<p>
+建议设备制造商调整现有的“设置”信息架构,并根据需要插入其他设置页面以适应合作伙伴的特定功能。将偏好设置从旧页面(实现为 SettingsPreferencePage)移到新页面(使用 DashboardFragment 实现)可能很复杂。旧页面的偏好设置在实现时可能没有创建 PreferenceController。
+</p>
+
+<p>
+因此将偏好设置移到 DashboardFragment 中时,合作伙伴需要创建一个 PreferenceController,并且先将代码移到控制器中,然后在新的 DashboardFragment 中对偏好设置实例化。重构过程相当简单,因为大部分操作只是移动现有代码。
+</p>
+
+<p>
+完成重构后,原始设备制造商 (OEM) 应提交带有测试的补丁程序 CL 以将其更改合并到上游。
+</p>
+
+<h3 id="plugin">插件样式信息架构</h3>
+
+<p>
+每个设置项都作为偏好设置进行实现。可以轻松地将偏好设置从一个页面移到另一个页面。
+</p>
+
+<p>
+为了方便移动多个设置,Android O 引入了包含设置项的插件样式托管方片段。设置项被建模为插件样式控制器。因此,设置页面由单个托管方片段和多个设置控制器构成。
+</p>
+
+<h3 id="dashboard-fragment">DashboardFragment</h3>
+
+<p>
+这是插件样式偏好设置控制器的托管方。该片段继承自 PreferenceFragment,并具有用于放大和更新静态偏好设置列表与动态偏好设置列表的钩子。
+</p>
+
+<h3 id="static-preferences">静态偏好设置</h3>
+
+<p>
+静态偏好设置列表在 XML 中使用<preference>
+标记定义。DashboardFragment 实现使用 getPreferenceScreenResId() 方法来定义哪个 XML 文件包含要显示的偏好设置静态列表。
+</preference></p>
+
+<h3 id="dynamic-preferences">动态偏好设置</h3>
+
+<p>
+动态项表示具有 intent 的图块,会引向外部或内部 Activity。通常,intent 会引向不同的设置页面。例如,“设置”首页中的“Google”设置项就是一个动态项。动态项在 AndroidManifest 中定义(参见下文),并通过 FeatureProvider(定义为 DashboardFeatureProvider)加载。
+</p>
+
+<p>
+请注意,动态设置的负载高于静态配置的设置,因此通常开发者应将设置实现为静态设置。但是,在以下任一情况下,动态设置非常有用:
+</p>
+
+<ul>
+<li>设置未在“设置”应用中直接实现(例如,注入由 OEM/运营商应用实现的设置)。</li>
+<li>设置应显示在“设置”首页上。</li>
+<li>您已具有设置的 Activity,不想要实现额外的静态配置。</li>
+</ul>
+
+<p>
+要将 Activity 配置为动态设置,您需要执行以下操作:
+</p>
+
+<ul>
+<li>将该 Activity 标记为动态设置。为此,只需将 intent 过滤器添加到该 Activity 即可。</li>
+<li>告诉“设置”应用其所属的类别。该类别是在 <strong>CategoryKey</strong> 中定义的常量。</li>
+<li>可选:显示设置时,添加总结文本。</li>
+</ul>
+
+<p>
+以下是从“设置”应用的 DisplaySettings 中摘取的示例。
+</p>
+
+<pre class="prettyprint">
+&lt;activity android:name="Settings$DisplaySettingsActivity"
+                   android:label="@string/display_settings"
+                   android:icon="@drawable/ic_settings_display"&gt;
+             &lt;!-- Mark the activity as a dynamic setting --&gt;
+              &lt;intent-filter&gt;
+                     &lt;action android:name="com.android.settings.action.IA_SETTINGS" /&gt;
+              &lt;/intent-filter&gt;
+             &lt;!-- Tell Settings app which category it belongs to --&gt;
+              &lt;meta-data android:name="com.android.settings.category"
+                     android:value="com.android.settings.category.ia.homepage" /&gt;
+             &lt;!-- Add a summary text when the setting is displayed --&gt;
+              &lt;meta-data android:name="com.android.settings.summary"
+                     android:resource="@string/display_dashboard_summary"/&gt;
+             &lt;/activity&gt;
+</pre>
+
+<p>
+在呈现时,片段将请求在 AndroidManifest 中定义的静态 XML 和动态设置偏好设置列表。无论在哪个来源中加载设置,DashboardFragment 都通过 PreferenceController 管理每个设置的处理逻辑(参见下文)。<strong></strong>然后,它们将以混合列表的形式显示在界面上。
+</p>
+
+<h3 id="preference-controller">PreferenceController</h3>
+
+<p>
+PreferenceController 包含与偏好设置互动的所有逻辑,包括显示/更新/编入搜索索引等。
+</p>
+
+<p>
+相应地,PreferenceController 的接口具有 isAvailable()、displayPreference()、handlePreferenceTreeClicked() 等的 API。有关每个 API 的详细文档可以在相应接口类中找到。
+</p>
+
+<p>
+在为片段安装偏好设置时,信息中心会提供一种在显示之前附加 PreferenceController 的方法。在安装时,控制器将连接到片段,以便将来的所有相关事件均发送到控制器。
+</p>
+
+<p>
+DashboardFragment 将在屏幕中保留 PreferenceController 的列表。在片段的 onCreate() 中,将为 isAvailable() 方法调用所有控制器,如果其返回 true,将调用 displayPreference() 来处理显示逻辑。
+</p>
+
+<h2 id="using-dashboardfragment">使用 DashboardFragment</h2>
+
+<h3 id="moving-preference">将偏好设置从页面 A 移到页面 B</h3>
+
+<p>
+如果偏好设置静态地列在原始页面的偏好设置 XML 文件中,请遵循下面的<strong>静态</strong>路径。否则,请遵循<strong>动态</strong>路径。
+</p>
+
+<h4 id="static-move">静态</h4>
+
+<ol>
+<li>查找原始页面和目标页面的偏好设置 XML 文件。</li>您可以从页面的 getPreferenceScreenResId() 方法中找到此信息。
+<li>移除原始页面的 XML 中的偏好设置。</li>
+<li>将偏好设置添加到目标页面的 XML 中。</li>
+<li>在原始页面的 Java 实现中移除此偏好设置的 PreferenceController。通常它在 getPreferenceController() 中。</li>
+<strong>注意</strong>:偏好设置可能没有 PreferenceController。
+<li>在目标页面的 getPreferenceController() 中实例化 PreferenceController。</li>
+</ol>
+
+<h4 id="dynamic-move">动态</h4>
+
+<ol>
+<li>查找原始页面和目标页面托管的类别。您可以在 <code>DashboardFragmentRegistry</code> 中找到此信息。</li>
+<li>打开包含您需要移动的设置的 <code>AndroidManifest.xml</code> 文件,并找到表示此设置的 Activity 条目。</li>
+<li>更改该 Activity 的“com.android.settings.category”元数据值,将值设置为新页面的类别键。</li>
+</ol>
+
+<h3 id="creating-a-new-preference">在页面中创建新的偏好设置</h3>
+
+<p>
+如果偏好设置静态地列在原始页面的偏好设置 XML 文件中,请遵循下面的<strong>静态</strong>路径。否则,请遵循<strong>动态</strong>路径。
+</p>
+
+<h4 id="static-create">静态</h4>
+
+<ol>
+<li>找到页面的偏好设置 XML 文件。您可以从页面的 getPreferenceScreenResId() 方法中找到此信息。</li>
+<li>在 XML 中添加一个新的偏好设置项。确保其具有独特的 android:key。</li>
+<li>在页面的 getPreferenceControllers() 方法中为此偏好设置实例化一个 PreferenceController。</li>如果该偏好设置已存在于其他地方,则表示其可能已具有 PreferenceController。您可以重新使用该 PreferenceController,无需构建新的 PreferenceController。
+</ol>
+
+<h4 id="dynamic-create">动态</h4>
+
+<ol>
+<li>查找原始页面和目标页面托管的类别。您可以在 <code>DashboardFragmentRegistry</code> 中找到此信息。</li>
+<li>在 AndroidManifest 中创建一个新的 Activity,并添加必要的元数据来定义设置。将“com.android.settings.category”的元数据值设置为与第 1 步中定义的值相同。</li>
+</ol>
+
+<h3 id="create-new-page">新建页面</h3>
+<ol>
+<li>创建一个继承自 DashboardFragment 的新片段。</li>
+<li>在 <code>DashboardFragmentRegistry</code> 中定义其类别。
+<p class="note"><strong>注意</strong>:此步骤是可选的。如果您在此页面中不需要任何动态偏好设置,则不需要提供类别键。</p></li>
+<li>遵循添加此页面所需设置的步骤进行操作。</li>
+</ol>
+
+<h2 id="validation">验证</h2>
+
+<ul>
+<li>在“设置”中运行 robolectric 测试,所有现有测试和新测试都应通过。
+</li><li>编译并安装“设置”,手动打开正在被修改的页面;该页面应立即更新。</li>
+</ul>
+
+</body></html>
\ No newline at end of file