From 3fbb9e0053b81286309c23898fdecd7b933cdf02 Mon Sep 17 00:00:00 2001
From: Android Partner Docs
Requirements for Device Tree Overlay support (if used):
Android Automotive (AAE) P introduces a new state – deep sleep – into the AAE P power -management state machine. To implement this state, AAE P provides a new power management service +
Android 9 introduces a new state – deep sleep – into the power
+management state machine. To implement this state, Android 9 provides a new power management service
and interface: CarPowerManagementService
and CarPowerManager
.
State transitions are triggered by the Vehicle MCU (VMCU). To enable AAE to communicate with the -VMCU, integrators must implement several components. Integrators are responsible for integrating +
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.
-These terms are used throughout this document:
@@ -73,7 +73,7 @@ bringup.This section describes how AAE represents the application processor's power state and which +
This section describes how Android 9 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.
-AAE uses a state machine to represent the power state of the AP. This state machine +
Android 9 uses a state machine to represent the power state of the AP. This state machine provides these five states, as illustrated below:
When this 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.
-These five modules comprise the power management system:
@@ -203,14 +203,14 @@ modules, applications, and services is illustrated below:Figure 2. Power components reference diagram
-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:
Figure 4. Exit deep sleep sequence diagram
-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 enables the system software to:
PowerTestFragment.java
in com.google.android.car.kitchensink.power
@@ -282,7 +282,7 @@ illustrates how to use these APIs in Java. Use these steps to call the APIs prov
To create a CPM object, call the Car object's getCarManager()
method. This method is
a facade used to create CM objects. Specify android.car.Car.POWER_SERVICE
as an
@@ -297,7 +297,7 @@ CarPowerManager powerManager =
-
System applications and services can receive power state change notifications by implementing
CarPowerManager.CarPowerStateListener
. This interface defines one method
@@ -358,7 +358,7 @@ following table:
To unregister all listener objects registered to CPM, call the clearListener
method:
To acquire the boot reason, call the getBootReason
method, which communicates with
the CPMS and returns one of the following five boot reasons:
This method throws a CarNotConnectedException
when it fails to communicate with the
CPMS.
The requestShutdownOnNextSuspend()
method instructs CPMS to shut down instead of deep
sleep at the next opportunity.
Integrators are responsible for implementing the following items:
First, implement the Linux suspend power state. Android places a device into suspend mode when
an application or service writes mem
into a file located at
@@ -455,15 +455,15 @@ 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.
The VHAL provides an interface between the vehicle network and Android. The VHAL:
When the CPMS informs the VHAL that it is ready to shut down, the VHAL sends the shutdown ready @@ -503,7 +503,7 @@ instruct the VMCU that it is safe to remove power from the device.
integers:int32Values[0]
: VehicleApPowerStateReport
enum of current state int32Values[0]
: VehicleApPowerStateReport
enum of the current state.int32Values[1]
: Time in milliseconds to postpone or sleep/shutdown. This value
depends on the first value.The state can be set asynchronously (in the case of BOOT_COMPLETE
) or in response to
a request via the VMCU. When the state is set to SHUTDOWN_START
,
-DEEP_SLEEP_ENTRY,
or SHUTDOWN_POSTPONE
, an integer value in
+DEEP_SLEEP_ENTRY,
or SHUTDOWN_POSTPONE
, an integer value in
milliseconds is sent to notify the VMCU for how long the AP must postpone shutdown or sleep.
int32Values[0]
: VehicleApPowerStateReq
enum value, which represents
-the new state into which to transitionint32Values[1]
: VehicleApPowerStateShutdownParam
enum value. This is
-sent only for a SHUTDOWN_PREPARE
message and conveys to Android what options it
-contains.int32Values[1]
: VehicleApPowerStateShutdownParam
enum value. This
+ value os sent only for a SHUTDOWN_PREPARE
message and transmits to Android the
+ options it contains.The first integer value represents the new state into which Android is to transit. The semantics
-are defined in types.hal
and provided in the following table:
types.hal
and provided in the following table:
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 +Common wake sources include heartbeats, modem, wifi, and Bluetooth. The only valid wake source must be an interrupt from the VMCU to wake up the SoC. This assumes that the VMCU can listen to the modem -for remote wakeup events (such as remote engine start). If this functionality is pushed to the AP, +for remote wakeup events (such as remote engine start). If this functionality is pushed to the AP, then another wake source to service the modem must be added. In the current design, the Integrator -supplies a file with a list of wake sources to be turned off. The CPMS iterates through this file +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.
-OEMs must be careful to write applications so that they can be shut down quickly and not postpone the process indefinitely.
-This class diagram displays the Java classes and interfaces in the power management system:
@@ -739,7 +739,7 @@ the process indefinitely.Figure 5. Power class diagram
-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 diff --git a/en/devices/camera/camera3.html b/en/devices/camera/camera3.html index bb2e6833..71e90a34 100644 --- a/en/devices/camera/camera3.html +++ b/en/devices/camera/camera3.html @@ -30,7 +30,7 @@ to your underlying camera driver and hardware. Android 8.0 introduced Treble, switching the CameraHal API to a stable interface defined by the HAL Interface Description Language (HIDL). If you have previously developed a camera -HAL module and driver for older versions of Android, be aware of significant +HAL module and driver for Android 7.0 and lower, be aware of significant changes in the camera pipeline.
setRepeatingRequest()
). Captures
have priority over repeating requests.
Figure 2. Camera core operation model
+Figure 1. Camera core operation model
Version 1 of the camera subsystem was designed as a black box with high-level controls and the following three operating modes:
@@ -105,7 +105,7 @@ hard to implement new features such as burst mode, which falls between two of the operating modes.Figure 1. Camera components
+Figure 2. Camera components
Android 7.0 continues to support camera HAL1 as many devices still rely on it. In addition, the Android camera service supports implementing both HALs (1 diff --git a/en/devices/tech/debug/asan.html b/en/devices/tech/debug/asan.html index 9ea32939..29df8b6d 100644 --- a/en/devices/tech/debug/asan.html +++ b/en/devices/tech/debug/asan.html @@ -44,7 +44,8 @@ HWASan is non-deterministic. There are only 256 possible tag values, so there is probability of missing any bug. HWAsan does not have ASan's limited-size redzones for detecting overflows and limited-capacity quarantine for detecting use-after-free, so it does not matter to HWAsan how large the overflow is or how long ago the memory -was deallocated. This makes HWASan better than ASan.
+was deallocated. This makes HWASan better than ASan. You can read more about +the design of HWAsan.Valgrind's Memcheck tool is similar, but ASan also detects stack/global overflows in addition to heap overflows, and is much faster with less memory overhead. Conversely, @@ -60,10 +61,15 @@ instead.
As of December 2018 only Pixel 2 and Pixel 2 XL are supported. Supporting another device -requires backporting several kernel patches. The Android team is working on getting those into -the common kernel. -You may also need to remove some optional extras to make room on your system partition for the +
As of February 2019 only Pixel 2 and Pixel 2 XL support HWAsan. The Android team is working on +getting the necessary patches into the common kernel, but for now supporting another device requires +backporting these kernel patches:
+ + +You may also need to remove some optional extras to make room on your system partition for the
larger libraries. See the walleye_hwasan
target for an example.
Use the following commands to build the entire platform using HWASan:
diff --git a/en/devices/tech/debug/gdb.html b/en/devices/tech/debug/gdb.html index 49d62aa3..34096fb6 100644 --- a/en/devices/tech/debug/gdb.html +++ b/en/devices/tech/debug/gdb.html @@ -162,5 +162,47 @@ the following property: set arm fallback-mode arm # or thumb +GDB supports debugging platform code on + Visual Studio Code. + You can use the + VS Code debugger frontend instead of the GDB CLI interface to control and + debug native code running on devices.
+Before using VS Code for debugging, make sure you install the + + C/C++ extension.
+To debug code using VS Code:
+gdbclient.py
are present.Run the following command:
+gdbclient.py -p pid | -n proc-name | -r ... --setup-forwarding vscode ANY_OTHER_FLAGS
+ This prints a JSON object and gdbclient.py
continues running.
+ This is expected; do not kill the gdbclient.py
program.
launch.json
file and adds a new JSON object to a
+ list.
+ gdbclient.py
and paste it
+ into the object you just deleted. Save the changes.
+ gdbclient.py
and press enter to end the
+ gdbclient.py
program.
+ After setting up the debugger configuration for the first time, + you can skip steps 3 through 6.