From 4945711ac0fe9f19ae0d358ae00db5c03485aa53 Mon Sep 17 00:00:00 2001
From: Android Partner Docs
Date: Thu, 28 Jun 2018 10:08:47 -0700
Subject: Docs: Changes to source.android.com
- 202498507 Devsite localized content from translation request 944914. by Android Partner Docs
- 202368991 Document seccomp crashes. by Android Partner Docs
- 202365193 Devsite localized content from translation request 941016. by Android Partner Docs
- 202334002 Devsite localized content from translation request 944913. by Android Partner Docs
- 202333988 Devsite localized content from translation request 944152. by Android Partner Docs
- 202307420 Update Implementing Vulkan page. by Android Partner Docs
- 202218233 The -j64 seems unrealistic for most users. Bumped it dow... by Gina Dimino
- 202200614 Moving Treble content to main file (and removing treble f... by Heidi von Markham
- 202192748 Clarify HIDL threading documentation. by Android Partner Docs
- 202148581 Publish localized bulletins by Danielle Roberts
- 202141713 Devsite localized content from translation request 937937. by Android Partner Docs
- 202141703 Devsite localized content from translation request 941621. by Android Partner Docs
- 202141693 Devsite localized content from translation request 936854. by Android Partner Docs
- 202070722 Automated g4 rollback of changelist 182578621. by Christina Nguyen
- 202039586 Noting the need for upstream patches to some projects. by Clay Murphy
- 202035931 Devsite localized content from translation request 942523. by Android Partner Docs
- 201978491 Devsite localized content from translation request 940149. by Android Partner Docs
- 201749091 UpdatingHAL references/adding HIDL references by Android Partner Docs
- 201700681 Devsite localized content from translation request 940151. by Android Partner Docs
- 201700650 Devsite localized content from translation request 941012. by Android Partner Docs
- 201700579 Devsite localized content from translation request 942527. by Android Partner Docs
- 201700572 Devsite localized content from translation request 940150. by Android Partner Docs
- 201700538 Devsite localized content from translation request 932858. by Android Partner Docs
- 201700524 Devsite localized content from translation request 943117. by Android Partner Docs
- 201700504 Devsite localized content from translation request 943114. by Android Partner Docs
- 201537155 Devsite localized content from translation request 937234. by Android Partner Docs
- 201537147 Devsite localized content from translation request 941017. by Android Partner Docs
- 201532584 HAL to HIDL (change to "master" directory) by Android Partner Docs
- 201376845 Devsite localized content from translation request 910444. by Android Partner Docs
- 201371305 Devsite localized content from translation request 925769. by Android Partner Docs
- 201371295 Devsite localized content from translation request 938920. by Android Partner Docs
- 201264243 Removing version from VTS Codelab and O references. by Heidi von Markham
- 201207845 Add measurements for version 8.x on Nexus 5X, Nexus 6P, P... by Android Partner Docs
- 201195333 Devsite localized content from translation request 937940. by Android Partner Docs
- 201028550 Changed "Functional patches" table description in Pixel b... by Android Partner Docs
- 201021773 Devsite localized content from translation request 939440. by Android Partner Docs
- 201021757 Devsite localized content from translation request 939442. by Android Partner Docs
- 200732813 Devsite localized content from translation request 934614. by Android Partner Docs
- 200732804 Devsite localized content from translation request 910442. by Android Partner Docs
- 200625210 Updating warning about Valgrind deprecation by Heidi von Markham
- 200618019 Simple fix to removing misleading Git images by Heidi von Markham
- 200581373 Partner Security Updates and Resources Page has wrong OS ... by Android Partner Docs
- 200553261 Devsite localized content from translation request 936855. by Android Partner Docs
- 200553240 Devsite localized content from translation request 928419. by Android Partner Docs
- 200553234 Devsite localized content from translation request 928433. by Android Partner Docs
- 200553227 Devsite localized content from translation request 938813. by Android Partner Docs
- 200428587 Add link to CTS downloads page. by Kenneth Lau
- 200422176 Update CTS/CTS-Verifier downloads for CTS-Jun-2018 Releases by Android Partner Docs
- 200409107 Devsite localized content from translation request 931899. by Android Partner Docs
- 200289107 Android 7 -> Android 7.x and earlier; Android 8 -> Androi... by Android Partner Docs
- 200275031 Replace index.html with _index.yaml. by Android Partner Docs
- 200263644 Replace HAL paths with HIDL (B/78915061): In URLs, change... by Android Partner Docs
- 200159329 Hide star ratings to fix layout. by Android Partner Docs
- 200062417 Devsite localized content from translation request 915905. by Android Partner Docs
- 200062406 Devsite localized content from translation request 932855. by Android Partner Docs
- 200062403 Devsite localized content from translation request 936857. by Android Partner Docs
- 200062395 Devsite localized content from translation request 924210. by Android Partner Docs
- 199872446 add a 1 to the end of researchers twitter handle by Android Partner Docs
- 199852050 Change Nexus > Pixel/ Nexus by Danielle Roberts
- 199829857 Devsite localized content from translation request 932861. by Android Partner Docs
- 199829853 Devsite localized content from translation request 931901. by Android Partner Docs
- 199829847 Devsite localized content from translation request 928418. by Android Partner Docs
- 199826612 Add stayres@ to bulletin localization file by Danielle Roberts
PiperOrigin-RevId: 202498507
Change-Id: I3cf1b347a519ecff7960a159cdc57b35306435cf
---
en/devices/architecture/hidl-cpp/index.html | 22 ++-
en/devices/architecture/hidl/threading.html | 10 +
.../architecture/images/treble_blog_after.png | Bin 16439 -> 15325 bytes
.../architecture/images/treble_blog_before.png | Bin 19832 -> 18573 bytes
en/devices/architecture/index.html | 208 ++++++++++++++++-----
en/devices/architecture/treble.html | 92 ---------
6 files changed, 189 insertions(+), 143 deletions(-)
delete mode 100644 en/devices/architecture/treble.html
(limited to 'en/devices/architecture')
diff --git a/en/devices/architecture/hidl-cpp/index.html b/en/devices/architecture/hidl-cpp/index.html
index 28c4aa0a..15098178 100644
--- a/en/devices/architecture/hidl-cpp/index.html
+++ b/en/devices/architecture/hidl-cpp/index.html
@@ -83,7 +83,7 @@ HAL files and is a good reference). When transferring over HALs from
PACKAGE=android.hardware.nfc@1.0
LOC=hardware/interfaces/nfc/1.0/default/
-make hidl-gen -j64
+m -j hidl-gen
hidl-gen -o $LOC -Lc++-impl -randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport $PACKAGE
hidl-gen -o $LOC -Landroidbp-impl -randroid.hardware:hardware/interfaces \
@@ -117,19 +117,29 @@ a binderized service. Example daemon code (for pure binderized service):
int main(int /* argc */, char* /* argv */ []) {
+ // This function must be called before you join to ensure the proper
+ // number of threads are created. The threadpool will never exceed
+ // size one because of this call.
+ ::android::hardware::configureRpcThreadpool(1 /*threads*/, true /*willJoin*/);
+
sp nfc = new Nfc();
const status_t status = nfc->registerAsService();
if (status != ::android::OK) {
return 1; // or handle error
}
- // join pool or do other things
+
+ // Adds this thread to the threadpool, resulting in one total
+ // thread in the threadpool. We could also do other things, but
+ // would have to specify 'false' to willJoin in configureRpcThreadpool.
+ ::android::hardware::joinRpcThreadpool();
+ return 1; // joinRpcThreadpool should never return
}
-This daemon should live in $PACKAGE + "-service"
(for example,
-android.hardware.nfc@1.0-service
). The
-sepolicy for a specific class
-of HALs is the attribute hal_<module>
(for instance,
+
This daemon usually lives in $PACKAGE + "-service-suffix"
(for
+example, android.hardware.nfc@1.0-service
), but it could be anywhere.
+The sepolicy for a specific
+class of HALs is the attribute hal_<module>
(for instance,
hal_nfc)
. This attribute must be applied to the daemon that runs a
particular HAL (if the same process serves multiple HALs, multiple attributes
can be applied to it).
diff --git a/en/devices/architecture/hidl/threading.html b/en/devices/architecture/hidl/threading.html
index 059b61d4..5b8fa038 100644
--- a/en/devices/architecture/hidl/threading.html
+++ b/en/devices/architecture/hidl/threading.html
@@ -54,6 +54,16 @@ simultaneously or out of order by a server with more than one thread, and
oneway
calls may be processed concurrently with a subsequent
blocking call.
+Multiple nested calls will be sent on the same hwbinder thread. For instance,
+if a process (A) makes a synchronous call from a hwbinder thread into process (B),
+and then process (B) makes a synchronous call back into process (A), the call will
+be executed on the original hwbinder thread in (A) which is blocked on the original
+call. This optimization makes it possible to have a single threaded server able to
+handle nested calls, but it does not extend to cases where the calls travel through
+another sequence of IPC calls. For instance, if process (B) had made a
+binder/vndbinder call which called into a process (C) and then process (C) calls
+back into (A), it cannot be served on the original thread in (A).
+
Server threading model
Except for passthrough mode, server implementations of HIDL interfaces live
in a different process than the client and need one or more threads waiting for
diff --git a/en/devices/architecture/images/treble_blog_after.png b/en/devices/architecture/images/treble_blog_after.png
index 9eb06de4..ab2d05f0 100644
Binary files a/en/devices/architecture/images/treble_blog_after.png and b/en/devices/architecture/images/treble_blog_after.png differ
diff --git a/en/devices/architecture/images/treble_blog_before.png b/en/devices/architecture/images/treble_blog_before.png
index 4980f06b..c94d7638 100644
Binary files a/en/devices/architecture/images/treble_blog_before.png and b/en/devices/architecture/images/treble_blog_before.png differ
diff --git a/en/devices/architecture/index.html b/en/devices/architecture/index.html
index 592198ff..da16afb1 100644
--- a/en/devices/architecture/index.html
+++ b/en/devices/architecture/index.html
@@ -28,54 +28,172 @@ Android system architecture contains the following components:
+Figure 1. Android system architecture
+
+
+-
+ Application framework. The application framework is used
+ most often by application developers. As a hardware developer, you should be
+ aware of developer APIs as many map directly to the underlying HAL
+ interfaces and can provide helpful information about implementing drivers.
+
+-
+ Binder IPC. The Binder Inter-Process Communication (IPC)
+ mechanism allows the application framework to cross process boundaries and
+ call into the Android system services code. This enables high level
+ framework APIs to interact with Android system services. At the application
+ framework level, this communication is hidden from the developer and things
+ appear to "just work".
+
+-
+ System services. System services are modular, focused
+ components such as Window Manager, Search Service, or Notification Manager.
+ Functionality exposed by application framework APIs communicates with system
+ services to access the underlying hardware. Android includes two groups of
+ services: system (such as Window Manager and Notification Manager)
+ and media (services involved in playing and recording media).
+
+-
+ Hardware abstraction layer (HAL). A HAL defines a standard
+ interface for hardware vendors to implement, which enables Android to be
+ agnostic about lower-level driver implementations. Using a HAL allows you to
+ implement functionality without affecting or modifying the higher level
+ system. HAL implementations are packaged into modules and loaded by the
+ Android system at the appropriate time. For details, see
+ Hardware Abstraction Layer
+ (HAL).
+
+-
+ Linux kernel. Developing your device drivers is similar to
+ developing a typical Linux device driver. Android uses a version of the
+ Linux kernel with a few special additions such as Low Memory Killer (a
+ memory management system that is more aggressive in preserving memory), wake
+ locks (a
+
PowerManager
+ system service), the Binder IPC driver, and other features important for a
+ mobile embedded platform. These additions are primarily for system
+ functionality and do not affect driver development. You can use any version
+ of the kernel as long as it supports the required features (such as the
+ binder driver). However, we recommend using the latest version of the
+ Android kernel. For details, see
+ Building Kernels.
+
+
+
+HAL interface definition language (HIDL)
-Figure 1. Android system architecture
-
-Application framework
-
-The application framework is used most often by application developers. As a
-hardware developer, you should be aware of developer APIs as many map directly
-to the underlying HAL interfaces and can provide helpful information about
-implementing drivers.
-
-Binder IPC
-The Binder Inter-Process Communication (IPC) mechanism allows the application
-framework to cross process boundaries and call into the Android system services
-code. This enables high level framework APIs to interact with Android system
-services. At the application framework level, this communication is hidden from
-the developer and things appear to "just work".
-
-System services
-System services are modular, focused components such as Window Manager,
-Search Service, or Notification Manager. Functionality exposed by application
-framework APIs communicates with system services to access the underlying
-hardware. Android includes two groups of services: system (such as
-Window Manager and Notification Manager) and media (services involved
-in playing and recording media).
-
-Hardware abstraction layer (HAL)
-A HAL defines a standard interface for hardware vendors to implement,
-which enables Android to be agnostic about lower-level driver implementations.
-Using a HAL allows you to implement functionality without affecting or modifying
-the higher level system. HAL implementations are packaged into modules and
-loaded by the Android system at the appropriate time. For details, see
-Hardware Abstraction Layer (HAL).
+
+ Android 8.0 re-architected the Android OS framework (in a project known as
+ Treble) to make it easier, faster, and less costly for
+ manufacturers to update devices to a new version of Android. In this new
+ architecture, the HAL interface definition language (HIDL, pronounced
+ "hide-l") specifies the interface between a HAL and its users, enabling the
+ Android framework to be replaced without rebuilding the HALs.
+
+
+
+
+
+ HIDL separates the vendor implementation (device-specific, lower-level
+ software written by silicon manufacturers) from the Android OS framework via
+ a new vendor interface. Vendors or SOC makers build HALs once and place them
+ in a /vendor
partition on the device; the framework, in its own
+ partition, can then be replaced with an
+ over-the-air (OTA) update without
+ recompiling the HALs.
+
+
+ The difference between the legacy Android architecture and the current,
+ HIDL-based architecture is in the use of the vendor interface:
+
+
+
+-
+ In Android 7.x and earlier, no formal vendor interface exists, so device
+ makers must update large portions of the Android code to move a device to a
+ newer version of Android:
+
+
+Figure 2. Legacy Android update
+environment
+
+-
+ In Android 8.0 and higher, a new stable vendor interface provides access to
+ the hardware-specific parts of Android, so device makers can deliver
+ new Android releases simply by updating the Android OS
+ framework—without additional work required from the silicon
+ manufacturers:
+
+
+Figure 3. Current Android update
+environment
+
+
+
+
+ All new devices launching with Android 8.0 and higher can take advantage of
+ the new architecture. To ensure forward compatibility of vendor
+ implementations, the vendor interface is validated by the
+ Vendor Test Suite (VTS), which is
+ analogous to the Compatibility Test Suite
+ (CTS). You can use VTS to automate HAL and OS kernel testing in both
+ legacy and current Android architectures.
+
+
+Architecture resources
+
+
+ For details on the Android architecture, see the following sections:
-Linux kernel
-Developing your device drivers is similar to developing a typical Linux
-device driver. Android uses a version of the Linux kernel with a few special
-additions such as Low Memory Killer (a memory management system that is more
-aggressive in preserving memory), wake locks (a
-
-PowerManager
system service), the Binder IPC driver, and
-other features important for a mobile embedded platform. These additions are
-primarily for system functionality and do not affect driver development.
-
-You can use any version of the kernel as long as it supports the required
-features (such as the binder driver). However, we recommend using the latest
-version of the Android kernel. For details, see
-Building Kernels.
+
+-
+ HAL Types. Describes
+ binderized, passthrough, Same-Process (SP), and legacy HALs.
+
+-
+ HIDL (General). Contains
+ general information about the interface between a HAL and its users.
+
+-
+ HIDL (C++). Contains
+ details for creating C++ implementations of HIDL interfaces.
+
+-
+ HIDL (Java).
+ Contains details about the Java frontend for HIDL interfaces.
+
+-
+ ConfigStore HAL.
+ Describes APIs for accessing read-only configuration items used to configure
+ the Android framework.
+
+-
+ Device Tree Overlays.
+ Provides details on using device tree overlays (DTOs) in Android.
+
+-
+ Vendor Native Development
+ Kit (VNDK). Describes the set of vendor-exclusive libraries for
+ implementing vendor HALs.
+
+-
+ Vendor Interface Object
+ (VINTF). Describes the objects that aggregate relevant information about
+ a device and make that information available through a queryable API.
+
+-
+ SELinux for Android
+ 8.0. Details SELinux changes and customizations.
+
+