aboutsummaryrefslogtreecommitdiff
path: root/en/devices
diff options
context:
space:
mode:
authorAndroid Partner Docs <noreply@android.com>2019-03-07 18:22:07 -0800
committerMark Hecomovich <mheco@google.com>2019-03-08 14:42:07 -0800
commit02a62fc2556af74122fd3ab113a393961bec4ec7 (patch)
tree4fc625b75722efdc316a8e96d243031ce7f77e9f /en/devices
parentdc15581cd922e7f9af57841ed95f18f2d7e5495b (diff)
downloadsource.android.com-02a62fc2556af74122fd3ab113a393961bec4ec7.tar.gz
Docs: Changes to source.android.com
- 237368408 Remove outdated prod-tests directory from TradeFed full e... by Android Partner Docs <noreply@android.com> - 237350230 Clarify HAL types documentation. by Android Partner Docs <noreply@android.com> - 236961866 Fix Carrier Privileges Coding by Android Partner Docs <noreply@android.com> - 236953823 Tiny updates to the context of Vulkan driver loading path by Android Partner Docs <noreply@android.com> - 236924191 Adding Android AOSP links to March bulletin by Luke Haviland <lhaviland@google.com> - 236923884 Remove references to plus.google.com (site-androidsource) by Android Partner Docs <noreply@android.com> - 236882215 Updating March acknowledgements by Luke Haviland <lhaviland@google.com> - 236873563 Update preferred paths for 32-bit and 64-bit Vulkan drivers by Android Partner Docs <noreply@android.com> - 236868137 Hi Oliver, by Janet Davies <janetd@google.com> - 236726426 Add March 2019 builds. by Android Partner Docs <noreply@android.com> - 236689731 Minor updates to the tables by Luke Haviland <lhaviland@google.com> - 236681963 Making a minor addition to the bulletin toc by Luke Haviland <lhaviland@google.com> - 236678413 Adding the March Android Security bulletin and March Pixe... by Luke Haviland <lhaviland@google.com> - 236673708 Fix typo manfiest -> manifest. by Christina Nguyen <cqn@google.com> - 235838645 Add SAC documentation for BPF loader and library. by Android Partner Docs <noreply@android.com> - 235821854 Edit pass on Running Builds (https://source.android.com/s... by Android Partner Docs <noreply@android.com> - 235815012 Edit pass on Codenames, Tags, and Build Numbers (https://... by Android Partner Docs <noreply@android.com> - 235812663 Edit pass on Repo Command Reference (https://source.andro... by Android Partner Docs <noreply@android.com> - 235789592 Thanks for the feedback! I've implemented many of your su... by Janet Davies <janetd@google.com> - 235769712 Devsite localized content from translation request 1106459. by Android Partner Docs <noreply@android.com> - 235587876 Devsite localized content from translation request 1109500. by Android Partner Docs <noreply@android.com> - 235534951 Devsite localized content from translation request 1109511. by Android Partner Docs <noreply@android.com> - 235209060 Remove hash for old version of repo launcher by Jonathan Nieder <jrn@google.com> - 235025409 Fix typo where CD should be CS for CarService by Christina Nguyen <cqn@google.com> - 235025357 Fix broken link to CDD by Christina Nguyen <cqn@google.com> - 235012131 fixing a typo on the acknowledgements page by Luke Haviland <lhaviland@google.com> - 234852960 Devsite localized content from translation request 1106169. by Android Partner Docs <noreply@android.com> - 234833556 adiantum.html: update docs for ro.crypto.fde_sector_size=... by Android Partner Docs <noreply@android.com> - 234665608 Devsite localized content from translation request 1087341. by Android Partner Docs <noreply@android.com> - 234657766 Devsite localized content from translation request 1096411. by Android Partner Docs <noreply@android.com> - 234657725 Devsite localized content from translation request 1106178. by Android Partner Docs <noreply@android.com> - 234634808 Devsite localized content from translation request 1105660. by Android Partner Docs <noreply@android.com> - 234231718 Fix links to video tutorials by Kenneth Lau <kennethlau@google.com> - 234220903 SAC: Frequently Asked Questions review. Edit on https://s... by Android Partner Docs <noreply@android.com> - 234184499 Devsite localized content from translation request 1087341. by Android Partner Docs <noreply@android.com> - 234184481 Devsite localized content from translation request 1099561. by Android Partner Docs <noreply@android.com> - 234179638 Remove broken link and add class="external" to other exis... by Christina Nguyen <cqn@google.com> - 234178070 Devsite localized content from translation request 1097091. by Android Partner Docs <noreply@android.com> - 234046591 Remove statement saying there is no reason to support an ... by Android Partner Docs <noreply@android.com> - 234029786 Add older software versions and dockerfile to home news s... by Android Partner Docs <noreply@android.com> - 234015232 Split older software requirements, add reference to Brew by Android Partner Docs <noreply@android.com> - 233981017 Adding the links to the different localized bulletins for... by Luke Haviland <lhaviland@google.com> - 233973380 Devsite localized content from translation request 1097923. by Android Partner Docs <noreply@android.com> - 233973369 Devsite localized content from translation request 1102380. by Android Partner Docs <noreply@android.com> - 233823430 Use public inheritance for death recipient by Android Partner Docs <noreply@android.com> - 233794149 [SAC Bug] Update CTS/CTS-Verifier/ CTS_Instant downloads ... by Android Partner Docs <noreply@android.com> - 233764143 Devsite localized content from translation request 1099993. by Android Partner Docs <noreply@android.com> - 233631227 Devsite localized content from translation request 1094224. by Android Partner Docs <noreply@android.com> - 233493892 Adding the language links for the February Pixel update b... by Luke Haviland <lhaviland@google.com> - 233441581 Refix broken androidPVersionNumber references, previously... by Android Partner Docs <noreply@android.com> - 233152761 Devsite localized content from translation request 1090175. by Android Partner Docs <noreply@android.com> - 233152754 Devsite localized content from translation request 1087342. by Android Partner Docs <noreply@android.com> - 233152743 Devsite localized content from translation request 1091263. by Android Partner Docs <noreply@android.com> - 233152670 Devsite localized content from translation request 1090620. by Android Partner Docs <noreply@android.com> - 233152665 Devsite localized content from translation request 1087226. by Android Partner Docs <noreply@android.com> - 233152657 Devsite localized content from translation request 1048627. by Android Partner Docs <noreply@android.com> - 233147805 SAC: Setup section review: Edit pass on https://source.an... by Android Partner Docs <noreply@android.com> - 233146480 Devsite localized content from translation request 1098780. by Android Partner Docs <noreply@android.com> - 233146470 Devsite localized content from translation request 1100731. by Android Partner Docs <noreply@android.com> - 233146436 Devsite localized content from translation request 1101137. by Android Partner Docs <noreply@android.com> - 233146429 Devsite localized content from translation request 1094060. by Android Partner Docs <noreply@android.com> - 233146413 Devsite localized content from translation request 1093403. by Android Partner Docs <noreply@android.com> - 233146350 Devsite localized content from translation request 552907. by Android Partner Docs <noreply@android.com> - 233146342 Devsite localized content from translation request 1101617. by Android Partner Docs <noreply@android.com> - 233146331 Devsite localized content from translation request 1096407. by Android Partner Docs <noreply@android.com> - 233144688 SAC: Codelines, Branches, and Releases review: Edit pass ... by Android Partner Docs <noreply@android.com> - 233128566 Link fixes in Section 2. by Gina Dimino <gdimino@google.com> - 232966483 Add an fdsan example to the catalog of crashes. by Android Partner Docs <noreply@android.com> - 232964119 Investigating Best Practices Nav issue. by Luke Haviland <lhaviland@google.com> - 232929687 Devsite localized content from translation request 1093398. by Android Partner Docs <noreply@android.com> - 232929676 Devsite localized content from translation request 1099994. by Android Partner Docs <noreply@android.com> - 232928252 Investigating nav issue in security section by Luke Haviland <lhaviland@google.com> - 232912276 Jan errata for Android CDD. by Gina Dimino <gdimino@google.com> - 232911265 Hello, by Aparna Kliebenstein <ashelke@google.com> - 232759249 SAC: Codenames, Tags, and Build Numbers review: Edit pass... by Android Partner Docs <noreply@android.com> - 232705879 Is -> are for plural by Android Partner Docs <noreply@android.com> - 232556107 Add ro.product.product.name lunch command, interlink betw... by Android Partner Docs <noreply@android.com> - 232518991 Automated g4 rollback of changelist 232334781. by Luke Haviland <lhaviland@google.com> - 232391965 Add tags for 2019-02 security release. by Android Partner Docs <noreply@android.com> - 232364769 Remove old versions of repo launcher by Jonathan Nieder <jrn@google.com> - 232360606 Add info about repo launcher 1.25 by Jonathan Nieder <jrn@google.com> - 232334781 Removed AOSP links by Luke Haviland <lhaviland@google.com> - 232329134 Devsite localized content from translation request 1097594. by Android Partner Docs <noreply@android.com> - 232329111 Devsite localized content from translation request 1097595. by Android Partner Docs <noreply@android.com> - 232329061 Devsite localized content from translation request 1097089. by Android Partner Docs <noreply@android.com> - 232328913 Devsite localized content from translation request 1097093. by Android Partner Docs <noreply@android.com> - 232328908 Devsite localized content from translation request 1098166. by Android Partner Docs <noreply@android.com> - 232328889 Devsite localized content from translation request 1095252. by Android Partner Docs <noreply@android.com> - 232317488 Adding February's Android/Pixel bulletins by Luke Haviland <lhaviland@google.com> - 231997896 Add Simpleperf to home page News section by Android Partner Docs <noreply@android.com> - 231995041 Add link to Simpleperf, link Perf overview to Perf Debug ... by Android Partner Docs <noreply@android.com> - 231988613 Removed angle bracket around variables, general cleanup. by Android Partner Docs <noreply@android.com> PiperOrigin-RevId: 237368408 Change-Id: Ib5fcee4b379b6886e6e03853c9bf30c1dcb1b7ee
Diffstat (limited to 'en/devices')
-rw-r--r--en/devices/architecture/hal-types.html14
-rw-r--r--en/devices/architecture/hidl-cpp/interfaces.html2
-rw-r--r--en/devices/architecture/hidl/interfaces.html10
-rw-r--r--en/devices/architecture/kernel/bpf.md302
-rw-r--r--en/devices/architecture/kernel/reqs-interfaces.html2
-rw-r--r--en/devices/architecture/vintf/objects.html2
-rw-r--r--en/devices/audio/implement-policy.html14
-rw-r--r--en/devices/automotive/camera-hal.html2
-rw-r--r--en/devices/automotive/power.html194
-rw-r--r--en/devices/automotive/properties.html2
-rw-r--r--en/devices/graphics/implement-vulkan.html5
-rw-r--r--en/devices/tech/connect/esim-overview.md2
-rw-r--r--en/devices/tech/connect/ims.md7
-rw-r--r--en/devices/tech/debug/eval_perf.html7
-rw-r--r--en/devices/tech/debug/native-crash.html45
-rw-r--r--en/devices/tech/health/index.md6
-rw-r--r--en/devices/tech/test_infra/tradefed/full_example.html4
17 files changed, 486 insertions, 134 deletions
diff --git a/en/devices/architecture/hal-types.html b/en/devices/architecture/hal-types.html
index 3df8d61c..00ca2eb3 100644
--- a/en/devices/architecture/hal-types.html
+++ b/en/devices/architecture/hal-types.html
@@ -21,18 +21,19 @@
limitations under the License.
-->
-<p>As part of the Android 8.0 rearchitecture of the lower layers of the Android OS
-to support better modularity, devices running Android 8.0 must support binderized
-or passthrough HALs:</p>
+<p>In Android 8.0 and higher, the lower-level layers are re-written to adopt
+a new, more modular architecture. Devices running Android 8.0 and higher must
+support HALs written in the HIDL language, with a few exceptions listed below.
+These HALs can be binderized or passthrough:</p>
<ul>
-<li><strong>Binderized HALs</strong>. HALs expressed in HAL interface definition
+<li><strong>Binderized HALs.</strong> HALs expressed in HAL interface definition
language (HIDL). These HALs replace both conventional and legacy HALs used in earlier versions of
Android. In a Binderized HAL, the Android framework and HALs communicate with each other using
binder inter-process communication (IPC) calls. All devices launching with Android 8.0 or later must
support binderized HALs only.</li>
-<li><strong>Passthrough HALs</strong>. A HIDL-wrapped conventional or legacy
+<li><strong>Passthrough HALs.</strong> A HIDL-wrapped conventional or legacy
HAL. These HALs wrap existing HALs and can serve the HAL in binderized and
same-process (passthrough) modes. Devices upgrading to Android 8.0 can use
passthrough HALs.</li>
@@ -67,7 +68,8 @@ binderized.</td>
<tr>
<td colspan=2>All other HALs provided by the vendor image can be in passthrough
-OR binderized mode.</td>
+OR binderized mode. In a fully Treble-compliant device, all of these must be
+binderized.</td>
</tr>
</tbody>
diff --git a/en/devices/architecture/hidl-cpp/interfaces.html b/en/devices/architecture/hidl-cpp/interfaces.html
index 285c22b5..c236a171 100644
--- a/en/devices/architecture/hidl-cpp/interfaces.html
+++ b/en/devices/architecture/hidl-cpp/interfaces.html
@@ -248,7 +248,7 @@ from a thread in the RPC threadpool when the process hosting the interface dies:
</p>
<pre class="prettyprint">
-class MyDeathRecipient : android::hardware::hidl_death_recipient {
+class MyDeathRecipient : public android::hardware::hidl_death_recipient {
virtual void serviceDied(uint64_t cookie, const android::wp&lt;::android::hidl::base::V1_0::IBase&gt;&amp; who) {
// Deal with the fact that the service died
}
diff --git a/en/devices/architecture/hidl/interfaces.html b/en/devices/architecture/hidl/interfaces.html
index 6fc1cb1b..483b521a 100644
--- a/en/devices/architecture/hidl/interfaces.html
+++ b/en/devices/architecture/hidl/interfaces.html
@@ -215,11 +215,11 @@ previous version. New data structures and methods can be added, but no existing
data structures or method signatures may be changed.</li>
</ul>
-<p>For broader compatibility with frameworks, multiple major versions of a HAL
-can be present on a device simultaneously. While multiple minor versions can
-also be present on a device, as minor versions are backwards compatible no
-reason exists to support more than the latest minor version for each major
-version. For more details on versioning and vendor extensions, see
+<p>Multiple major or minor versions of a HAL can be present on a device
+simultaneously. However, a minor version should be preferred over a major
+version because client code that works with a previous minor version interface
+will also work with later minor versions of that same interface. For more
+details on versioning and vendor extensions, see
<a href="/devices/architecture/hidl/versioning">HIDL Versioning</a>.</p>
<h2 id="interface-layout-summary">Interface layout summary</h2>
diff --git a/en/devices/architecture/kernel/bpf.md b/en/devices/architecture/kernel/bpf.md
new file mode 100644
index 00000000..1e08703f
--- /dev/null
+++ b/en/devices/architecture/kernel/bpf.md
@@ -0,0 +1,302 @@
+Project: /_project.yaml
+Book: /_book.yaml
+
+{% include "_versions.html" %}
+
+<!--
+ Copyright 2019 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.
+-->
+
+# Extending the kernel with eBPF
+
+Android includes an eBPF loader and library that loads eBPF
+programs at boot time to extend kernel functionality. This can be used for
+collecting statistics from the kernel, monitoring, or debugging.
+
+## About eBPF
+
+Extended Berkeley Packet Filter (eBPF) is an in-kernel virtual machine that
+runs user-supplied eBPF programs that can be hooked to probes or events in
+the kernel, collect useful statistics, and store the results in rich
+data structures. A program is loaded into the kernel using the `bpf(2)` syscall
+and is provided by the user as a binary blob of eBPF machine instructions.
+The Android build system has support for compiling C programs to eBPF using
+simple build file syntax described later.
+
+More information about eBPF internals and architecture can be found at [Brendan
+Gregg's eBPF page](http://www.brendangregg.com/ebpf.html){: .external}.
+
+## Android BPF loader
+
+During Android boot, all eBPF programs located at `/system/etc/bpf/` are
+loaded. These programs are binary objects built by the Android build system
+from C programs accompanied with Android.bp files in the Android source tree.
+The build system stores the generated objects at `/system/etc/bpf`, and
+they become part of the system image.
+
+### Format of an Android eBPF C program
+
+An eBPF C program loaded on an Android device must have the following format:
+
+<pre class="prettyprint">
+#include &lt;bpf_helpers.h&gt;
+
+&lt;... define one or more maps in the maps section, ex:
+/* Define a map of type array, with 10 entries */
+struct bpf_map_def SEC("maps") MY_MAPNAME = {
+ .type = BPF_MAP_TYPE_ARRAY,
+ .key_size = sizeof(int),
+ .value_size = sizeof(uint32_t),
+ .max_entries = 10,
+};
+... &gt;
+
+SEC("PROGTYPE/PROGNAME")
+int PROGFUNC(..args..) {
+ &lt;body-of-code
+ ... read or write to MY_MAPNAME
+ ... do other things
+ &gt;
+}
+
+char _license[] SEC("license") = "GPL"; // or other license
+</pre>
+
+Here, `MY_MAPNAME` is the name of your map variable. It's of type `struct
+bpf_map_def` and tells the BPF loader what kind of map to create with what
+parameters. This struct definition is provided by the `bpf_helpers.h` header
+that the C program includes. The above code results in a creation of an array
+map of 10 entries.
+
+Next, the program defines a function `PROGFUNC`. When compiled, this function is
+placed in a section. The section must have a name of the format
+`PROGTYPE/PROGNAME`. `PROGTYPE` can be any one of the following. More types can
+be found in the [Loader
+source code](https://android.googlesource.com/platform/system/bpf/+/4845288a6e42e13b1bb8063923b24371c9e93397/libbpf_android/Loader.cpp){:
+.external}.
+
+<table class="responsive">
+<tbody>
+<tr>
+<th>kprobe</th>
+<td>Hooks <code>PROGFUNC</code> onto at a kernel instruction using the
+kprobe infrastructure. <code>PROGNAME</code> must be the name of the kernel
+function being kprobed. Refer to the <a
+href="https://www.kernel.org/doc/Documentation/kprobes.txt"
+class="external">kprobe kernel documentation</a> for more information about
+kprobes.
+</td>
+</tr>
+
+<tr>
+<th>tracepoint</th>
+<td>Hooks <code>PROGFUNC</code> onto a tracepoint. <code>PROGNAME</code> must be of
+ the format <code>SUBSYSTEM/EVENT</code>. For example, a tracepoint section for attaching
+functions to scheduler context switch events would be
+ <code>SEC("tracepoint/sched/sched_switch")</code>, where <code>sched</code> is
+ the name of the trace subsystem, and <code>sched_switch</code> is the name
+ of the trace event. Check the <a
+href="https://www.kernel.org/doc/Documentation/trace/events.txt" class="external">trace events kernel
+documentation</a> for more information about tracepoints.
+</td>
+</tr>
+
+<tr>
+<th>skfilter</th>
+<td>Program will function as a networking socket filter.</td>
+</tr>
+
+<tr>
+<th>schedcls</th>
+<td>Program functions as a networking traffic classifier.</td>
+</tr>
+
+<tr>
+<th>cgroupskb, cgroupsock</th>
+<td>Program runs whenever processes in a CGroup create an AF_INET or AF_INET6 socket.
+</td>
+</tr>
+
+</tbody>
+</table>
+
+As an example of a complete C program, the following program creates a map and
+defines a function `tp_sched_switch`, which can be attached to the
+`sched:sched_switch trace` event ([see this
+section](/devices/architecture/kernel/bpf#attaching_programs_to_tracepoints_and_kprobes)
+for how to attach).
+The program adds information about the latest task PID that ran on a particular CPU.
+Name this `myschedtp.c`. We'll refer to this file later in this document.
+
+<pre class="prettyprint">
+#include &lt;linux/bpf.h&gt;
+#include &lt;stdbool.h&gt;
+#include &lt;stdint.h&gt;
+#include &lt;bpf_helpers.h&gt;
+
+struct bpf_map_def SEC("maps") cpu_pid = {
+ .type = BPF_MAP_TYPE_ARRAY,
+ .key_size = sizeof(int),
+ .value_size = sizeof(uint32_t),
+ /* Assume max of 1024 CPUs */
+ .max_entries = 1024,
+};
+
+struct switch_args {
+ unsigned long long ignore;
+ char prev_comm[16];
+ int prev_pid;
+ int prev_prio;
+ long long prev_state;
+ char next_comm[16];
+ int next_pid;
+ int next_prio;
+};
+
+SEC("tracepoint/sched/sched_switch")
+int tp_sched_switch(struct switch_args* args) {
+ int key;
+ uint32_t val;
+
+ key = bpf_get_smp_processor_id();
+ val = args-&gt;next_pid;
+
+ bpf_map_update_elem(&cpu_pid, &key, &val, BPF_ANY);
+ return 0;
+}
+
+char _license[] SEC("license") = "GPL";
+</pre>
+
+The license section is used by the kernel to verify if the program is compatible with the
+kernel's license when the program makes use of BPF helper functions provided by the kernel. Set `_license` to your
+project's license.
+
+### Format of the Android.bp file
+In order for the Android build system to build an eBPF .c program, an entry has
+to be made in the Android.bp file of the project.
+
+For example, to build an eBPF C program of name `bpf_test.c`, make the following
+entry in your project's Android.bp file:
+<pre class="prettyprint">
+bpf {
+ name: "bpf_test.o",
+ srcs: ["bpf_test.c"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+}
+</pre>
+
+This compiles the C program resulting in the object
+`/system/etc/bpf/bpf_test.o`. On boot, the Android system automatically loads
+the `bpf_test.o` program into the kernel.
+
+### Files available in sysfs
+During boot up, the Android system automatically loads all the eBPF objects from `/system/etc/bpf/`,
+creates the maps that the program needs, and pins the loaded program with its maps to the bpf file system.
+These files can then be used for further interaction with the eBPF program or reading maps. This section
+describes the conventions used for naming these files and their locations in sysfs.
+
+The following files are created and pinned:
+
+* For any programs loaded, assuming `PROGNAME` is the name of the program and `FILENAME` is the name of the eBPF C file, the Android loader creates and pins each program at `/sys/fs/bpf/prog_FILENAME_PROGTYPE_PROGNAME`.
+
+ For example, for the above `sched_switch` tracepoint example in `myschedtp.c`, a program file will be created and pinned to
+`/sys/fs/bpf/prog_myschedtp_tracepoint_sched_sched_switch`.
+
+* For any maps created, assuming `MAPNAME` is the name of the map and `PROGNAME` is the name of the eBPF C file, the Android loader creates and pins each map to `/sys/fs/bpf/map_FILENAME_MAPNAME`.
+
+ For example, for the above `sched_switch` tracepoint example in `myschedtp.c`, a map file is created and pinned to
+`/sys/fs/bpf/map_myschedtp_cpu_pid`.
+
+* The `bpf_obj_get()` in the Android BPF library can be used to obtained a file descriptor from these pinned /sys/fs/bpf file. This function returns a file descriptor, which can be used for further operations, such as reading maps or attaching a program to a tracepoint.
+
+## Android BPF library
+The Android BPF library is named `libbpf_android.so` and is part of the system
+image. This library provides the user with low-level eBPF functionality needed
+for creating and reading maps, creating probes, tracepoints, perf buffers etc.
+
+### Attaching programs to tracepoints and kprobes
+Once tracepoint and kprobe programs have been loaded (which is done automatically
+at boot up as previously described), they need to be activated. To activate them,
+first, use the `bpf_obj_get()` API to obtain the program fd from the pinned file's
+location (see the [Files available in sysfs](/devices/architecture/kernel/bpf#files_available_in_sysfs)
+section). Next, call the `bpf_attach_tracepoint()`
+API in the BPF library, passing it the program fd and the tracepoint name.
+
+For example, to attach the `sched_switch` tracepoint defined in the `myschedtp.c`
+source file in the example above, do the following (error checking is not shown):
+
+<pre class="prettyprint">
+ char *tp_prog_path = "/sys/fs/bpf/prog_myschedtp_tracepoint_sched_sched_switch";
+ char *tp_map_path = "/sys/fs/bpf/map_myschedtp_cpu_pid";
+
+ // Attach tracepoint and wait for 4 seconds
+ int mProgFd = bpf_obj_get(tp_prog_path);
+ int mMapFd = bpf_obj_get(tp_map_path);
+ int ret = bpf_attach_tracepoint(mProgFd, "sched", "sched_switch");
+ sleep(4);
+
+ // Read the map to find the last PID that ran on CPU 0
+ android::bpf::BpfMap<int, int> myMap(mMapFd);
+ printf("last PID running on CPU %d is %d\n", 0, myMap.readValue(0));
+</pre>
+
+### Reading from the maps
+
+BPF maps support arbitrary complex key and value structures or types. The
+Android BPF library includes an `android::BpfMap` class that makes use of C++
+templates to instantiate `BpfMap` based on the key and value's type for the
+map in question. The above code shows an example of using a `BpfMap` with key and
+value as integers. The integers can also be arbitrary structures.
+
+Thus the templatized `BpfMap` class makes it easy to define a custom `BpfMap`
+object suitable for the particular map. The map can then be accessed using the
+custom-generated functions which are type aware, resulting in cleaner code.
+
+For more information about `BpfMap`, refer to the
+[Android sources].(https://android.googlesource.com/platform/system/bpf/+/75b410bdf186263fa4e05e079bfba44578622c33/libbpf/include/bpf/BpfMap.h){: .external}
+
+## Debugging issues
+
+During boot time, several messages related to BPF loading are logged. If the
+loading process fails for any reason, a detailed log message is provided
+in logcat. Filtering the logcat logs by "bpf" prints all the messages and
+any detailed errors during load time, such as eBPF verifier errors.
+
+## Users of eBPF in Android
+
+Currently there are two eBPF C programs in Android that you can refer to for examples.
+
+The `netd` [eBPF C
+program](https://android.googlesource.com/platform/system/bpf/+/4845288a6e42e13b1bb8063923b24371c9e93397/progs/netd.c){: .external}
+is used by the networking daemon (netd) in Android for various purposes such as
+socket filtering and statistics gathering. To see how this programs is used, check the [eBPF traffic
+monitor](https://www.google.com/url?sa=D&q=https%3A%2F%2Fsource.android.com%2Fdevices%2Ftech%2Fdatausage%2Febpf-traffic-monitor){: .external}
+sources.
+
+The `time_in_state` [eBPF C
+program](https://android.googlesource.com/platform/system/bpfprogs/+/482dfa1ca63eb209866ff3a7b3aeb3daada7b4e1/time_in_state.c){: .external}
+calculates the amount of time an Android app spends at different
+CPU frequencies which is used to calculate power. This program is currently under development.
+
+## Licensing considerations
+
+If you want to contribute an eBPF C program, it should be contributed to the right
+project depending on its license. A GPL licensed eBPF C program should be
+contributed to the `system/bpfprogs` AOSP project. On the other hand, if the program
+is Apache licensed, it should be contributed to `system/bpf` AOSP project.
diff --git a/en/devices/architecture/kernel/reqs-interfaces.html b/en/devices/architecture/kernel/reqs-interfaces.html
index 53fbf656..ea6c687e 100644
--- a/en/devices/architecture/kernel/reqs-interfaces.html
+++ b/en/devices/architecture/kernel/reqs-interfaces.html
@@ -23,7 +23,7 @@
-->
<p>This page describes a subset of the Linux kernel interfaces on which Android
-relies to function properly. The presence and correctness of these interfaces is
+relies to function properly. The presence and correctness of these interfaces are
tested as part of the <a href="/devices/tech/vts/index.html">Vendor Test Suite
(VTS)</a>. This subset will grow over time to contain a larger portion of
Android kernel interfaces.</p>
diff --git a/en/devices/architecture/vintf/objects.html b/en/devices/architecture/vintf/objects.html
index 3bfeff64..18cd57c0 100644
--- a/en/devices/architecture/vintf/objects.html
+++ b/en/devices/architecture/vintf/objects.html
@@ -64,7 +64,7 @@ DM from fragments</a>.
<li>optional ODM manifest fragments</li>
</ol>
<li>If ODM manifest exists, combine ODM manifest with optional ODM manifest fragments.</li>
- <li><code>/vendor/manfiest.xml</code> (legacy, no fragments)</li>
+ <li><code>/vendor/manifest.xml</code> (legacy, no fragments)</li>
</ol>
Note that:
<ul>
diff --git a/en/devices/audio/implement-policy.html b/en/devices/audio/implement-policy.html
index a6ccf0e9..4c6cc097 100644
--- a/en/devices/audio/implement-policy.html
+++ b/en/devices/audio/implement-policy.html
@@ -39,7 +39,7 @@ for defining audio topology using an XML file format that is more
human-readable, has a wide range of editing and parsing tools, and is flexible
enough to describe complex audio topologies.</p>
-<p class="note".<strong>Note:</strong> Android 7.0 preserves support for using
+<p class="note"><strong>Note:</strong> Android 7.0 preserves support for using
<code>audio_policy.conf</code>; this legacy format is used by default. To use
the XML file format, include the build option <code>USE_XML_AUDIO_POLICY_CONF
:= 1</code> in device makefile.</p>
@@ -349,10 +349,7 @@ a given parameter must take a given value.</li>
<p>AOSP includes an example of an audio policy configuration file that uses the parameter-framework at: <code>Frameworks/av/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/PolicyConfigurableDomains.xml</code>. For
details, refer to Intel documentation on the
-<a href="https://github.com/01org/parameter-framework">parameter-framework</a>
-and
-<a href="http://01org.github.io/parameter-framework/hosting/Android_M_Configurable_Audio_Policy.pdf">Android
-Configurable Audio Policy</a>.</p>
+<a href="https://github.com/01org/parameter-framework" class="external">parameter-framework</a>.</p>
<h2 id=policy_routing_apis>Audio policy routing APIs</h2>
<p>Android 6.0 introduced a public Enumeration and Selection API that sits on
@@ -367,10 +364,13 @@ the explicit routing methods that were specific to <code>AudioTrack</code> and
<code>AudioRecord</code> classes.</p>
<p>For details on the Enumeration and Selection API, refer to
-<a href="https://developer.android.com/ndk/guides/audio/opensl-for-android.html?hl=fi#configuration-interface">Android
+<a
+href="https://developer.android.com/ndk/guides/audio/opensl-for-android.html?hl=fi#configuration-interface"
+class="external">Android
configuration interfaces</a> and <code>OpenSLES_AndroidConfiguration.h</code>.
For details on audio routing, refer to
-<a href="https://developer.android.com/reference/android/media/AudioRouting.html">AudioRouting</a>.
+<a href="https://developer.android.com/reference/android/media/AudioRouting.html"
+class="external">AudioRouting</a>.
</p>
<h2 id=multichannel>Multi-channel support</h2>
diff --git a/en/devices/automotive/camera-hal.html b/en/devices/automotive/camera-hal.html
index 91e2ca28..173e137a 100644
--- a/en/devices/automotive/camera-hal.html
+++ b/en/devices/automotive/camera-hal.html
@@ -45,7 +45,7 @@ overview.</figcaption>
<h3 id="evs-application">EVS application</h3>
<p>A sample C++ EVS application
-(<code>/packages/services/Car/evs/sample_app</code>) serves as a reference
+(<code>/packages/services/Car/evs/app</code>) serves as a reference
implementation. This application is responsible for requesting video frames from
the EVS Manager and sending finished frames for display back to the EVS Manager.
It expects to be started by init as soon as EVS and Car Service are available,
diff --git a/en/devices/automotive/power.html b/en/devices/automotive/power.html
index 084a39bb..d6707341 100644
--- a/en/devices/automotive/power.html
+++ b/en/devices/automotive/power.html
@@ -21,16 +21,17 @@
limitations under the License.
-->
-<p>Android 9 introduces a new state – <em>deep sleep</em> – into the power
-management state machine. To implement this state, Android 9 provides a new power management service
-and interface: <code>CarPowerManagementService</code> and <code>CarPowerManager</code>.</p>
+<p>Android introduces a new state into the power management state machine, called
+<em>deep sleep</em>. To implement deep sleep, Android provides a
+<code>CarPowerManagementService</code> service and a <code>CarPowerManager</code> interface.</p>
-<p>State transitions are triggered by the Vehicle MCU (VMCU). To communicate with the VMCU,
-integrators must implement several components. Integrators are responsible for integrating
-with the VHAL and the kernel implementation. Integrators are also responsible for disabling wake
-sources and ensuring that shutdowns are not postponed indefinitely.</p>
+<p>State transitions are triggered by the Vehicle Master Control Unit (VMCU). To communicate with
+the VMCU, Integrators must implement several components. Integrators are responsible for integrating
+with the Vehicle Hardware Abstraction Layer (VHAL) and the kernel implementation. Integrators are
+also responsible for disabling wake sources and ensuring that shutdowns are not postponed
+indefinitely.</p>
-<h2 id=terms>Terminology</h2>
+<h2 id="terms">Terminology</h2>
<p>These terms are used throughout this document:</p>
@@ -44,54 +45,52 @@ sources and ensuring that shutdowns are not postponed indefinitely.</p>
<tbody>
<tr>
<td>Application Processor (AP)</td>
-<td>Part of the System on Chip (SoC).</td>
+<td>Part of the System on a Chip (SoC).</td>
</tr>
<tr>
<td>Board Support Processor (BSP)</td>
-<td>All of the chip and hardware specific code
-necessary for the product to work. Typically provided by the SoC vendor and hardware
-manufacturer. This covers items such as device drivers, the PMIC sequencing code, and SoC
-bringup.</td>
+<td>All of the chip and hardware specific code necessary for the product to work. Typically provided
+by the SoC vendor and hardware manufacturer. This covers items such as device drivers, the PMIC sequencing code, and SoC bringup.</td>
</tr>
<tr>
<td>CarPowerManager (CPM)</td>
<td>Exposes an API for applications to register for power state changes.</td>
</tr>
<tr>
-<td>CarPowerManagementService (CPMS)</td>
+<td>CarPowerManagementService&nbsp;(CPMS)</td>
<td>Implements the car power state machine, interfaces with VHAL, and performs the final calls to <code>suspend()</code> and <code>shutdown()</code>.</td>
</tr>
<tr>
-<td>CarServiceHelperService</strong> (<strong>CSHS</strong>)</td>
+<td>CarServiceHelperService (CSHS)</td>
<td>Provides a hook into SystemServer for OK, provided that is the Car Service.</td>
</tr>
<tr>
-<td>General Purpose Input / Output (GPIO)</td>
+<td>General Purpose Input/Output (GPIO)</td>
<td>A digital signal pin for general purpose use.</td>
</tr>
<tr>
<td>Hibernate</td>
-<td>AKA <em>Suspend to Disk</em> (S2D/S4). The SoC is placed into S4 power mode (hibernate) and RAM
-content is written to non-volatile media (such as flash or disk) and the entire system is powered
-off. Android does <strong><em>not</em></strong> currently implement hibernate.</td>
+<td>Also referred to as <em>Suspend to Disk</em> (S2D/S4). The SoC is placed into S4 power mode
+(hibernate) and RAM content is written to non-volatile media (such as flash or disk) and the entire
+system is powered off. Android does <em>not</em> currently implement hibernate.</td>
</tr>
<tr>
<td>Media Processor (MP)</td>
-<td>See System on Chip (SoC).</td>
+<td>See System on a Chip (SoC).</td>
</tr>
<tr>
-<td>Power Management Integrated Circuit (PMIC)</td>
+<td>Power&nbsp;Management&nbsp;Integrated&nbsp;Circuit&nbsp;(PMIC)</td>
<td>Chip used to manage power requirements for the host system.</td>
</tr>
<tr>
<td>System on a Chip (SoC)</td>
-<td>Main processor that runs Android, typically supplied by manufacturers such as Intel, Mediatek,
+<td>Main processor that runs Android, typically supplied by manufacturers such as Intel, MediaTek,
Nvidia, Qualcomm, Renesas, and Texas Instruments.</td>
</tr>
<tr>
<td>Suspend</td>
-<td>AKA <em>Suspend to RAM</em> (S2R or STR). The SoC is placed into S3 power mode and the CPU is
-powered off while RAM remains powered on.</td>
+<td>Also referred to as <em>Suspend to RAM</em> (S2R or STR). The SoC is placed into S3 power mode
+and the CPU is powered off while RAM remains powered on.</td>
</tr>
<tr>
<td>Vehicle HAL (VHAL)</td>
@@ -105,48 +104,48 @@ the vehicle.</td>
<td>See Vehicle MCU.</td>
</tr>
<tr>
-<td>Vehicle MCU (VMCU)</td>
+<td>Vehicle Master Control Unit (VMCU)</td>
<td>The microcontroller that provides the interface between the vehicle network and the SoC. The SoC
communicates with the VMCU via USB, UART, SPI, and GPIO signals. </td>
</tr>
</tbody>
</table>
-<h2 id=design>System design</h2>
+<h2 id="design">System design</h2>
-<p>This section describes how Android 9 represents the application processor's power state and which
+<p>This section describes how Android represents the application processor's power state and which
modules implement the power management system. This material also describes how these modules work
together and how state transitions typically occur.</p>
-<h3 id=state>Car power state machine</h3>
+<h3 id="state">Car power state machine</h3>
-<p>Android 9 uses a <em>state machine</em> to represent the power state of the AP. This state machine
-provides these five states, as illustrated below:
+<p>Android uses a <em>state machine</em> to represent the power state of the AP. The state
+machine provides the states illustrated below:
-<p><img src="/devices/automotive/images/automotive_power_states.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_states.png" alt="Car power state machine"></p>
-<p><b>Figure 1</b>. Car power state machine</p>
+<p><b>Figure 1.</b> Car power state machine</p>
<p>The initial state of this state machine is OFF. This state can transition into two states,
-ON:DISP OFF and ON: FULL. Both states indicate the AP is on. The difference lies in the
+ON: DISP OFF and ON: FULL. Both states indicate that the AP is on. The difference lies in the
display's power state. ON: DISP OFF means that the AP is running and displays are turned off.
-When display turns on, the ON: DISP OFF state transitions into ON:FULL (and vice versa).</p>
+When the display turns on, the ON: DISP OFF state transitions into ON: FULL (and vice versa).</p>
<p>The AP is turned off in two cases. In both cases, the state machine first changes state to
SHUTDOWN PREPARE and then transitions to OFF or DEEP SLEEP:</p>
<ul>
-<li>Power off.</li>
-<li>Suspended to RAM.</li>
+<li>Power off</li>
+<li>Suspended to RAM</li>
</ul>
-<p>When this power management state machine enters the DEEP SLEEP state, the AP runs Suspend to
+<p>When the power management state machine enters the DEEP SLEEP state, the AP runs Suspend to
RAM. For example, the AP suspends its state (such as register stored value) in RAM. When the AP
wakes up, all states are restored.</p>
-<h3 id=module>Power management modules</h3>
+<h3 id="module">Power management modules</h3>
-<p>These five modules comprise the power management system:</p>
+<p>The power management system is comprised of these modules:</p>
<table>
<thead>
@@ -158,34 +157,35 @@ wakes up, all states are restored.</p>
<tbody>
<tr>
<td>CarPowerManager</td>
-<td>Java/C++ API</td>
+<td>Java/C++ API.</td>
</tr>
<tr>
<td>CarPowerManagementService</td>
-<td>Responsible for coordinating the sleep/suspend power state</td>
+<td>Coordinates the Sleep/Suspend power state.</td>
</tr>
<tr>
<td>Vehicle HAL</td>
-<td>Interface to VMCU</td>
+<td>Interface to the VMCU.</td>
</tr>
<tr>
-<td>libsuspend</td>
-<td>Native library to place the device into suspend</td>
+ <td>libsuspend</td>
+<td>Native library to place the device into suspend.</td>
</tr>
<tr>
<td>Kernel</td>
-<td>Suspend to RAM implementation</td>
+<td>Suspend to RAM implementation.</td>
</tr>
</tbody>
</table>
<p>The deep sleep feature (suspending Android to RAM) is implemented in the kernel. This feature is
-exposed to the user space as a special file located at <code>/sys/power/state</code>. AAE is
-suspended by writing <code>mem</code> to this file. </p>
+exposed to the user space as a special file located at <code>/sys/power/state</code>. Android
+Auto is suspended by writing <code>mem</code> to this file.</p>
<p><code>libsuspend</code> is a native library that implements <code>forcesuspend()</code>. This
-function uses <code>/sys/power/state</code> to suspend AAE. <code>forcesuspend()</code> can be
-called from system services, including CPMS.</p>
+function uses <code>/sys/power/state</code> to suspend Android Auto.
+<code>forcesuspend()</code> can be called from system services, including CPMS.</p>
+
<p>The CPMS coordinates the power state with other services and HALs. The CPMS implements the state
machine described above and sends notifications to every observer when a power state transition
@@ -195,23 +195,19 @@ hardware. </p>
<p>Some properties are defined in the VHAL. To communicate with the VMCU, the CPMS reads and writes
these properties. Applications can use the interface defined in the CPM to monitor power state
changes. This interface also enables applications to acquire the boot reason and to send shutdown
-requests. This API can be called from Java and C++ and are annotated with @hide / @System API, which
+requests. This API can be called from Java and C++ and is annotated with @hide / @System API, which
means it is available to privileged applications <em>only</em>. The relationship between these five
modules, applications, and services is illustrated below:</p>
-<p><img src="/devices/automotive/images/automotive_power_reference_diagram.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_reference_diagram.png" alt="Power components reference diagram"></p>
-<p><b>Figure 2</b>. Power components reference diagram</p>
+<p><b>Figure 2.</b> Power components reference diagram</p>
-<h3 id=msg>Typical message sequence</h3>
+<h3 id="message">Message sequence</h3>
<p>The previous section described the modules that comprise the power management system. This
-section uses the following two examples to explain how the modules and applications communicate:</p>
-
-<ul>
-<li>Enter deep sleep.</li>
-<li>Exit deep sleep.</li>
-</ul>
+section uses the <em>enter deep sleep</em> and <em>exit deep sleep</em> examples to explain how the
+modules and applications communicate:</p>
<h4>Enter deep sleep</h4>
@@ -221,10 +217,10 @@ broadcasts this state transition to all observers (the applications and services
CPMS) by calling the <code>onStateChanged()</code> method with a new state ID provided by the
CPM.</p>
-The CPM mediates between the applications/services and the CPMS. The <code>onStateChanged()</code>
-method for the applications/services is synchronously invoked in the CPM's
-<code>onStateChanged()</code> method. After which, the finished method of the CPMS is invoked to
-notify the CPMS that the target application or service is ready to suspend. The CPM's
+<p>The CPM mediates between the applications/services and the CPMS. The
+<code>onStateChanged()</code> method for the applications/services is synchronously invoked in the
+CPM's <code>onStateChanged()</code> method. After which, the finished method of the CPMS is invoked
+to notify the CPMS that the target application or service is ready to suspend. The CPM's
<code>onStateChanged()</code> method runs asynchronously. Therefore, some delay occurs between the
calling of the <code>onStateChanged()</code> method to all CPM objects and the receiving of the
finished message from all these objects. During this time, the CPMS continues to send shutdown
@@ -235,11 +231,11 @@ postpone requests to the VHAL.</p>
suspend. The CPMS also calls its suspend method, which suspends the kernel with a feature provided
by <code>libsuspend</code>.</p>
-<p>The entire sequence described above is illustrated in the following sequence diagram:
+<p>The sequence described above is illustrated below:
-<p><img src="/devices/automotive/images/automotive_power_deep_sleep.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_deep_sleep.png" alt="Enter deep sleep"></p>
-<p><b>Figure 3</b>. Enter deep sleep sequence diagram</p>
+<p><b>Figure 3.</b> Enter deep sleep</p>
<h4>Exit deep sleep</h4>
@@ -258,11 +254,11 @@ provided by the CPM. This method returns these values, as notified from the VMCU
<li>BOOT_REASON_REMOTE_START</li>
</ul>
-<p><img src="/devices/automotive/images/automotive_power_deep_sleep_exit.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_deep_sleep_exit.png" alt="Exit deep sleep"></p>
-<p><b>Figure 4</b>. Exit deep sleep sequence diagram</p>
+<p><b>Figure 4.</b> Exit deep sleep</p>
-<h2 id=cpm>Programming interfaces provided by CPM</h2>
+<h2 id="cpm">Programming interfaces provided by CPM</h2>
<p>This section describes the Java and C++ API provided by the CPM for system applications and
services. The process to call the CPM in C++ is identical to that used by the Java API. This API
@@ -282,9 +278,9 @@ illustrates how to use these APIs in Java. Use these steps to call the APIs prov
<li>Call the appropriate method on the object created in Step 1.</li>
</ol>
-<h3 id=object>Creating a CarPowerManager object</h3>
+<h3 id="object">Creating a CarPowerManager object</h3>
-<p>To create a CPM object, call the Car object's <code>getCarManager()</code> method. This method is
+ <p>To create a CPM object, call the Car object's <code>getCarManager()</code> method. This method is
a facade used to create CM objects. Specify <code>android.car.Car.POWER_SERVICE</code> as an
argument to create a CPM object.</p>
@@ -297,7 +293,7 @@ CarPowerManager powerManager =
</pre>
</div>
-<h2 id=reg>CarPowerStateListener and registration</h2>
+<h2 id="reg">CarPowerStateListener and registration</h2>
<p>System applications and services can receive power state change notifications by implementing
<code>CarPowerManager.CarPowerStateListener</code>. This interface defines one method
@@ -328,7 +324,7 @@ powerManager.setListener(powerListener, executer);
<p>When the power state is changed, the <code>onStateChanged()</code> method of the listener object
is invoked with a value to represent the new power state. The association between actual value and
-power state is defined in <code>CarPowerManager.CarPowerStateListene</code>r and is shown in the
+power state is defined in <code>CarPowerManager.CarPowerStateListener</code> and is shown in the
following table:</p>
<table>
@@ -358,7 +354,7 @@ following table:</p>
</tbody>
</table>
-<h3 id=dereg>CarPowerStateListener unregistration</h3>
+<h3 id="dereg">CarPowerStateListener unregistration</h3>
<p>To unregister all listener objects registered to CPM, call the <code>clearListener</code> method:</p>
@@ -367,7 +363,7 @@ powerManager.clearListener();
</pre>
</div>
-<h3 id=boot>Boot reason acquisition</h3>
+<h3 id="boot">Boot reason acquisition</h3>
<p>To acquire the boot reason, call the <code>getBootReason</code> method, which communicates with
the CPMS and returns one of the following five boot reasons:</p>
@@ -424,12 +420,12 @@ try{
<p>This method throws a <code>CarNotConnectedException</code> when it fails to communicate with the
CPMS.</p>
-<h3 id=shutdown>Shutdown request on next suspend</h3>
+<h3 id="shutdown">Shutdown request on next suspend</h3>
<p>The <code>requestShutdownOnNextSuspend()</code>method instructs CPMS to shut down instead of deep
sleep at the next opportunity.</p>
-<h2 id=integration>System integration on your Android implementation</h2>
+<h2 id="integration">System integration on your Android implementation</h2>
<p>Integrators are responsible for implementing the following items:</p>
@@ -446,7 +442,7 @@ sleep at the next opportunity.</p>
process.</li>
</ul>
-<h3 id=kernel>Kernel interface: /sys/power/state</h3>
+<h3 id="kernel">Kernel interface: /sys/power/state</h3>
<p>First, implement the Linux suspend power state. Android places a device into suspend mode when
an application or service writes <code>mem</code> into a file located at
@@ -455,7 +451,7 @@ the VMCU that the device has shut down completely. The Integrator is also respon
any race conditions between VHAL sending the final message to the VMCU and the system going into
suspend or shutdown mode.</p>
-<h3 id=vhal>VHAL responsibility</h3>
+<h3 id="vhal">VHAL responsibility</h3>
<p>The VHAL provides an interface between the vehicle network and Android. The VHAL:</p>
@@ -499,11 +495,11 @@ instruct the VMCU that it is safe to remove power from the device.</p>
<h4>AP_POWER_STATE_REPORT</h4>
-<p>Use this property to report Android's current power management state.This property contains two
+<p>Use this property to report Android's current power management state. This property contains two
integers:</p>
<ul>
-<li><code>int32Values[0]</code>: <code>VehicleApPowerStateReport</code> enum of the current state.</li>
+<li><code>int32Values[0]</code>: VehicleApPowerStateReport enum of the current state.</li>
<li><code>int32Values[1]</code>: Time in milliseconds to postpone or sleep/shutdown. This value
depends on the first value.</li>
</ul>
@@ -562,8 +558,8 @@ value.</td>
<p>The state can be set asynchronously (in the case of <code>BOOT_COMPLETE</code>) or in response to
a request via the VMCU. When the state is set to <code>SHUTDOWN_START</code>,
-<code>DEEP_SLEEP_ENTRY,</code> or <code>SHUTDOWN_POSTPONE</code>, an integer value in
-milliseconds is sent to notify the VMCU for how long the AP must postpone shutdown or sleep.</p>
+<code>DEEP_SLEEP_ENTRY,</code> or <code>SHUTDOWN_POSTPONE</code>, an integer (in milliseconds)
+is sent to notify the VMCU for how long the AP must postpone shutdown or sleep.</p>
<h4>AP_POWER_STATE_REQ</h4>
@@ -574,12 +570,12 @@ two integers:</p>
<li><code>int32Values[0]</code>: <code>VehicleApPowerStateReq</code> enum value, which represents
the new state into which to transition.</li>
<li><code>int32Values[1]</code>: <code>VehicleApPowerStateShutdownParam</code> enum value. This
- value os sent only for a <code>SHUTDOWN_PREPARE</code> message and transmits to Android the
- options it contains.</li>
+value is sent only for a <code>SHUTDOWN_PREPARE</code> message and transmits to Android the
+options it contains.</li>
</ul>
<p>The first integer value represents the new state into which Android is to transit. The semantics
-are defined in <code>types.hal</code> and provided in the following table:</p>
+are defined in <code>types.hal</code> and provided below:</p>
<table>
<thead>
@@ -677,7 +673,7 @@ a specific duration, as specified in <code>VehicleApPowerSetState</code>#SHUTDOW
</tbody>
</table>
-<h3 id=wake>Wake sources</h3>
+<h3 id="wake">Wake sources</h3>
<p>Use Integrator to disable the appropriate wake sources when the device is in suspend mode.
Common wake sources include heartbeats, modem, wifi, and Bluetooth. The only valid wake source must
@@ -687,14 +683,14 @@ then another wake source to service the modem must be added. In the current desi
supplies a file with a list of wake sources to be turned off. The CPMS iterates through this file
and manages the turning off and on of the wake sources at suspend time.</p>
-<h3 id=apps>Applications</h3>
+<h3 id="apps">Applications</h3>
<p>OEMs must be careful to write applications so that they can be shut down quickly and not postpone
the process indefinitely. </p>
-<h2 id=app>Appendix</h2>
+<h2 id="app">Appendix</h2>
-<h3 id=tree>Directories in the source code tree</h3>
+<h3 id="tree">Directories in the source code tree</h3>
<table>
<thead>
@@ -721,33 +717,33 @@ the process indefinitely. </p>
<td><code>hardware/interfaces/automotive/vehicle/2.0</code></td>
</tr>
<tr>
-<td>Sample app to provide some idea about the <code>CarPowerManager</code>.</td>
+<td>Sample app to provide some idea about the <code>CarPowerManager</code></td>
<td><code>packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink</code></td>
</tr>
<tr>
-<td>libsuspend resides in this directory.</td>
+<td><code>libsuspend</code> resides in this directory.</td>
<td><code>system/core/libsuspend</code></td>
</tr>
</tbody>
</table>
-<h3 id=diagram>Class diagram</h3>
+<h3 id="diagram">Class diagram</h3>
<p>This class diagram displays the Java classes and interfaces in the power management system:</p>
-<p><img src="/devices/automotive/images/automotive_power_class_diagram.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_class_diagram.png" alt="Power class diagram"></p>
-<p><b>Figure 5</b>. Power class diagram</p>
+<p><b>Figure 5.</b> Power class diagram</p>
-<h3 id=rel>Object relationship</h3>
+<h3 id="rel">Object relationship</h3>
<p>The following graph illustrates which objects have references to other objects. An edge
means that the source object holds a reference to the target object. For example, VehicleHAL has a
reference to a PropertyHalService object.</p>
-<p><img src="/devices/automotive/images/automotive_power_object_state.png"></p>
+<p><img src="/devices/automotive/images/automotive_power_object_state.png" alt="Object reference diagram"></p>
-<p><b>Figure 6</b>. Object reference diagram</p>
+<p><b>Figure 6.</b> Object reference diagram</p>
- </body>
+</body>
</html>
diff --git a/en/devices/automotive/properties.html b/en/devices/automotive/properties.html
index 4f50b863..327c071f 100644
--- a/en/devices/automotive/properties.html
+++ b/en/devices/automotive/properties.html
@@ -206,7 +206,7 @@ necessarily return the same value as what is set.</p>
<p>Example: set HVAC Temperature</p>
<img src="../images/vehicle_hvac_set.png" alt="Vehicle HAL set HVAC example">
-<p class="img-caption"><strong>Figure 2</strong>. Set HVAC temperature (CD =
+<p class="img-caption"><strong>Figure 2</strong>. Set HVAC temperature (CS =
CarService, VNS = VehicleNetworkService, VHAL = Vehicle HAL)</p>
<h2 id=prop_custom>Handling custom properties</h2>
diff --git a/en/devices/graphics/implement-vulkan.html b/en/devices/graphics/implement-vulkan.html
index c40ec85f..c112067d 100644
--- a/en/devices/graphics/implement-vulkan.html
+++ b/en/devices/graphics/implement-vulkan.html
@@ -81,11 +81,14 @@ for discovering and loading the driver. Preferred paths for 32-bit and 64-bit
Vulkan drivers are:</p>
<pre class="devsite-click-to-copy">
+/vendor/lib/hw/vulkan.&lt;ro.hardware.vulkan&gt;.so
/vendor/lib/hw/vulkan.&lt;ro.product.platform&gt;.so
+/vendor/lib64/hw/vulkan.&lt;ro.hardware.vulkan&gt;.so
/vendor/lib64/hw/vulkan.&lt;ro.product.platform&gt;.so
</pre>
-<p>Where &lt;<code>ro.product.platform</code>&gt; is replaced by the value of
+<p>Where &lt;<code>ro.hardware.vulkan</code>&gt; or
+&lt;<code>ro.product.platform</code>&gt; is replaced by the value of
the system property of that name. For details and supported alternative
locations, refer to <code><a href="https://android.googlesource.com/platform/hardware/libhardware/+/master/hardware.c">libhardware/hardware.c</code></a>.</p>
diff --git a/en/devices/tech/connect/esim-overview.md b/en/devices/tech/connect/esim-overview.md
index 11498351..28d2a03e 100644
--- a/en/devices/tech/connect/esim-overview.md
+++ b/en/devices/tech/connect/esim-overview.md
@@ -292,7 +292,7 @@ RefArDo ::= [PRIVATE 2] SEQUENCE { -- Tag E2
pkgRefDo [PRIVATE 10] OCTET STRING (SIZE(0..127)) OPTIONAL -- Tag CA
},
arDo [PRIVATE 3] SEQUENCE { -- Tag E3
- permArDo [PRIVATE 27] BIT STRING (SIZE(8)) -- Tag DB
+ permArDo [PRIVATE 27] OCTET STRING (SIZE(8)) -- Tag DB
}
}
```
diff --git a/en/devices/tech/connect/ims.md b/en/devices/tech/connect/ims.md
index c4197ad3..bd7b1b7c 100644
--- a/en/devices/tech/connect/ims.md
+++ b/en/devices/tech/connect/ims.md
@@ -285,13 +285,6 @@ implementing ImsServices installed on a system with the following features:
</table>
## Validation
-
-The ImsService APIs include a GTS test suite that verifies the functionality of
-the ImsService API in the framework as well as the IMS application Service
-binding logic. The `GtsImsServiceTestCases` GTS APK can be run as part of the
-GTS test suite to ensure that the API surface functions consistently across all
-Android {{ androidPVersionNumber }} implementations.
-
Tools for verifying the IMS implementation itself are not included since the IMS
specifications are extremely large and use special verification equipment. The
tests can only verify that the telephony framework properly responds to the
diff --git a/en/devices/tech/debug/eval_perf.html b/en/devices/tech/debug/eval_perf.html
index 79c77de9..790addc2 100644
--- a/en/devices/tech/debug/eval_perf.html
+++ b/en/devices/tech/debug/eval_perf.html
@@ -22,6 +22,13 @@
-->
+<p>Use
+ <a href="https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md" class="external">Simpleperf</a>
+ to evaluate the performance of a device. Simpleperf is a native profiling tool for both
+ applications and native processes on Android. Use
+ <a href="https://developer.android.com/studio/profile/cpu-profiler" class="external">CPU Profiler</a>
+ to inspect app CPU usage and thread activity in real time.</p>
+
<p>There are two user-visible indicators of performance:</p>
<ul>
diff --git a/en/devices/tech/debug/native-crash.html b/en/devices/tech/debug/native-crash.html
index 32725ba8..0f9c89c8 100644
--- a/en/devices/tech/debug/native-crash.html
+++ b/en/devices/tech/debug/native-crash.html
@@ -360,6 +360,51 @@ You can reproduce an instance of this type of crash using <code>crasher
seccomp</code>.
</p>
+<h2 id="fdsan">Error detected by fdsan</h2>
+
+<p>
+ Android's fdsan file descriptor sanitizer helps catch common mistakes with file descriptors such
+ as use-after-close and double-close. See the
+ <a
+ href="https://android.googlesource.com/platform/bionic/+/master/docs/fdsan.md" class="external">fdsan
+ documentation</a>
+ for more details about debugging (and avoiding) this class of errors.
+</p>
+
+<pre class="devsite-click-to-copy">
+pid: 32315, tid: 32315, name: crasher64 >>> crasher64 <<<
+signal 35 (<debuggerd signal>), code -1 (SI_QUEUE), fault addr --------
+<em style="color:Orange">Abort message: 'attempted to close file descriptor 3, expected to be unowned, actually owned by FILE* 0x7d8e413018'</em>
+ x0 0000000000000000 x1 0000000000007e3b x2 0000000000000023 x3 0000007fe7300bb0
+ x4 3033313465386437 x5 3033313465386437 x6 3033313465386437 x7 3831303331346538
+ x8 00000000000000f0 x9 0000000000000000 x10 0000000000000059 x11 0000000000000034
+ x12 0000007d8ebc3a49 x13 0000007fe730077a x14 0000007fe730077a x15 0000000000000000
+ x16 0000007d8ec9a7b8 x17 0000007d8ec779f0 x18 0000007d8f29c000 x19 0000000000007e3b
+ x20 0000000000007e3b x21 0000007d8f023020 x22 0000007d8f3b58dc x23 0000000000000001
+ x24 0000007fe73009a0 x25 0000007fe73008e0 x26 0000007fe7300ca0 x27 0000000000000000
+ x28 0000000000000000 x29 0000007fe7300c90
+ sp 0000007fe7300860 lr 0000007d8ec2f22c pc 0000007d8ec2f250
+
+backtrace:
+ #00 pc 0000000000088250 /bionic/lib64/libc.so (fdsan_error(char const*, ...)+384)
+ #01 pc 0000000000088060 /bionic/lib64/libc.so (android_fdsan_close_with_tag+632)
+ #02 pc 00000000000887e8 /bionic/lib64/libc.so (close+16)
+ #03 pc 000000000000379c /system/bin/crasher64 (do_action+1316)
+ #04 pc 00000000000049c8 /system/bin/crasher64 (main+96)
+ #05 pc 000000000008021c /bionic/lib64/libc.so (_start_main)
+</pre>
+
+<p>
+ You can distinguish this from other kinds of abort by the presence of
+ <code>fdsan_error</code> in the backtrace and the specific abort message.
+</p>
+
+<p>
+ You can reproduce an instance of this type of crash using
+ <code>crasher fdsan_file</code> or <code>crasher fdsan_dir</code>.
+</p>
+
+
<h2 id=crashdump>Investigating crash dumps</h2>
<p>
diff --git a/en/devices/tech/health/index.md b/en/devices/tech/health/index.md
index 73c3fd1f..eb8028fb 100644
--- a/en/devices/tech/health/index.md
+++ b/en/devices/tech/health/index.md
@@ -16,7 +16,11 @@ Book: /_book.yaml
limitations under the License.
-->
-# Health
+# Performance and Health
+
+Take advantage of the many tests and tools described in
+<a href="/devices/tech/debug/eval_perf">Evaluating Performance</a> as part of
+your work getting the most out of Android.
Android {{ androidPVersionNumber }} includes `android.hardware.health` HAL 2.0,
a major version upgrade from health@1.0 HAL. This new HAL has the following
diff --git a/en/devices/tech/test_infra/tradefed/full_example.html b/en/devices/tech/test_infra/tradefed/full_example.html
index a6527aa0..4215b83b 100644
--- a/en/devices/tech/test_infra/tradefed/full_example.html
+++ b/en/devices/tech/test_infra/tradefed/full_example.html
@@ -74,7 +74,7 @@ public class HelloWorldTest implements IRemoteTest {
</pre>
<p>Save this sample code to
-<code>&lt;tree&gt;/tools/tradefederation/core/prod-tests/src/com/android/tradefed/example/HelloWorldTest.java</code>
+<code>&lt;tree&gt;/tools/tradefederation/core/src/com/android/tradefed/example/HelloWorldTest.java</code>
and rebuild tradefed from your shell:</p>
<pre class="devsite-terminal devsite-click-to-copy">
m -jN
@@ -137,7 +137,7 @@ JARs themselves. Tradefed automatically recognizes all configurations placed in
<p>To illustrate, move the <code>helloworld.xml</code> file into the tradefed
core library
-(<code>&lt;tree&gt;/tools/tradefederation/core/prod-tests/res/config/example/helloworld.xml</code>).
+(<code>&lt;tree&gt;/tools/tradefederation/core/res/config/example/helloworld.xml</code>).
Rebuild tradefed, restart the tradefed console, then ask tradefed to display the
list of configurations from the classpath:</p>
<pre class="devsite-click-to-copy">