blob: adb5fc12154c53a7aff536704ddaf51fe1274e1f [file] [log] [blame]
<html devsite><head>
<meta name="book_path" value="/_book.yaml"/>
<meta name="project_path" value="/_project.yaml"/>
</head>
<body>
<!--
Copyright 2018 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.
-->
<h1 id="deprecating_health10" class="page-title">弃用 health@1.0</h1>
<p>在根据标准 <a href="/devices/architecture/vintf/fcm#hal-version-deprecation">HAL 弃用时间表</a>彻底弃用 health@1.0 之前,框架将继续支持 health@1.0。弃用 health@1.0(即从<a href="/devices/architecture/vintf/comp-matrices">框架兼容性矩阵</a>中移除相关条目)后,也必须从系统中移除 <code>healthd</code><code>libbatterymonitor</code>,以免 healthd 出现未知行为。由于 health@1.0 是可选 HAL,且 health@1.0 的所有 <code>healthd</code> 依赖项都受 NULL 检查的保护,因此弃用不得被任何事项打断。</p>
<p>根据弃用时间表,当 Android 移除旧版代码路径(healthd、health@1.0)时,Health@1.0 HAL 便会被弃用。此外,Android 还会移除以下内容:</p>
<ol>
<li>框架中的 healthd 依赖项</li>
<li>healthd</li>
<li>系统中的 health@1.0 HAL 定义库</li>
<li>框架兼容性矩阵中的 health@1.0 条目</li>
</ol>
<h2 id="removing_healthd">移除 healthd</h2>
<p>对于搭载 Android 9 以及升级至 Android 9 且在新的供应商映像中提供 Health 2.0 HAL 的设备,我们建议从系统映像中移除 <code>healthd</code>,以便节省磁盘空间以及加快启动速度。</p>
<p>为此,请执行以下操作:</p>
<ol>
<li><p>从系统映像中移除 <code>healthd</code><code>healthd.rc</code>,方法是在 Soong 中向特定于设备的实现中添加以下行:</p>
<pre class="prettyprint"><code>cc_binary {
name: "android.hardware.health@2.0-service.device_name"
overrides: ["healthd"],
// ...
}
</code></pre>
<p>或者,如果模块在 Make 中:</p>
<pre class="prettyprint lang-yaml"><code>LOCAL_MODULE_NAME := \
android.hardware.health@2.0-service.device_name
LOCAL_OVERRIDES_MODULES := healthd
</code></pre>
<p>如果已安装默认实现 <code>android.hardware.health@2.0-service</code>,则改为实现特定于设备的 <code>android.hardware.health@2.0-service.device_name</code>。有关详情,请参阅<a href="/devices/tech/health/implementation">实现 Health</a></p></li>
<li><p>将以下行添加到 <code>BoardConfig.mk</code>,以从框架清单中移除备份实例。这样可以确保框架清单正确反映设备上的 HAL,并让相关 VTS 测试可以顺利通过。</p>
<pre class="prettyprint lang-make"><code>DEVICE_FRAMEWORK_MANIFEST_FILE += \
system/libhidl/vintfdata/manifest_healthd_exclude.xml
</code></pre></li>
</ol>
</body></html>