Docs: Change to the Fingerprint HAL doc
am: 0fda4ae8f8
* commit '0fda4ae8f8f65df3360a3170059b5ea11c99f7ec':
Docs: Change to the Fingerprint HAL doc
diff --git a/Android.mk b/Android.mk
index 5524b3e..3890b64 100644
--- a/Android.mk
+++ b/Android.mk
@@ -19,10 +19,12 @@
# Sets up the Doxygen HAL reference docs and puts them in the right place
# Need doxygen in your path (1.8.3 was used when this target was created)
+.PHONY: setup-hal-ref
setup-hal-ref:
$(hide) doxygen docs/source.android.com/Doxyfile
# Put HAL refs in PDK instead and strip nav to s.a.c.
+.PHONY: pdk-hal-ref
pdk-hal-ref:
$(hide) doxygen vendor/pdk/data/google/Doxyfile
@@ -31,7 +33,7 @@
# Target assumes that you have a "tradefed" directory
# that contains a sync'ed copy of the "tradefed" branch at the same level as the
# live docs branch.
-
+.PHONY: setup-tradefed-ref
setup-tradefed-ref:
$(hide) rm -rf $(OUT_DOCS)/online-sac/reference
$(hide) cp -R $(OUT_DOCS)/tradefed/reference $(OUT_DOCS)/online-sac
diff --git a/src/accessories/aoa.jd b/src/accessories/aoa.jd
index 7c728fe..8eb7723 100644
--- a/src/accessories/aoa.jd
+++ b/src/accessories/aoa.jd
@@ -20,17 +20,18 @@
protocol, which defines how an accessory detects and sets up communication with
an Android-powered device. Accessories should carry out the following steps:</p>
-<ul>
+<ol>
<li>Wait for and detect a connected device.</li>
<li>Determine the device's accessory mode support.</li>
<li>Attempt to start the device in accessory mode (if needed).</li>
<li>If the device supports AOA, establish communication with the device.</li>
-</ul>
+</ol>
<p>The following sections explain how to implement these steps.</p>
-<p class="note">When developing a new accessory that connects to an Android
-device over USB, use <a href="{@docRoot}accessories/aoa2.html">AOAv2</a>.</p>
+<p class="note"><strong>Note:</strong> When developing a new accessory that
+connects to an Android device over USB, use
+<a href="{@docRoot}accessories/aoa2.html">AOAv2</a>.</p>
<h2 id="wait-for-and-detect-connected-devices">Wait for and detect connected
devices</h2>
@@ -79,14 +80,14 @@
<p>If the vendor and product IDs do not correspond to an Android-powered device
in accessory mode, the accessory cannot discern whether the device supports (but
is not in) accessory mode or if the device does not support accessory mode. This
-can occur because devices that support accessory mode (but are not in that mode)
-initially report the <em>device</em> manufacturer vendor and product IDs instead
-of the <em>AOA</em> vendor and product IDs.</p>
+can occur because devices that support accessory mode (but are not in accessory
+mode) initially report the <em>device</em> manufacturer vendor and product IDs
+instead of the <em>AOA</em> vendor and product IDs.</p>
<p>The accessory should try to start the device in accessory mode to determine
if the device supports that mode:</p>
-<ul>
+<ol>
<li>Send a 51 control request ("Get Protocol") to determine if the device
supports the Android accessory protocol. If the device supports the protocol,
it returns a non-zero number that represents the supported protocol version.
@@ -141,18 +142,23 @@
data: none
</pre>
</li>
-</ul>
+</ol>
<p>After completing these steps, the accessory should wait for the connected USB
device to re-introduce itself on the bus in accessory mode, then re-enumerate
-connected devices. The algorithm returns to
-<a href="#determine-accessory-mode-support">determine accessory mode support</a>
-to check the vendor and product IDs, which should be correct (e.g. correspond to
-Google's vendor and product IDs instead of the device manufacturer's IDs) if the
-device successfully switched to accessory mode. If IDs are correct, the
+connected devices. The algorithm
+<a href="#determine-accessory-mode-support">determines accessory mode support</a>
+by checking the vendor and product IDs, which should be correct (e.g. correspond
+to Google's vendor and product IDs instead of the device manufacturer's IDs) if
+the device successfully switched to accessory mode. If IDs are correct, the
accessory moves to <a href="#establish-communication-with-the-device">establish
communication with the device</a>.</p>
+<p class="note"><strong>Note:</strong> AOA does not currently support
+simultaneous AOA and MTP connections. To switch from AOA to MTP, the accessory
+must first disconnect the USB device (either physically or in an electrically
+equivalent way) then reconnect using MTP.</p>
+
<p>If any step fails, the accessory determines the device does not support
Android accessory mode and waits for the next device to connect.</p>
diff --git a/src/accessories/headset/images/headset-circuit1.png b/src/accessories/headset/images/headset-circuit1.png
index f3e622a..d6f7421 100644
--- a/src/accessories/headset/images/headset-circuit1.png
+++ b/src/accessories/headset/images/headset-circuit1.png
Binary files differ
diff --git a/src/accessories/headset/images/headset-circuit2.png b/src/accessories/headset/images/headset-circuit2.png
index ff6b541..6700c45 100644
--- a/src/accessories/headset/images/headset-circuit2.png
+++ b/src/accessories/headset/images/headset-circuit2.png
Binary files differ
diff --git a/src/compatibility/5.0/android-5.0-cdd.html b/src/compatibility/5.0/android-5.0-cdd.html
index 27e19ea..1abf06b 100644
--- a/src/compatibility/5.0/android-5.0-cdd.html
+++ b/src/compatibility/5.0/android-5.0-cdd.html
@@ -4851,8 +4851,7 @@
the port at bottom. Existing and new Android devices are <strong>very strongly encouraged to meet these requirements</strong> so they will be able to upgrade to future platform releases.
<li> It MUST allow a USB host connected with the Android device to access the
contents of the shared storage volume using either USB mass storage or Media
-Transfer Protocol, if the device reports the android.hardware.feature.output
-feature or the android.hardware.camera feature.
+Transfer.
<li> It SHOULD implement the Android Open Accessory (AOA) API and specification as
documented in the Android SDK documentation, and if it is an Android Handheld
device it MUST implement the AOA API. Device implementations implementing the
@@ -4993,12 +4992,12 @@
implementations MUST meet the following requirements: </p>
<ul>
- <li> <strong>Consistent frame latency</strong>—Inconsistent frame latency or a delay to render frames MUST NOT happen more
+ <li> <strong>Consistent frame latency</strong>Inconsistent frame latency or a delay to render frames MUST NOT happen more
often than 5 frames in a second, and SHOULD be below 1 frames in a second.
- <li> <strong>User interface latency</strong>—Device implementations MUST ensure low latency user experience by scrolling a
+ <li> <strong>User interface latency</strong>Device implementations MUST ensure low latency user experience by scrolling a
list of 10K list entries as defined by the Android Compatibility Test Suite
(CTS) in less than 36 secs.
- <li> <strong>Task switching</strong>—When multiple applications have been launched, re-launching an already-running
+ <li> <strong>Task switching</strong>When multiple applications have been launched, re-launching an already-running
application after it has been launched MUST take less than 1 second.
</ul>
@@ -5009,13 +5008,13 @@
and write operations. </p>
<ul>
- <li> <strong>Sequential write</strong>—Device implementations MUST ensure a sequential write performance of 10MB/s
+ <li> <strong>Sequential write</strong>Device implementations MUST ensure a sequential write performance of 5MB/s
for a 256MB file using 10MB write buffer.
- <li> <strong>Random write</strong>—Device implementations MUST ensure a random write performance of 0.5MB/s for a
+ <li> <strong>Random write</strong>Device implementations MUST ensure a random write performance of 0.5MB/s for a
256MB file using 4KB write buffer.
- <li> <strong>Sequential read</strong>—Device implementations MUST ensure a sequential read performance of 15MB/s for
+ <li> <strong>Sequential read</strong>Device implementations MUST ensure a sequential read performance of 15MB/s for
a 256MB file using 10MB write buffer.
- <li> <strong>Random read</strong>—Device implementations MUST ensure a random read performance of 3.5MB/s for a
+ <li> <strong>Random read</strong>Device implementations MUST ensure a random read performance of 3.5MB/s for a
256MB file using 4KB write buffer.
</ul>
@@ -5170,9 +5169,9 @@
<h2 id=9_7_kernel_security_features>9.7. Kernel Security Features</h2>
-<p>The Android Sandbox includes features that can use the Security-Enhanced Linux
+<p>The Android Sandbox includes features that use the Security-Enhanced Linux
(SELinux) mandatory access control (MAC) system and other security features in
-the Linux kernel. SELinux or any other security features, if implemented below
+the Linux kernel. SELinux or any other security features implemented below
the Android framework:</p>
<ul>
@@ -5187,30 +5186,26 @@
affect another application (such as a Device Administration API), the API MUST
NOT allow configurations that break compatibility. </p>
-<p>Devices MUST implement SELinux or an equivalent mandatory access control system
-if using a kernel other than Linux and meet the following requirements, which
+<p>Devices MUST implement SELinux or, if using a kernel other than Linux, an equivalent mandatory access control system.
+Devices must also meet the following requirements, which
are satisfied by the reference implementation in the upstream Android Open
Source Project.</p>
<p>Device implementations:</p>
<ul>
- <li> MUST support a SELinux policy that allows the SELinux mode to be set on a
-per-domain basis, and MUST configure all domains in enforcing mode. No
+ <li> MUST set SELinux to global enforcing mode,
+ <li> MUST configure all domains in enforcing mode. No
permissive mode domains are allowed, including domains specific to a
-device/vendor
- <li> SHOULD load policy from /sepolicy file on the device
+device/vendor.
<li> MUST NOT modify, omit, or replace the neverallow rules present within the
-sepolicy file provided in the upstream Android Open Source Project (AOSP) and
-the policy MUST compile with all neverallow present, for both AOSP SELinux
-domains as well as device/vendor specific domains
- <li> MUST support dynamic updates of the SELinux policy file without requiring a
-system image update
+external/sepolicy folder provided in the upstream Android Open Source Project (AOSP) and
+the policy MUST compile with all neverallow rules present, for both AOSP SELinux
+domains as well as device/vendor specific domains.
</ul>
-<p>Device implementations SHOULD retain the default SELinux policy provided in the
-upstream Android Open Source Project, until they have first audited their
-additions to the SELinux policy. Device implementations MUST be compatible with
+<p>Device implementations SHOULD retain the default SELinux policy provided in the external/sepolicy folder of the
+upstream Android Open Source Project and only further add to this policy for their own device-specific configuration. Device implementations MUST be compatible with
the upstream Android Open Source Project.</p>
<h2 id=9_8_privacy>9.8. Privacy</h2>
@@ -5900,7 +5895,7 @@
<p>9.9. Full-Disk Encryption</p>
</td>
<td>
-<p>Devices with a lock screen MUST support full-disk encryption. For new devices,
+<p>Devices with a lock screen SHOULD support full-disk encryption. For new devices,
full-disk encryption must be enabled out of box. </p>
</td>
</tr>
diff --git a/src/compatibility/5.1/android-5.1-cdd.html b/src/compatibility/5.1/android-5.1-cdd.html
index a53df74..95ab547 100644
--- a/src/compatibility/5.1/android-5.1-cdd.html
+++ b/src/compatibility/5.1/android-5.1-cdd.html
@@ -4253,7 +4253,7 @@
<p>
Verified boot is a feature that guarantees the integrity of the device software.
-If a device implementation supports the feature, it MUST:
+If a device implementation supports the feature, it MUST:</p>
<ul>
<li>Declare the platform feature flag android.software.verified_boot</li>
<li>Perform verification on every boot sequence</li>
@@ -4264,7 +4264,6 @@
<li>Use verification algorithms as strong as current recommendations
from NIST for hashing algorithms (SHA-256) and public key sizes (RSA-2048)</li>
</ul>
-</p>
<p>Device implementations SHOULD support verified boot for device integrity.
While this requirement is SHOULD for this version of the Android platform,
@@ -4409,7 +4408,7 @@
Automotive implementations.</td>
</tr>
<tr>
- <td>3.8.10. Lock Screen Media Control<</td>
+ <td>3.8.10. Lock Screen Media Control</td>
<td>Clarified requirement for Android Watch and Automotive implementations.</td>
</tr>
<tr>
diff --git a/src/compatibility/5.1/android-5.1-cdd.pdf b/src/compatibility/5.1/android-5.1-cdd.pdf
index 78a9857..55023f5 100644
--- a/src/compatibility/5.1/android-5.1-cdd.pdf
+++ b/src/compatibility/5.1/android-5.1-cdd.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-body.pdf b/src/compatibility/5.1/android-cdd-body.pdf
index df0552d..d9dbad3 100644
--- a/src/compatibility/5.1/android-cdd-body.pdf
+++ b/src/compatibility/5.1/android-cdd-body.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-cover.css b/src/compatibility/5.1/android-cdd-cover.css
index 7364deb..04133d6 100644
--- a/src/compatibility/5.1/android-cdd-cover.css
+++ b/src/compatibility/5.1/android-cdd-cover.css
@@ -83,4 +83,4 @@
p {
margin: 0px;
padding: 0px;
-}
\ No newline at end of file
+}
diff --git a/src/compatibility/5.1/android-cdd-cover.pdf b/src/compatibility/5.1/android-cdd-cover.pdf
index 90f12e9..0b6649a 100644
--- a/src/compatibility/5.1/android-cdd-cover.pdf
+++ b/src/compatibility/5.1/android-cdd-cover.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-cover_5_1.html b/src/compatibility/5.1/android-cdd-cover_5_1.html
index 25eaefe..e3bb542 100644
--- a/src/compatibility/5.1/android-cdd-cover_5_1.html
+++ b/src/compatibility/5.1/android-cdd-cover_5_1.html
@@ -24,7 +24,7 @@
<tr>
<td>
<p class="subtitle">Android 5.1</p>
-<p class="cover-text">Last updated: June 9th, 2015</p>
+<p class="cover-text">Last updated: July 10th, 2015</p>
<p class="cover-text">Copyright © 2015, Google Inc. All rights reserved.</p>
<p class="cover-text"><a href="mailto:compatibility@android.com">compatibility@android.com</a></p>
</td>
@@ -39,4 +39,4 @@
</table>
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/src/compatibility/5.1/versions.jd b/src/compatibility/5.1/versions.jd
index 52a7f90..e27d574 100644
--- a/src/compatibility/5.1/versions.jd
+++ b/src/compatibility/5.1/versions.jd
@@ -11,8 +11,9 @@
<p>Because subsequent releases of the Android software may revise this string,
but not change any API behavior, such releases may not be accompanied by a new
Compatibility Definition Document. This page lists the versions that are
-allowable by an Android 5.0-based system. The only permitted values for
+allowable by an Android 5.1-based system. The only permitted values for
<code>android.os.Build.VERSION.RELEASE</code> for Android 5.1 are:</p>
<ul>
<li>5.1</li>
+<li>5.1.1</li>
</ul>
diff --git a/src/compatibility/CDD_README.txt b/src/compatibility/CDD_README.txt
new file mode 100644
index 0000000..a702444
--- /dev/null
+++ b/src/compatibility/CDD_README.txt
@@ -0,0 +1,90 @@
+CDD GENERATION README
+=======================
+Or, how I stopped hating the cdd and learned to love html-to-pdf conversions.
+
+
+OVERVIEW
+==================
+TL:DR This document describes how to create a CDD PDF from the CDD HTML file. You need to generate a cover file and a body file, then use a PDF editor to insert the cover page into the body.pdf.
+
+The Android Compatibilty Definition Document (CDD) is maintained as an html file but distributed as a .pdf. The partner team updates the CDD for every new major Android release and the APE doc team posts the new .pdf to source.android.com in http://source.android.com/compatibility/.
+
+To create the pdf from the html file, use wkhtmltopdf (http://wkhtmltopdf.org/) plus a little bit of PDF editing. You can do the conversion on a Mac or Linux (or even Windows); you just need to download the wkhtmltopdf pkg for your system. However, you must perform the editing in a professional PDF editor; for Mac and Windows this is Adobe Acrobat Pro; for Linux this is PDF Studio 10 (none of the free Linux PDF apps can do the swap successfully and still maintain the PDF bookmarks and links).
+
+
+1. INSTALL WKHTMLTOPDF
+=======================
+Go to http://wkhtmltopdf.org/ and download the app for your system OS. It's command line only.
+
+
+2. GENERATE COVER PDF
+=======================
+
+Syntax:
+
+wkthmltopdf [page-size] [page-margins] cover path-to-html path-to-pdf
+
+page-size
+Set to letter.
+Ex. -s letter
+
+page-margins
+set to 0in (cover goes all the way to page edges)
+Ex. -B 0in -T 0in -L 0in -R 0in
+
+path-to-html
+The full path to the cover html file. You will need to update the cover text to specify the release name , number, and date. You might also need to swap the image out for the image associated with the release (store images in compatibility/images).
+Ex: docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html
+
+path-to-pdf
+The full path to where you want the output pdf file to reside. If the pdf file is NOT open (in Preview or some other app), running the command will silently overwrite the existing .pdf.
+Ex. docs/source.android.com/src/compatibility/5.1/android-cdd-cover.pdf
+
+Example cover command run from top-level project:
+wkhtmltopdf -s letter -B 0in -T 0in -L 0in -R 0in cover docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html docs/source.android.com/src/compatibility/5.1/android-cdd-cover.pdf
+
+Example cover command run from 5.1 release folder:
+wkhtmltopdf -s letter -B 0in -T 0in -L 0in -R 0in cover android-cdd-cover_5_1.html /android-cdd-cover.pdf
+
+
+3. GENERATE BODY PDF
+====================
+Syntax:
+
+wkthmltopdf [page-margins] page path-to-html path-to-footer path-to-pdf
+
+page-margins
+set to 1in on top and bottom, .75in on left and right.
+Ex. -B 1in -T 1in -L .75in -R .75in
+
+path-to-html
+The full path to the body html file. This is the main cdd.html, which will change with each release.
+Ex. docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html
+
+path-to-footer
+The full path to the footer html file. This is a simple html file that contains the android logo and some javascript to calculate the page number and count. The footer should NOT change from release to release.
+Ex. --footer-html docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html
+
+path-to-pdf
+The full path to where you want the output pdf file to reside. If the pdf file is NOT open (in Preview or some other app), running the command will silently overwrite the existing .pdf.
+Ex. docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf
+
+Example body command run from top-level project:
+wkhtmltopdf -B 1in -T 1in -L .75in -R .75in page docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html --footer-html docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf
+
+Example body command run from 5.1 release folder:
+wkhtmltopdf -B 1in -T 1in -L .75in -R .75in page android-5.1-cdd.html --footer-html android-cdd-footer.html android-cdd-body.pdf
+
+4. CREATE CSS PDF
+==================
+A. Open the body.pdf:
+ On a Mac or Windows, use Adobe Acrobat Pro (you *cannot* use Acrobat Reader for this task).
+ On Ubuntu, use PDF Studio 10 (other free pdf programs *cannot* handle the merge + bookmarks).
+B. Replace page 1 of the body.pdf with page 1 of the cover.pdf.
+C. Save the new file as the android-cdd_x_x.pdf (where X_X is the number of the release, such as 5.1).
+
+QUESTIONS?
+==================
+- For details on wkhtmltopdf, see http://wkhtmltopdf.org/usage/wkhtmltopdf.txt.
+- CDD html, css, and pdf files are in docs/source.android.com/src/compatibility/release.
+- CDD images are in docs/source.android.com/src/compatibility/images.
\ No newline at end of file
diff --git a/src/compatibility/android-5.1-cdd.pdf b/src/compatibility/android-5.1-cdd.pdf
new file mode 100644
index 0000000..55023f5
--- /dev/null
+++ b/src/compatibility/android-5.1-cdd.pdf
Binary files differ
diff --git a/src/compatibility/android-cdd.html b/src/compatibility/android-cdd.html
index b4f89ce..51970c9 100644
--- a/src/compatibility/android-cdd.html
+++ b/src/compatibility/android-cdd.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<head>
<title>Android ANDROID_VERSION Compatibility Definition</title>
-<link rel="stylesheet" type="text/css" href="source/android-cdd.css"/>
+<link rel="stylesheet" type="text/css" href="android-cdd.css"/>
</head>
<body>
diff --git a/src/compatibility/android-cdd.pdf b/src/compatibility/android-cdd.pdf
index 78a9857..55023f5 100644
--- a/src/compatibility/android-cdd.pdf
+++ b/src/compatibility/android-cdd.pdf
Binary files differ
diff --git a/src/compatibility/android-cts-manual.pdf b/src/compatibility/android-cts-manual.pdf
deleted file mode 100644
index d551495..0000000
--- a/src/compatibility/android-cts-manual.pdf
+++ /dev/null
Binary files differ
diff --git a/src/compatibility/compatibility_toc.cs b/src/compatibility/compatibility_toc.cs
index 6d4b69e..c0115e9 100644
--- a/src/compatibility/compatibility_toc.cs
+++ b/src/compatibility/compatibility_toc.cs
@@ -24,9 +24,21 @@
</div>
<ul>
<li><a href="<?cs var:toroot ?>compatibility/overview.html">Overview</a></li>
- <li><a href="<?cs var:toroot ?>compatibility/cts-intro.html">Compatibility Test Suite</a></li>
- <li><a href="<?cs var:toroot ?>compatibility/cts-development.html">CTS Development</a></li>
<li><a href="<?cs var:toroot ?>compatibility/android-cdd.pdf">Compatibility Definition Document (CDD)</a></li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>compatibility/cts/index.html">
+ <span class="en">Compatibility Test Suite</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>compatibility/cts/setup.html">Set up CTS</a></li>
+ <li><a href="<?cs var:toroot ?>compatibility/cts/run.html">Run CTS</a></li>
+ <li><a href="<?cs var:toroot ?>compatibility/cts/verifier.html">Run CTS Verifier</a></li>
+ <li><a href="<?cs var:toroot ?>compatibility/cts/interpret.html">Interpret Results</a></li>
+ <li><a href="<?cs var:toroot ?>compatibility/cts/development.html">Develop CTS</a></li>
+ </ul>
+ </li>
<li><a href="<?cs var:toroot ?>compatibility/downloads.html">Downloads</a></li>
<li><a href="<?cs var:toroot ?>compatibility/contact-us.html">Contact Us</a></li>
</ul>
diff --git a/src/compatibility/contact-us.jd b/src/compatibility/contact-us.jd
index 6c590f5..e77b115 100644
--- a/src/compatibility/contact-us.jd
+++ b/src/compatibility/contact-us.jd
@@ -2,24 +2,24 @@
@jd:body
<!--
- Copyright 2015 The Android Open Source Project
+ Copyright 2015 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
+ 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.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-->
<p>This page describes the
contact methods for inquiries regarding the Android compatibility program,
including the Compatibility Definition Document (CDD) and Compatibility Test
-Suite (CTS). See the <a href="{@docRoot}community/index.html">Community</a>
+Suite (CTS). See the <a href="{@docRoot}source/community.html">Community</a>
page for communication channels regarding other topics.</p>
<h2
@@ -38,7 +38,7 @@
</ul>
<p>To make best use of this list, please first read <a
-href="{@docRoot}source/community/index.html#getting-the-most-from-our-lists">Getting
+href="{@docRoot}source/community.html#getting-the-most-from-our-lists">Getting
the Most from Our Lists</a> on the Community page. Users looking for help with
Android devices should contact their carrier or manufacturer for help.</p>
@@ -49,4 +49,4 @@
href="mailto:android-partnerships@google.com">android-partnerships@google.com</a>
<p>While we read every message received, we cannot respond to each of them. We
-promise to contact you if we can help!</p>
+promise to contact you if we can help!</p>
\ No newline at end of file
diff --git a/src/compatibility/cts-development.jd b/src/compatibility/cts-development.jd
deleted file mode 100644
index 4631aca..0000000
--- a/src/compatibility/cts-development.jd
+++ /dev/null
@@ -1,109 +0,0 @@
-page.title=CTS Development
-@jd:body
-
-<!--
- Copyright 2013 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.
--->
-
-<h2 id="initializing-your-repo-client">Initializing Your Repo Client</h2>
-<p>Follow the <a href="{@docRoot}source/downloading.html">instructions</a>
-to get and build the Android source code but specify <code>-b android-4.3_r1</code>
-when issuing the <code>repo init</code> command. This assures that your CTS
-changes will be included in the next CTS release and beyond.</p>
-<h2 id="setting-up-eclipse">Setting Up Eclipse</h2>
-<p>Follow the <a href="{@docRoot}source/using-eclipse.html">instructions</a>
-to setup Eclipse but execute the following command to generate the
-<code>.classpath</code> file rather than copying the one from the development
-project:</p>
-<pre><code>cd /path/to/android/root
-./cts/development/ide/eclipse/genclasspath.sh > .classpath
-chmod u+w .classpath
-</code></pre>
-<p>This <code>.classpath</code> file will contain both the Android framework
-packages and the CTS packages.</p>
-<h2 id="building-and-running-cts">Building and Running CTS</h2>
-<p>Execute the following commands to build CTS and start the interactive
-CTS console:</p>
-<pre><code>cd /path/to/android/root
-make cts
-cts-tradefed
-</code></pre>
-<p>At the cts-tf console, enter e.g.:</p>
-<pre><code>run cts --plan CTS
-</code></pre>
-<h2 id="writing-cts-tests">Writing CTS Tests</h2>
-<p>CTS tests use JUnit and the Android testing APIs. Review the
-<a href="https://developer.android.com/guide/topics/testing/testing_android.html">Testing and Instrumentation</a>
-tutorial while perusing the existing tests under the
-<code>cts/tests/tests</code> directory. You will see that CTS tests mostly follow the same
-conventions used in other Android tests.</p>
-<p>Since CTS runs across many production devices, the tests must follow
-these rules:</p>
-<ul>
-<li>Must take into account varying screen sizes, orientations, and keyboard layouts.</li>
-<li>Only use public API methods. In other words, avoid all classes, methods, and fields that are annotated with the "hide" annotation.</li>
-<li>Avoid relying upon particular view layouts or depend on the dimensions of assets that may not be on some device.</li>
-<li>Don't rely upon root privileges.</li>
-</ul>
-<h3 id="test-naming-and-location">Test Naming and Location</h3>
-<p>Most CTS test cases target a specific class in the Android API. These tests
-have Java package names with a <code>cts</code> suffix and class
-names with the <code>Test</code> suffix. Each test case consists of
-multiple tests, where each test usually exercises a particular API method of
-the API class being tested. These tests are arranged in a directory structure
-where tests are grouped into different categories like "widgets" and "views."</p>
-<p>For example, the CTS test for <code>android.widget.TextView</code> is
-<code>android.widget.cts.TextViewTest</code> found under the
-<code>cts/tests/tests/widget/src/android/widget/cts</code> directory with its
-Java package name as <code>android.widget.cts</code> and its class name as
-<code>TextViewTest</code>. The <code>TextViewTest</code> class has a test called <code>testSetText</code>
-that exercises the "setText" method and a test named "testSetSingleLine" that
-calls the <code>setSingleLine</code> method. Each of those tests have <code>@TestTargetNew</code>
-annotations indicating what they cover.</p>
-<p>Some CTS tests do not directly correspond to an API class but are placed in
-the most related package possible. For instance, the CTS test,
-<code>android.net.cts.ListeningPortsTest</code>, is in the <code>android.net.cts</code>, because it
-is network related even though there is no <code>android.net.ListeningPorts</code> class.
-You can also create a new test package if necessary. For example, there is an
-"android.security" test package for tests related to security. Thus, use your
-best judgement when adding new tests and refer to other tests as examples.</p>
-<p>Finally, a lot of tests are annotated with @TestTargets and @TestTargetNew.
-These are no longer necessary so do not annotate new tests with these.</p>
-<h3 id="new-test-packages">New Test Packages</h3>
-<p>When adding new tests, there may not be an existing directory to place your
-test. In that case, refer to the example under <code>cts/tests/tests/example</code> and
-create a new directory. Furthermore, make sure to add your new package's
-module name from its <code>Android.mk</code> to <code>CTS_COVERAGE_TEST_CASE_LIST</code> in
-<code>cts/CtsTestCaseList.mk</code>. This Makefile is used by <code>build/core/tasks/cts.mk</code>
-to glue all the tests together to create the final CTS package.</p>
-<h3 id="test-stubs-and-utilities">Test Stubs and Utilities</h3>
-<p>Some tests use additional infrastructure like separate activities
-and various utilities to perform tests. These are located under the
-<code>cts/tests/src</code> directory. These stubs aren't separated into separate test
-APKs like the tests, so the <code>cts/tests/src</code> directory does not have additional
-top level directories like "widget" or "view." Follow the same principle of
-putting new classes into a package with a name that correlates to the purpose
-of your new class. For instance, a stub activity used for testing OpenGL like
-<code>GLSurfaceViewStubActivity</code> belongs in the <code>android.opengl.cts</code> package under
-the <code>cts/tests/src/android/opengl</code> directory.</p>
-<h2 id="other-tasks">Other Tasks</h2>
-<p>Besides adding new tests there are other ways to contribute to CTS:</p>
-<ul>
-<li>Fix or remove tests annotated with BrokenTest and KnownFailure.</li>
-</ul>
-<h2 id="submitting-your-changes">Submitting Your Changes</h2>
-<p>Follow the <a href="{@docRoot}source/submit-patches.html">Android Contributors' Workflow</a>
-to contribute changes to CTS. A reviewer
-will be assigned to your change, and your change should be reviewed shortly!</p>
diff --git a/src/compatibility/cts-intro.jd b/src/compatibility/cts-intro.jd
deleted file mode 100644
index d9dcc99..0000000
--- a/src/compatibility/cts-intro.jd
+++ /dev/null
@@ -1,166 +0,0 @@
-page.title=Compatibility Test Suite
-@jd:body
-
-<!--
- Copyright 2014 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.
--->
-
-<h2 id="how-does-the-cts-work">How does the CTS work?</h2>
-
-<div class="figure" style="width:383px">
- <img src="{@docRoot}images/cts-0.png" alt="CTS flow" height="340px" id="figure1" />
- <p class="img-caption">
- <strong>Figure 1.</strong> How to use CTS
- </p>
-</div>
-
-<p>The CTS is an automated testing harness that includes two major software components:</p>
-<ul>
-<li>
-<p>The CTS test harness runs on your desktop machine and manages test execution.</p>
-</li>
-<li>
-<p>Individual test cases are executed on attached mobile devices or on an
-emulator. The test cases are written in Java as JUnit tests and packaged as
-Android .apk files to run on the actual device target.</p>
-</li>
-</ul>
-<h2 id="workflow">Workflow</h2>
-<p>This section summarizes CTS setup. Please refer to the <a href="android-cts-manual.pdf">
-CTS User Manual</a> for detailed instructions.</p>
-<ol>
-<li>
-<p><a href="downloads.html">Download</a> the CTS and CTS media files.</p>
-</li>
-<li>
-<p>Attach at least one device (or emulator) to your machine.</p>
-</li>
-<li>
-<p>For CTS versions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run the accessibility tests:</p>
-<ol>
-<li>
-<code>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</code>
-</li>
-<li>
-<p>On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service</p>
-</li>
-</ol>
-</li>
-<li>
-<p>For CTS 2.3 R4 and beyond, set up your device to run the device administration tests:</p>
-<ol>
-<li>
-<code>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</code>
-</li>
-<li>
-<p>On the device, enable the two <code>android.deviceadmin.cts.CtsDeviceAdminReceiver*</code> device
-administrators under Settings > Location & security > Select device administrators</p>
-<p><strong>Note</strong>: Make sure the <code>android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver</code>
-stays disabled in the same menu.</p>
-</li>
-</ol>
-</li>
-<li>
-<p>For CTS 2.3 R12 and beyond, the CTS media files must be copied to the device's external storage. Check section 4.2 of the latest CTS manual for further details on copying these files:</p>
-<ol>
-<li>
-<p>Unzip the CTS Media zip file.</p>
-</li>
-<li>
-<p>Run the following command. If no resolution is specified, the default maximum resolution of
-480x360 is assumed:</p>
-<code>copy_media.sh [720x480|1280x720|1920x1080|all] [-s serial]</code>
-</li>
-</ol>
-</li>
-<li>
-<p>Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:</p>
-<ul>
-<li>
-<p>The test harness pushes an .apk file to each device, executes the test through instrumentation, and records test results.</p>
-</li>
-<li>
-<p>The test harness removes the .apk file from each device.</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Once all the tests are executed, view the test results in your browser and
-use them to adjust your design. You can continue to run the CTS throughout your development process.</p>
-</li>
-</ol>
-<h2 id="types-of-test-cases">Types of test cases</h2>
-<p>The CTS includes the following types of test cases:</p>
-<ul>
-<li>
-<p><em>Unit tests</em> test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.</p>
-</li>
-<li>
-<p><em>Functional tests</em> test a combination of APIs together in a higher-level use-case.</p>
-</li>
-<li>
-<p><em>Reference application tests</em> instrument a complete sample application
-to exercise a full set of APIs and Android runtime services.</p>
-</li>
-</ul>
-<p>Future versions of the CTS will include the following types of test cases:</p>
-<ul>
-<li>
-<p><em>Robustness tests</em> test the durability of the system under stress.</p>
-</li>
-<li>
-<p><em>Performance tests</em> test the performance of the system against defined benchmarks, for example rendering frames per second.</p>
-</li>
-</ul>
-<h2 id="areas-covered">Areas Covered</h2>
-<p>The unit test cases cover the following areas to ensure compatibility:</p>
-<table>
-<thead>
-<tr>
-<th>Area</th>
-<th>Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>Signature tests</td>
-<td>For each Android release, there are XML files describing the signatures of all public APIs contained in the release. The CTS contains a utility to check those API signatures against the APIs available on the device. The results from signature checking are recorded in the test result XML file.</td>
-</tr>
-<tr>
-<td>Platform API Tests</td>
-<td>Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK <a href="https://developer.android.com/reference/classes.html">Class Index</a> to ensure API correctness, including correct class, attribute and method signatures, correct method behavior, and negative tests to ensure expected behavior for incorrect parameter handling.</td>
-</tr>
-<tr>
-<td>Dalvik VM Tests</td>
-<td>The tests focus on testing the Dalvik Executable Format.</td>
-</tr>
-<tr>
-<td>Platform Data Model</td>
-<td>The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK <a href="https://developer.android.com/reference/android/provider/package-summary.html">android.provider</a> package: contacts, browser, settings, etc.</td>
-</tr>
-<tr>
-<td>Platform Intents</td>
-<td>The CTS tests the core platform intents, as documented in the SDK <a href="https://developer.android.com/guide/appendix/g-app-intents.html">Available Intents</a>.</td>
-</tr>
-<tr>
-<td>Platform Permissions</td>
-<td>The CTS tests the core platform permissions, as documented in the SDK <a href="https://developer.android.com/reference/android/Manifest.permission.html">Available Permissions</a>.</td>
-</tr>
-<tr>
-<td>Platform Resources</td>
-<td>The CTS tests for correct handling of the core platform resource types, as documented in the SDK <a href="https://developer.android.com/guide/topics/resources/available-resources.html">Available Resource Types</a>. This includes tests for: simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources.</td>
-</tr>
-</tbody>
-</table>
diff --git a/src/compatibility/cts/development.jd b/src/compatibility/cts/development.jd
new file mode 100644
index 0000000..662d94a
--- /dev/null
+++ b/src/compatibility/cts/development.jd
@@ -0,0 +1,189 @@
+page.title=CTS Development
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<h2 id="initializing-your-repo-client">Initializing your Repo client</h2>
+<p>Follow the <a href="{@docRoot}source/downloading.html">instructions</a>
+to get and build the Android source code but specify a particular CTS branch
+name, for example<code>-b android-5.0_r2</code>, when issuing the <code>repo
+init</code> command. This assures your CTS changes will be included in the
+next CTS release and beyond.</p>
+
+<h2 id="setting-up-eclipse">Setting up Eclipse</h2>
+
+<p>Follow the <a href="{@docRoot}source/using-eclipse.html">instructions</a>
+to setup Eclipse but execute the following command to generate the
+<code>.classpath</code> file rather than copying the one from the development
+project:</p>
+<pre><code>cd /path/to/android/root
+./cts/development/ide/eclipse/genclasspath.sh > .classpath
+chmod u+w .classpath
+</code></pre>
+
+<p>This <code>.classpath</code> file will contain both the Android framework
+packages and the CTS packages.</p>
+
+<h2 id="building-and-running-cts">Building and running CTS</h2>
+
+<p>Execute the following commands to build CTS and start the interactive
+CTS console:</p>
+<p class="note"><strong>Note:</strong> You may supply one of these other values
+for <code>TARGET_PRODUCT</code> to build for different architectures:
+<code>aosp_x86_64</code> or <code>aosp_mips</code></p>
+<pre><code>cd <em>/path/to/android/root</em>
+make cts -j32 TARGET_PRODUCT=aosp_arm64
+cts-tradefed
+</code></pre>
+
+<p>At the cts-tf console, enter e.g.:</p>
+<pre><code>run cts --plan CTS
+</code></pre>
+
+<h2 id="writing-cts-tests">Writing CTS tests</h2>
+
+<p>CTS tests use JUnit and the Android testing APIs. Review the
+<a href="https://developer.android.com/tools/testing/testing_android.html">Testing and Instrumentation</a>
+tutorial while perusing the existing tests under the
+<code>cts/tests</code> directory. You will see that CTS tests mostly follow the same
+conventions used in other Android tests.</p>
+<p>Since CTS runs across many production devices, the tests must follow
+these rules:</p>
+<ul>
+<li>Must take into account varying screen sizes, orientations, and keyboard layouts.</li>
+<li>Only use public API methods. In other words, avoid all classes, methods, and fields that are annotated with the "hide" annotation.</li>
+<li>Avoid relying upon particular view layouts or depend on the dimensions of assets that may not be on some device.</li>
+<li>Don't rely upon root privileges.</li>
+</ul>
+
+<h3 id="test-naming-and-location">Test naming and location</h3>
+
+<p>Most CTS test cases target a specific class in the Android API. These tests
+have Java package names with a <code>cts</code> suffix and class
+names with the <code>Test</code> suffix. Each test case consists of
+multiple tests, where each test usually exercises a particular API method of
+the API class being tested. These tests are arranged in a directory structure
+where tests are grouped into different categories like "widgets" and "views."</p>
+
+<p>For example, the CTS test for <code>android.widget.TextView</code> is
+<code>android.widget.cts.TextViewTest</code> found under the
+<code>cts/tests/tests/widget/src/android/widget/cts</code> directory with its
+Java package name as <code>android.widget.cts</code> and its class name as
+<code>TextViewTest</code>. The <code>TextViewTest</code> class has a test called <code>testSetText</code>
+that exercises the "setText" method and a test named "testSetSingleLine" that
+calls the <code>setSingleLine</code> method. Each of those tests have <code>@TestTargetNew</code>
+annotations indicating what they cover.</p>
+
+<p>Some CTS tests do not directly correspond to an API class but are placed in
+the most related package possible. For instance, the CTS test,
+<code>android.net.cts.ListeningPortsTest</code>, is in the <code>android.net.cts</code>, because it
+is network related even though there is no <code>android.net.ListeningPorts</code> class.
+You can also create a new test package if necessary. For example, there is an
+"android.security" test package for tests related to security. Thus, use your
+best judgement when adding new tests and refer to other tests as examples.</p>
+
+<p>Finally, a lot of tests are annotated with @TestTargets and @TestTargetNew.
+These are no longer necessary so do not annotate new tests with these.</p>
+<h3 id="new-test-packages">New sample packages</h3>
+<p>When adding new tests, there may not be an existing directory to place your
+test. In that case, refer to the example under <code>cts/tests/tests/example</code> and
+create a new directory. Furthermore, make sure to add your new package's
+module name from its <code>Android.mk</code> to <code>CTS_COVERAGE_TEST_CASE_LIST</code> in
+<code>cts/CtsTestCaseList.mk</code>. This Makefile is used by <code>build/core/tasks/cts.mk</code>
+to glue all the tests together to create the final CTS package.</p>
+
+<h2 id="Fix-remove-tests">Fix or remove tests</h2>
+<p>Besides adding new tests there are other ways to contribute to CTS: Fix or
+remove tests annotated with "BrokenTest" or "KnownFailure."</p>
+<h2 id="submitting-your-changes">Submitting your changes</h2>
+<p>Follow the <a href="{@docRoot}source/submit-patches.html">Submitting Patches workflow</a>
+to contribute changes to CTS. A reviewer
+will be assigned to your change, and your change should be reviewed shortly!</p>
+
+<h2 id="release-schedule">Release schedule and branch information</h2>
+
+<p>CTS releases follow this schedule.</p>
+
+<p class="note"><strong>Note</strong>: This schedule is tentative and may be
+updated from time to time as CTS for the given Android version matures.</p>
+
+<table>
+<tr>
+ <th>Version</th>
+ <th>Branch</th>
+ <th>Frequency</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+ <td>5.1</td>
+ <td>lollipop-mr1-cts-dev</td>
+ <td>Monthly</td>
+</tr>
+<tr>
+ <td>5.0</td>
+ <td>lollipop-cts-dev</td>
+ <td>Monthly</td>
+</tr>
+<tr>
+ <td>4.4</td>
+ <td>kitkat-cts-dev</td>
+ <td>Odd month (Jan, Mar, etc.)</td>
+</tr>
+<tr>
+ <td>4.3</td>
+ <td>jb-mr2-cts-dev</td>
+ <td>First month of each quarter</td>
+</tr>
+<tr>
+ <td>4.2</td>
+ <td>jb-mr1.1-cts-dev</td>
+ <td>First month of each quarter</td>
+</tr>
+</table>
+
+<h3 id="important-dates">Important Dates during month of the release</h3>
+
+<ul>
+ <li><strong>End of 1st Week</strong>: Code Freeze. At this point,
+submissions on the current branch will no longer be accepted and will not be
+included in the next version of CTS. Once we have chosen a candidate for
+release, the branch will again be open and accepting new submissions.
+
+ <li><strong>Second or third week</strong>: CTS is published in the Android
+Open Source Project (AOSP).
+</ul>
+
+<h3 id="auto-merge">Auto-merge flow</h3>
+
+<p>CTS development branches have been setup so that changes submitted to each
+branch will automatically merge as below:<br>
+jb-dev-> jb-mr1.1-cts-dev -> jb-mr2-cts-dev -> kitkat-cts-dev ->
+lollipop-cts-dev -> lollipop-mr1-cts-dev -> <private-development-branch for
+Android M></p>
+
+<p>If a changelist (CL) fails to merge correctly, the author of the CL will get
+an email with instructions on how to resolve the conflict. In most of the
+cases, the author of the CL can use the instructions to skip the auto-merge of
+the conflicting CL.</p>
diff --git a/src/compatibility/cts/images/camera-printed-target.png b/src/compatibility/cts/images/camera-printed-target.png
new file mode 100644
index 0000000..d405c50
--- /dev/null
+++ b/src/compatibility/cts/images/camera-printed-target.png
Binary files differ
diff --git a/src/compatibility/cts/images/cts-0.png b/src/compatibility/cts/images/cts-0.png
new file mode 100644
index 0000000..4264e4c
--- /dev/null
+++ b/src/compatibility/cts/images/cts-0.png
Binary files differ
diff --git a/src/compatibility/cts/images/cts-test-report.png b/src/compatibility/cts/images/cts-test-report.png
new file mode 100644
index 0000000..892daef
--- /dev/null
+++ b/src/compatibility/cts/images/cts-test-report.png
Binary files differ
diff --git a/src/compatibility/cts/images/cts-test-summary.png b/src/compatibility/cts/images/cts-test-summary.png
new file mode 100644
index 0000000..ff35afc
--- /dev/null
+++ b/src/compatibility/cts/images/cts-test-summary.png
Binary files differ
diff --git a/src/compatibility/cts/images/cts-verifier-icon.png b/src/compatibility/cts/images/cts-verifier-icon.png
new file mode 100644
index 0000000..52f07f3
--- /dev/null
+++ b/src/compatibility/cts/images/cts-verifier-icon.png
Binary files differ
diff --git a/src/compatibility/cts/images/cts-verifier-menu.png b/src/compatibility/cts/images/cts-verifier-menu.png
new file mode 100644
index 0000000..f0ab680
--- /dev/null
+++ b/src/compatibility/cts/images/cts-verifier-menu.png
Binary files differ
diff --git a/src/compatibility/cts/images/path-saved-report.png b/src/compatibility/cts/images/path-saved-report.png
new file mode 100644
index 0000000..5269c2a
--- /dev/null
+++ b/src/compatibility/cts/images/path-saved-report.png
Binary files differ
diff --git a/src/compatibility/cts/images/screen-lock-test.png b/src/compatibility/cts/images/screen-lock-test.png
new file mode 100644
index 0000000..3ffb96e
--- /dev/null
+++ b/src/compatibility/cts/images/screen-lock-test.png
Binary files differ
diff --git a/src/compatibility/cts/images/verifier-save-icon.png b/src/compatibility/cts/images/verifier-save-icon.png
new file mode 100644
index 0000000..f04478d
--- /dev/null
+++ b/src/compatibility/cts/images/verifier-save-icon.png
Binary files differ
diff --git a/src/compatibility/cts/images/video-verifier.png b/src/compatibility/cts/images/video-verifier.png
new file mode 100644
index 0000000..72f62fe
--- /dev/null
+++ b/src/compatibility/cts/images/video-verifier.png
Binary files differ
diff --git a/src/compatibility/cts/index.jd b/src/compatibility/cts/index.jd
new file mode 100644
index 0000000..7b154e5
--- /dev/null
+++ b/src/compatibility/cts/index.jd
@@ -0,0 +1,124 @@
+page.title=Compatibility Test Suite
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<h2 id="how-does-the-cts-work">How does the CTS work?</h2>
+
+<p>The CTS is an automated testing harness that includes two major software components:</p>
+<ul>
+<li>
+<p>The CTS tradefed test harness runs on your desktop machine and manages test execution.</p>
+</li>
+<li>
+<p>Individual test cases are executed on the Device Under Test (DUT). The test
+cases are written in Java as JUnit tests and packaged as
+Android .apk files to run on the actual device target.</p>
+</li>
+</ul>
+
+<p>The CTS Verifier is a tool for manual testing and includes the following software components:</p>
+<ul>
+<li>
+<p>The CTS verifier app that is executed on the DUT and collects the results.<p>
+</li>
+<li>
+<p>The executable(s) or script(s) that are executed on the desktop machine to
+provide data or additional control for some test cases in the CTS Verifier
+app.</p>
+</li>
+</ul>
+
+<h2 id="workflow">Workflow</h2>
+
+<div class="figure" style="width:383px">
+ <img src="images/cts-0.png" alt="CTS flow" height="340px" id="figure1" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> How to use CTS
+ </p>
+</div>
+
+<p>This diagram summarizes CTS workflow. Please refer to the subpages of this
+section starting with <a href="setup.html">Setup</a> for detailed
+instructions.</p>
+
+<h2 id="types-of-test-cases">Types of test cases</h2>
+<p>The CTS includes the following types of test cases:</p>
+<ul>
+<li>
+<p><em>Unit tests</em> test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.</p>
+</li>
+<li>
+<p><em>Functional tests</em> test a combination of APIs together in a higher-level use-case.</p>
+</li>
+</ul>
+<p>Future versions of the CTS will include the following types of test cases:</p>
+<ul>
+<li>
+<p><em>Robustness tests</em> test the durability of the system under stress.</p>
+</li>
+<li>
+<p><em>Performance tests</em> test the performance of the system against defined benchmarks, for example rendering frames per second.</p>
+</li>
+</ul>
+<h2 id="areas-covered">Areas covered</h2>
+<p>The unit test cases cover the following areas to ensure compatibility:</p>
+<table>
+<thead>
+<tr>
+<th>Area</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Signature tests</td>
+<td>For each Android release, there are XML files describing the signatures of all public APIs contained in the release. The CTS contains a utility to check those API signatures against the APIs available on the device. The results from signature checking are recorded in the test result XML file.</td>
+</tr>
+<tr>
+<td>Platform API Tests</td>
+<td>Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK <a href="https://developer.android.com/reference/classes.html">Class Index</a> to ensure API correctness, including correct class, attribute and method signatures, correct method behavior, and negative tests to ensure expected behavior for incorrect parameter handling.</td>
+</tr>
+<tr>
+<td>Dalvik Tests</td>
+<td>The tests focus on testing the Dalvik Executable Format.</td>
+</tr>
+<tr>
+<td>Platform Data Model</td>
+<td>The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK <a href="https://developer.android.com/reference/android/provider/package-summary.html">android.provider</a> package: contacts, browser, settings, etc.</td>
+</tr>
+<tr>
+<td>Platform Intents</td>
+<td>The CTS tests the core platform intents, as documented in the SDK <a href="https://developer.android.com/guide/appendix/g-app-intents.html">Available Intents</a>.</td>
+</tr>
+<tr>
+<td>Platform Permissions</td>
+<td>The CTS tests the core platform permissions, as documented in the SDK <a href="https://developer.android.com/reference/android/Manifest.permission.html">Available Permissions</a>.</td>
+</tr>
+<tr>
+<td>Platform Resources</td>
+<td>The CTS tests for correct handling of the core platform resource types, as documented in the SDK <a href="https://developer.android.com/guide/topics/resources/available-resources.html">Available Resource Types</a>. This includes tests for: simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources.</td>
+</tr>
+</tbody>
+</table>
diff --git a/src/compatibility/cts/interpret.jd b/src/compatibility/cts/interpret.jd
new file mode 100644
index 0000000..7109ded
--- /dev/null
+++ b/src/compatibility/cts/interpret.jd
@@ -0,0 +1,70 @@
+page.title=Interpreting CTS results
+@jd:body
+
+<!--
+ Copyright 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<p>The CTS test results are placed in the file:</p>
+<pre>
+$CTS_ROOT/android-cts/repository/results/<start_time>.zip
+</pre>
+
+<p>If you have built the CTS yourself, <em>$CTS_ROOT</em> will resemble the
+path <em>out/host/linux-x86/cts</em> but differ by platform. This reflects the
+path where you have uncompressed the prebuilt official CTS <a
+href="{@docRoot}compatibility/downloads.html">downloaded</a> from this site.</p>
+
+<p>Inside the zip, the testResult.xml file contains the actual results—open
+this file in any web browser (HTML5 compatible browser recommended) to view the
+test results. It will resemble the following screenshots.</p>
+
+<img src="images/cts-test-summary.png" alt="CTS test summary" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> CTS test summary
+</p>
+
+<p>If testResult.xml displays a blank page when using the Chrome browser,
+<a href="https://www.chromium.org/developers/how-tos/run-chromium-with-flags">change
+your browser configuration</a> to enable the
+<em>--allow-file-access-from-files</em> command line flag.</p>
+
+<p>The Device Information section provides details about the device, firmware
+(make, model, firmware build, platform), and device hardware (screen
+resolution, keypad, screen type). To access device information, click the link
+above Test Summary.</p>
+
+<p>The <em>Test Summary</em> section provides executed test plan details, like
+the CTS plan name and execution start and end times. It also presents an
+aggregate summary of the number of tests that passed, failed, timed out, or
+could not be executed.</p>
+<p>The next section also provides a summary of tests passed per package.</p>
+
+<img src="images/cts-test-report.png" alt="CTS detailed test report" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> CTS test report
+</p>
+
+<p>This is followed by details of the the actual tests that were executed. The
+report lists the test package, test suite, test case, and the executed tests.
+It shows the result of the test execution—pass, fail, timed out, or not
+executed. In the event of a test failure details are provided to help diagnose
+the cause.</p>
+
+<p>Further, the stack trace of the failure is available in the XML file but is
+not included in the report to ensure brevity—viewing the XML file with a text
+editor should provide details of the test failure (search for the
+<em><Test></em> tag corresponding to the failed test and look within it
+for the <em><StackTrace></em> tag).</p>
diff --git a/src/compatibility/cts/run.jd b/src/compatibility/cts/run.jd
new file mode 100644
index 0000000..68f7da2
--- /dev/null
+++ b/src/compatibility/cts/run.jd
@@ -0,0 +1,185 @@
+page.title=Running CTS tests
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<h2 id=cts_tradefed>Using the CTS tradefed</h2>
+<p>See the <a
+href="{@docRoot}devices/tech/test_infra/tradefed/index.html">Trade Federation
+Overview</a> for an explanation of the Trade Federation (tradefed or TF for
+short) continuous test framework.</p>
+
+<p>To run a test plan:</p>
+<ol>
+ <li>Connect at least one device.
+ <li>Press the <strong>home</strong> button to set the device to the home screen at the start of CTS.
+ <li>While a device is running tests, it must not be used for any other tasks
+ and must be kept in a stationary position (to avoid triggering sensor activity)
+ with the cameras pointing at an object that could be focused.
+ <li>Do not press any keys on the device while the CTS is running. Pressing keys
+ or touching the screen of a test device will interfere with the running tests
+ and may lead to test failures.
+ <li>Launch the CTS console by running the <em>cts-tradefed</em> script from
+ the folder where the CTS package has been unzipped, e.g.
+ <code>$ ./android-cts/tools/cts-tradefed</code>
+ <li>You may start the default test plan (containing all of the test packages) by
+ appending: <code>run cts --plan CTS</code> This will kick off all the CTS tests required for compatibility.
+ Enter <code>list plans</code> to see a list of test plans in the repository.
+ Enter <code>list packages</code> to see a list of test packages in the repository.
+ See the CTS command
+ reference or type help for a complete list of supported commands.
+ <li>Alternately, you may run the CTS plan of your choosing from the command line
+ using: <code>cts-tradefed run cts --plan
+ <plan_name>
+ </code>
+ <li>View test progress and results reported on the console.
+ <li>If your device is Android 5.0 or later and declares support for an ARM and a
+ x86 ABI, you should run both the ARM and x86 CTS packages.
+</ol>
+<h2 id=selecting_cts_plans>Selecting CTS plans</h2>
+<p>The following test plans are available:</p>
+<ul>
+ <li><em>CTS</em>—all tests required for compatibility. </li>
+ <li><em>Signature</em>—the signature verification of all public APIs </li>
+ <li><em>Android</em>—tests for the Android APIs </li>
+ <li><em>Java</em>—tests for the Java core library </li>
+ <li><em>VM</em>—tests for ART or Dalvik </li>
+ <li><em>Performance</em>—performance tests for your implementation </li>
+</ul>
+<p>These can be executed with the <code>run cts</code> command.</p>
+<h2 id=cts_reference>CTS console command reference</h2>
+
+<p class="table-caption" id="console-commands">
+ <strong>Table 1.</strong> This table summarizes the CTS console commands for
+various uses.</p>
+<table>
+ <tbody>
+ <tr>
+ <th>Host</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>help</code></td>
+ <td>Display a summary of the most commonly used commands</td>
+ </tr>
+ <tr>
+ <td><code>help all</code></td>
+ <td>Display the complete list of available commands</td>
+ </tr>
+ <tr>
+ <td><code>exit</code></td>
+ <td>Gracefully exit the CTS console. Console will close when all currently running tests are finished</td>
+ </tr>
+ <tr>
+ <th>Run</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>run cts</code></td>
+ <td>Run the specified tests and displays progress information. One of
+<code>--plan</code>, <code>--package</code>, <code>--class</code> or
+<code>--continue-session</code> needs to be specified
+ <p>The CTS console can accept other commands while tests are in progress </p>
+ <p>If no devices are connected, the CTS desktop machine (or host) will wait for a device to be connected before starting tests </p>
+ <p>If more than one device is connected, the CTS host will choose a device automatically</p></td>
+ </tr>
+ <tr>
+ <td><code>--plan <test_plan_name></code></td>
+ <td>Run the specified test plan</td>
+ </tr>
+ <tr>
+ <td><code>-- package/-p <test_package_name> [--package/-p <test_package2>...]</code></td>
+ <td>Run the specified test packages</td>
+ </tr>
+ <tr>
+ <td><code>--class/-c <class_name> [--method/-m <test_method_name></code></td>
+ <td>Run the specified test class and/or method</td>
+ </tr>
+ <tr>
+ <td><code>--continue-session</code></td>
+ <td>Run all not executed tests from previous CTS session; the sessions testResult.xml will be updated with the new results</td>
+ </tr>
+ <tr>
+ <td><code>--shards <number_of_shards></code></td>
+ <td>Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel</td>
+ </tr>
+ <tr>
+ <td><code>--serial/-s <deviceID></code></td>
+ <td>Run CTS on the specific device</td>
+ </tr>
+ <tr>
+ <td><code>-t <class_name>#<test_method_name></code></td>
+ <td>Run a specific test method</td>
+ </tr>
+ <tr>
+ <td><code>--force-abi 32|64</code></td>
+ <td>On 64-bit devices, run the test against only the 32-bit or 64-bit ABI</td>
+ </tr>
+ <tr>
+ <th>List</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>list packages</code></td>
+ <td>List all available test packages in the repository</td>
+ </tr>
+ <tr>
+ <td><code>list plans</code></td>
+ <td>List all available test plans in the repository</td>
+ </tr>
+ <tr>
+ <td><code>list invocations</code></td>
+ <td>List 'run' commands currently being executed on devices</td>
+ </tr>
+ <tr>
+ <td><code>list commands</code></td>
+ <td>List all 'run' commands currently in the queue waiting to be assigned to devices</td>
+ </tr>
+ <tr>
+ <td><code>list results</code></td>
+ <td>List CTS results currently stored in repository</td>
+ </tr>
+ <tr>
+ <td><code>list devices</code></td>
+ <td>List currently connected devices and their state
+ <p> </p>
+ <p>'Available' devices are functioning, idle devices, available for running tests</p>
+ <p> </p>
+ <p>'Unavailable' devices are devices visible via adb, but are not responding to adb commands and won't be allocated for tests</p>
+ <p> </p>
+ <p>'Allocated' devices are devices currently running tests</td>
+ </tr>
+ <tr>
+ <th>Add</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>add derivedplan --plan <plan_name><br>
+ --result/-r<br>
+ [pass | fail | timeout | notExecuted]<br>
+ [--session/-s <session_id>]</code></td>
+ <td>Create a plan derived from given result session; use this option to rerun reports and validate test issues</td>
+ </tr>
+ </tbody>
+</table>
diff --git a/src/compatibility/cts/setup.jd b/src/compatibility/cts/setup.jd
new file mode 100644
index 0000000..6e13ede
--- /dev/null
+++ b/src/compatibility/cts/setup.jd
@@ -0,0 +1,194 @@
+page.title=Setting up CTS
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<h2 id=desktop_setup>Desktop machine setup</h2>
+<h3 id=adb>ADB and AAPT</h3>
+<p>Before running the CTS, make sure you have recent versions of both <a
+href="http://developer.android.com/tools/help/adb.html">Android Debug
+Bridge (adb)</a> and <a
+href="http://developer.android.com/guide/topics/manifest/uses-feature-element.html#testing">Android
+Asset Packaging Tool (AAPT)</a> installed and those tools' location added
+to the system path of your machine.</p>
+
+<p>To install ADB, download the <a
+href="http://developer.android.com/sdk/index.html#Other">Android SDK Tools</a>
+package for your operating system, open it, and follow the instructions in the
+included README file. For troubleshooting information, see <a
+href="http://developer.android.com/sdk/installing/index.html?pkg=tools">Installing
+the Stand-alone SDK Tools</a>.</p>
+
+<p>Ensure <code>adb</code> and <code>aapt</code> are in your system path. The
+following command assumes you've opened the package archive in your home
+directory:</p>
+<hr>
+<pre>
+export PATH=$PATH:$HOME/android-sdk-linux/platform-tools
+</pre>
+
+<p class="note"><strong>Note:</strong> Please ensure your starting path and
+directory name are correct.</p>
+
+<h3 id=JDK>Java Development Kit (JDK)</h3>
+<p>You need to install the proper version of the <a
+href="{@docRoot}source/initializing.html#installing-the-jdk">Java Development Kit (JDK)</a>:</p>
+
+<ul>
+ <li>CTS 5.0 and later: Java 7
+ <li>CTS 4.4 and earlier: Java 6
+</ul>
+
+<h3 id=CTS_files>CTS files</h3>
+
+<p><a href="{@docRoot}compatibility/downloads.html">Download</a> and open the CTS
+packages matching your devices' Android version and all the Application Binary
+Interfaces (ABIs) your devices support.</p>
+
+<p>Download and open the latest version of the <a
+href="{@docRoot}compatibility/downloads.html#cts-media-files">CTS Media
+Files</a>.</p>
+
+<h3 id=system_detect>Device detection</h3>
+<p>Follow the step to <a
+href="http://developer.android.com/tools/device.html#setting-up">set up your
+system to detect your device</a>, such as creating a <code>udev</code> rules
+file for Ubuntu Linux.</p>
+
+<h2 id=device_setup>Android device setup</h2>
+
+<h3 id=user_builds>User builds</h3>
+
+<p>A compatible device is defined as a device with a user/release-key signed
+build, so your device should be running a system image based on the known to be
+compatible user build (Android 4.0 and later) from <a
+href="{@docRoot}source/build-numbers.html">Codenames, Tags, and Build
+Numbers</a>.<br>
+
+<p class="caution"><strong>Caution:</strong> When used to confirm Android
+compatibility of your final system image, CTS must be executed on devices with
+a user build.</p>
+
+<h3 id=storage_requirements>Storage requirements</h3>
+<p>The CTS media stress tests require video clips to be on external storage
+(<code>/sdcard</code>). Most of the clips are from <a
+href="https://peach.blender.org/">Big Buck Bunny</a> which is copyrighted by
+the Blender Foundation under the <a
+href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 license.</a></p>
+<p>The required space depends on the maximum video playback resolution supported
+ by the device (See section 5 in the compatibility definition document for the
+ platform version of the required resolutions.) Note that the video playback
+ capabilities of the device under test will be checked via the <code>android.media.CamcorderProfile</code> APIs for earlier versions of Android and the <code>android.media.MediaCodecInfo.CodecCapabilities</code> APIs from Android 5.0.</p>
+<p>Here are the storage requirements by maximum video playback resolution:</p>
+<ul>
+ <li>480x360: 98MB
+ <li>720x480: 193MB
+ <li>1280x720: 606MB
+ <li>1920x1080: 1863MB
+</ul>
+
+<h3 id=screen_storage>Screen and storage</h3>
+<ol>
+<li>Any device that does not have an embedded screen needs to be connected to a screen.</li>
+<li>If the device has a memory card slot, plug in an empty SD card. <em>Use an
+SD card that supports Ultra High Speed (UHS) Bus with SDHC or SDXC capacity or
+one with at least speed class 10 or higher to ensure it can pass the CTS.</em>
+<p class="warning"><strong>Warning:</strong> CTS may modify/erase data on the SD card plugged into the device.</p>
+</li>
+<li>If the device has SIM card slots, plug in an activated SIM card to each slot. If the device supports SMS, each SIM card should have its own number field populated.</li>
+</li>
+</ol>
+
+<h2 id=config_device>Android device configuration</h2>
+<ol>
+ <li>Factory data reset the device: <strong>Settings > Backup & reset > Factory data reset</strong>
+ <p class="warning"><strong>Warning:</strong> This will erase all user data from the device.</em></p>
+ <li>Set your device’s language to English (<strong>United States</strong>) from: <strong>Settings > Language
+ & input > Language</strong>
+ <li>Turn on the location setting if there is a GPS or Wi-Fi / Cellular network
+ feature on the device: <strong>Settings > Location</strong>
+ <li>Connect to a Wi-Fi network that supports IPv6, can treat the Device
+Under Test (DUT) as an <em>isolated client</em> (see note below), and has an
+internet connection: <strong>Settings > Wi-Fi</strong>
+<p class="note"><strong>Tip:</strong> If you don’t have access to a native
+IPv6 network, an IPv6 carrier network,
+or a VPN to pass some tests depending on IPv6, you may instead use a
+Wi-Fi
+ access point and an IPv6 tunnel. See Wikipedia <a href="http://en.wikipedia.org/wiki/List_of_IPv6_tunnel_brokers">list of IPv6 tunnel brokers</a>.</p>
+<p class="note"><strong>Note:</strong> An isolated client refers to a
+configuration where the DUT does not have visibility to the
+broadcast/multinetwork messages on that subnetwork, either by a Wi-Fi AP
+configuration or by running the DUT on an isolated sub-network without
+other devices being connected.</p>
+ <li>Make sure no lock pattern or password is set on the device: <strong>Settings > Security > Screen
+ lock = 'None'</strong>
+ <li>Enable <strong>USB debugging</strong> on your device: <strong>Settings > Developer options > USB debugging</strong>.
+ <p class="note"><strong>Note:</strong> On Android 4.2 and later, <strong>Developer
+ options</strong> is hidden by default. To make them available, go
+ to <strong>Settings > About phone</strong> and tap <strong>Build number</strong>
+ seven times. Return to the previous screen to find <strong>Developer
+ options</strong>. See <a
+ href="http://developer.android.com/tools/device.html#developer-device-options">Enabling
+ On-device Developer Options</a> for additional details.</p>
+ <li>Select: <strong>Settings > Developer options > Stay Awake</strong>
+ <li>Select: <strong>Settings > Developer options > Allow mock locations</strong>
+<p class="note"><strong>Note:</strong> Starting in Android 6.0, this mock
+locations step is neither available nor required.</p>
+ <li>Launch the browser and dismiss any startup/setup screen.
+ <li>Connect the desktop machine that will be used to test the device with a USB cable
+ <p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or later
+ to your computer, the system shows a dialog asking whether to accept an RSA key that allows
+ debugging through this computer. Select <em>Allow USB debugging</em>.</p>
+ <li> Install and configure helper apps on the device.
+<p class="note"><strong>Note:</strong> For CTS versions 2.1 R2 through 4.2 R4</em>, set up your device (or emulator)
+to run the accessibility tests with:<br>
+<code>adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk</code><br>
+On the device, enable: <strong>Settings > Accessibility > Accessibility >
+Delegating Accessibility Service</strong></p>
+<p class="note"><strong>Note:</strong> For CTS 2.3 R4 and beyond on devices that declare the
+<code>android.software.device_admin feature</code>, set up your device to run
+the device administration tests with:<br>
+<code>adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk</code><br>
+On the device, enable only the two
+<code>android.deviceadmin.cts.CtsDeviceAdminReceiver*</code> device
+administrators under: <strong>Settings > Security > Select device
+administrators</strong>. Make sure the
+<code>android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver</code> and any
+other preloaded device administrators stay disabled in the same menu.</p>
+<li>Copy the CTS media files to the device as follows:
+<p class="note"><strong>Note:</strong> For CTS 2.3 R12 and beyond, if the
+device supports video codecs, the CTS media files must be copied to the
+device.</p>
+<ul>
+ <li>Navigate (cd) to the path the media files are downloaded and unzipped to.
+ <li>Change the file permissions: <code>chmod u+x copy_media.sh</code>
+ <li>Run <code>copy_media.sh</code>:
+ <ul>
+ <li>To copy clips up to a resolution of 720x480, run: <code>./copy_media.sh 720x480</code>
+ <li>If you are not sure about the maximum resolution, try <code>./copy_media.sh all</code> so that all files are copied.
+ <li>If there are multiple devices under adb, add the -s (serial) option to the end.
+ For example, to copy up to 720x480 to the device with serial 1234567, run: <code>./copy_media.sh 720x480 -s 1234567</code>
+ </ul>
+</ul>
+</ol>
diff --git a/src/compatibility/cts/verifier.jd b/src/compatibility/cts/verifier.jd
new file mode 100644
index 0000000..128342d
--- /dev/null
+++ b/src/compatibility/cts/verifier.jd
@@ -0,0 +1,203 @@
+page.title=Using CTS Verifier
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>The Android Compatibility Test Suite Verifier (CTS Verifier) is a supplement to
+ the Compatibility Test Suite (CTS). While CTS checks those APIs and functions
+ that can be automated, CTS Verifier provides tests for those APIs and functions
+ that cannot be tested on a stationary device without manual input, like audio
+ quality, touchscreen, accelerometer, camera, etc.</p>
+<h2 id=test_preparation>Test preparation</h2>
+<p>The device must have verified Android API compatibility by successfully passing
+ the Compatibility Test Suite.</p>
+<h3 id=hardware_requirements>Hardware requirements</h3>
+<ul>
+ <li> A Linux computer with USB 2.0 compatible port
+ <li> A second Android device with a known compatible Bluetooth, Wi-Fi direct, and
+ NFC Host Card Emulation (HCE) implementation
+</ul>
+<h3 id=setup>Setup</h3>
+<ul>
+ <li>Install the <a href="http://developer.android.com/sdk/index.html">Android
+SDK</a> on the Linux computer <li>Download the appropriate <a
+href="{@docRoot}compatibility/downloads.html">CTS Verifier.apk</a> for the
+version of Android under test.
+ <li>Install CTS Verifier.apk to the <em>Device Under Test</em> (DUT). <br>
+ <code>adb install -r -g CtsVerifier.apk</code>
+ <li>Ensure that the device has its system data and time set correctly.
+</ul>
+<h2 id=cts_test_procedure>CTS Verifier test procedure</h2>
+<ol>
+ <li>After the CTS Verifier.apk has been installed, launch the CTS Verifier
+ application:
+
+<img src="images/cts-verifier-icon.png" alt="CTS Verifier icon in launcher" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> CTS Verifier icon
+</p>
+
+ <li>Once opened, the CTS Verifier displays a list of all test sets available for
+ manual verification:
+
+<img src="images/cts-verifier-menu.png" alt="CTS Verifier menu of tests" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> CTS Verifier menu of tests
+</p>
+
+ <li>Each test contains a set of common elements (in some tests, Pass/Fail is
+ determined automatically):
+ <ul>
+ <li><em>Info</em>—a set of instructions to run the test. This will appear as a popup the first
+ time each test is opened or whenever the <strong>Info</strong> button (?) is pressed.
+ <li><em>Pass</em>—If the DUT meets the test requirements per the instructions from Info, press
+ the <strong>Pass</strong> button (✓).
+ <li><em>Fail</em>—If the DUT does not meet the test requirements per the instructions from Info,
+ press the <strong>Fail</strong> button (!).
+ </ul>
+
+<img src="images/video-verifier.png" alt="Streaming video quality verifier" id="figure3" />
+<p class="img-caption">
+ <strong>Figure 3.</strong> Video quality verifier
+</p>
+
+</ol>
+
+<h2 id=specific_test_requirements>Specific test requirements</h2>
+<h3 id=usb_accessory>USB Accessory</h3>
+<p>In order to run the USB Accessory test, you need a Linux computer to run the
+ USB desktop machine (host) program.</p>
+<ol>
+ <li>Connect the DUT to a computer.
+ <li>Execute the cts-usb-accessory program on the computer found in the CTS Verifier
+ package.
+ <li>A popup message will appear on the DUT. Select <strong>OK</strong> and go into the USB Accessory Test in the CTS Verifier application.
+<br>
+<img src="images/screen-lock-test.png" alt="CTS Verifier screen lock test" id="figure4" />
+<p class="img-caption">
+ <strong>Figure 4.</strong> Screen lock test
+</p>
+
+ <li>Output similar to below will appear on the computer’s console.
+</ol>
+<pre>
+out/host/linux-x86/cts-verifier/android-cts-verifier$ <strong>./cts-usb-accessory</strong>
+CTS USB Accessory Tester
+Found possible Android device (413c:2106) - attempting to switch to accessory
+mode...
+Failed to read protocol version
+Found Android device in accessory mode (18d1:2d01)...
+[RECV] Message from Android device #0
+[SENT] Message from Android accessory #0
+[RECV] Message from Android device #1
+[SENT] Message from Android accessory #1
+[RECV] Message from Android device #2
+[SENT] Message from Android accessory #2
+[RECV] Message from Android device #3
+[SENT] Message from Android accessory #3
+[RECV] Message from Android device #4
+[SENT] Message from Android accessory #4
+[RECV] Message from Android device #5
+[SENT] Message from Android accessory #5
+[RECV] Message from Android device #6
+[SENT] Message from Android accessory #6
+[RECV] Message from Android device #7
+[SENT] Message from Android accessory #7
+[RECV] Message from Android device #8
+[SENT] Message from Android accessory #8
+[RECV] Message from Android device #9
+[SENT] Message from Android accessory #9
+[RECV] Message from Android device #10
+[SENT] Message from Android accessory #10
+</pre>
+<h3 id=camera_field_of_view_calibration>Camera field of view calibration</h3>
+<p>This field of view calibration procedure is designed to be a quick way to
+ determine the device field of view with moderate accuracy.
+<p><strong>Setup</strong> - Print the <a
+href="{@docRoot}compatibility/calibration-pattern.pdf">calibration-pattern.pdf</a>
+target file and mount it on a rigid backing. Print on 11” x 17” or A3. Orient
+the camera device and the printed target as shown in the diagram below:</p>
+
+<img src="images/camera-printed-target.png" alt="Camera printed target" id="figure5" />
+<p class="img-caption">
+ <strong>Figure 5.</strong> Camera printed target
+</p>
+
+<p><strong>Setting the target width</strong> - Measure the distance between the
+solid lines on the target pattern in centimeters to account for printing
+inaccuracies (~38 cm).</p>
+<ol>
+ <li>Start the calibration application.
+ <li>Press the setup button and select “Marker distance” to enter the distance.
+ <li>Measure and enter the distance to the target pattern (~100 cm).
+ <li>Press the back button to return to the calibration preview.
+</ol>
+<p><strong>Calibration process</strong> - Verify that the device and target are
+placed as shown in the figure and the correct distances have been entered into
+the setup dialog.The preview will display the image with a vertical line
+overlaid onto it. This line should align with the center line of the target
+pattern. The transparent grid can be used with the other vertical lines to
+ensure that the optical axis is orthogonal to the target.</p>
+<ol>
+ <li>Select an image resolution to test from the selector at the bottom left.
+ <li>Tap the screen to take a photo and enter the calibration mode (described
+ below).
+ <li>Hit the back button and repeat for all supported image resolutions.
+</ol>
+<p><strong>Calibration test (per resolution)</strong> In the calibration mode, the photo will be displayed with two vertical lines
+ overlaid onto the image.These lines should align with the vertical lines on the target pattern within a
+ few pixels. If they do not, then the reported field of view for that mode is
+ inaccurate (assuming the setup is correct).Adjust the slider at the bottom of the screen until the overlay aligns with the
+ target pattern as closely as possible. The displayed field of view will be a
+ close approximation to the correct value when the overlay and the target
+ pattern image are aligned. The reported field of view should be within +/-1
+ degree of the calibration value.</p>
+<h2 id=exporting_test_reports>Exporting test reports</h2>
+<ol>
+ <li>After all tests are completed, tap the <strong>Save (disk)</strong> icon.
+<br>
+<img src="images/verifier-save-icon.png" alt="CTS Verifier Save icon" id="figure6" />
+<p class="img-caption">
+ <strong>Figure 6.</strong> CTS Verifier Save icon
+</p>
+
+ <li>A path to the saved report will be displayed in pop-up (e.g.
+<code>/mnt/sdcard/ctsVerifierReports/ctsVerifierReport-date-time.zip</code>).
+Record the path.
+<br>
+<img src="images/path-saved-report.png" alt="CTS Verifier path to saved report " id="figure7" />
+<p class="img-caption">
+ <strong>Figure 7.</strong> CTS Verifier path to saved report
+</p>
+
+ <li>Connect the device via USB to a computer with the SDK installed.
+ <li>From the computer’s SDK installation, run <code>adb pull
+ <CTS Verifier report path>
+ </code> to download the report from the device.
+ <ul>
+ <li>To download all reports run : <code>adb pull /mnt/sdcard/ctsVerifierReports/ .</code>
+ <li>The name of the reports are time-stamped based on the DUT’s system time.
+ <li>To clear results after they have been selected, select <strong>Menu > Clear</strong>. This will
+ clear the Pass/Fail results.
+</ol>
diff --git a/src/compatibility/downloads.jd b/src/compatibility/downloads.jd
index 0d729f2..e88a6ce 100644
--- a/src/compatibility/downloads.jd
+++ b/src/compatibility/downloads.jd
@@ -27,51 +27,91 @@
<p>Thank you for your interest in Android Compatibility! The links below give
you access to key documents and information about the program.</p>
+<h2 id="android-60">Android 6.0</h2>
+<p>Android 6.0 is the release of the development milestone code-named Marshmallow.
+The source code for the following tests can be synced with the
+'android-cts-6.0_r1' tag in the open-source tree.</p>
+<ul>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-6.0_r1-linux_x86-arm.zip">Android
+6.0 R1 Compatibility Test Suite (CTS) - ARM</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-6.0_r1-linux_x86-x86.zip">Android
+6.0 R1 Compatibility Test Suite (CTS) - x86</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-6.0_r1-linux_x86-arm.zip">Android
+6.0 R1 CTS Verifier - ARM</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-6.0_r1-linux_x86-x86.zip">Android
+6.0 R1 CTS Verifier - x86</a></li>
+</ul>
+
+<h2 id="android-51">Android 5.1</h2>
+<p>Android 5.1 is the release of the development milestone code-named Lollipop-MR1.
+The source code for the following tests can be synced with the
+'android-cts-5.1_r3' tag in the open source tree.</p>
+<ul>
+<li><a href="5.1/android-5.1-cdd.pdf">Android 5.1 Compatibility Definition
+Document (CDD)</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-5.1_r3-linux_x86-arm.zip">Android
+5.1 R3 Compatibility Test Suite (CTS) - ARM</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-5.1_r3-linux_x86-x86.zip">Android
+5.1 R3 Compatibility Test Suite (CTS) - x86</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r3-linux_x86-arm.zip">Android
+5.1 R3 CTS Verifier - ARM</a></li>
+<li><a
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r3-linux_x86-x86.zip">Android
+5.1 R3 CTS Verifier - x86</a></li>
+</ul>
+
<h2 id="android-50">Android 5.0</h2>
<p>Android 5.0 is the release of the development milestone code-named Lollipop.
The source code for the following tests can be synced with the
-'android-cts-5.0_r2' tag in the open-source tree.</p>
+'android-cts-5.0_r3' tag in the open source tree.</p>
<ul>
<li><a href="5.0/android-5.0-cdd.pdf">Android 5.0 Compatibility Definition
Document (CDD)</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.0_r2-linux_x86-arm.zip">Android
-5.0 R2 Compatibility Test Suite (CTS) - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.0_r3-linux_x86-arm.zip">Android
+5.0 R3 Compatibility Test Suite (CTS) - ARM</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.0_r2-linux_x86-x86.zip">Android
-5.0 R2 Compatibility Test Suite (CTS) - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.0_r3-linux_x86-x86.zip">Android
+5.0 R3 Compatibility Test Suite (CTS) - x86</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r2-linux_x86-arm.zip">Android
-5.0 R2 CTS Verifier - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r3-linux_x86-arm.zip">Android
+5.0 R3 CTS Verifier - ARM</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r2-linux_x86-x86.zip">Android
-5.0 R2 CTS Verifier - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r3-linux_x86-x86.zip">Android
+5.0 R3 CTS Verifier - x86</a></li>
</ul>
<h2 id="android-44">Android 4.4</h2>
<p>Android 4.4 is the release of the development milestone code-named
KitKat. Source code for Android 4.4 is found in the
-'android-4.4.4_r1' branch in the open-source tree.</p>
+'android-cts-4.4_r4' branch in the open source tree.</p>
<ul>
<li><a href="4.4/android-4.4-cdd.pdf">Android 4.4 Compatibility Definition
Document (CDD)</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-4.4_r3-linux_x86-arm.zip">Android
-4.4 R3 Compatibility Test Suite (CTS) - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-4.4_r4-linux_x86-arm.zip">Android
+4.4 R4 Compatibility Test Suite (CTS) - ARM</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-4.4_r3-linux_x86-x86.zip">Android
-4.4 R3 Compatibility Test Suite (CTS) - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-4.4_r4-linux_x86-x86.zip">Android
+4.4 R4 Compatibility Test Suite (CTS) - x86</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-4.4_r3-linux_x86-arm.zip">Android
-4.4 R3 CTS Verifier - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-4.4_r4-linux_x86-arm.zip">Android
+4.4 R4 CTS Verifier - ARM</a></li>
<li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-4.4_r3-linux_x86-x86.zip">Android
-4.4 R3 CTS Verifier - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-4.4_r4-linux_x86-x86.zip">Android
+4.4 R4 CTS Verifier - x86</a></li>
</ul>
<h2 id="android-43">Android 4.3</h2>
<p>Android 4.3 is the release of the development milestone code-named
-Jelly Bean-MR2. Source code for Android 4.3 is found in the 'android-4.3_r2.2-cts' branch in the open-source tree.</p>
+Jelly Bean-MR2. Source code for Android 4.3 is found in the 'android-4.3_r2.2-cts' branch in the open source tree.</p>
<ul>
<li><a href="4.3/android-4.3-cdd.pdf">Android 4.3 Compatibility Definition Document (CDD)</a></li>
<li><a
@@ -84,7 +124,7 @@
<h2 id="android-42">Android 4.2</h2>
<p>Android 4.2 is the release of the development milestone code-named
-Jelly Bean-MR1. Source code for Android 4.2 is found in the 'android-4.2.2_r1' branch in the open-source tree.</p>
+Jelly Bean-MR1. Source code for Android 4.2 is found in the 'android-4.2.2_r1' branch in the open source tree.</p>
<ul>
<li><a href="4.2/android-4.2-cdd.pdf">Android 4.2 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-4.2_r4-linux_x86-arm.zip">Android 4.2 R4 Compatibility Test Suite (CTS)</a></li>
@@ -93,7 +133,7 @@
<h2 id="android-41">Android 4.1</h2>
<p>Android 4.1 is the release of the development milestone code-named Jelly
Bean. The source code of the Compatibility Test Suite revisions below is
-available at the 'android-cts-4.1_r4' tag in the open-source tree.</p>
+available at the 'android-cts-4.1_r4' tag in the open source tree.</p>
<ul>
<li><a href="4.1/android-4.1-cdd.pdf">Android 4.1 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-4.1_r4-linux_x86-arm.zip">Android 4.1 R4 Compatibility Test Suite (CTS)</a></li>
@@ -101,8 +141,8 @@
</ul>
<h2 id="android-403">Android 4.0.3</h2>
<p>Android 4.0.3 is the release of the development milestone code-named
-Ice Cream Sandwich. Android 4.0.3 is the current version of Android. Source code for
-Android 4.0.3 is found in the 'android-4.0.3_r1' branch in the open-source tree.</p>
+Ice Cream Sandwich. Source code for
+Android 4.0.3 is found in the 'android-4.0.3_r1' branch in the open source tree.</p>
<ul>
<li><a href="4.0/android-4.0-cdd.pdf">Android 4.0 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-4.0.3_r3-linux_x86-arm.zip">Android 4.0.3 R3 Compatibility Test Suite (CTS)</a></li>
@@ -111,7 +151,7 @@
<h2 id="android-23">Android 2.3</h2>
<p>Android 2.3 is the release of the development milestone code-named
Gingerbread. Source code for Android 2.3 is found in the 'gingerbread' branch in
-the open-source tree.</p>
+the open source tree.</p>
<ul>
<li><a href="2.3/android-2.3.3-cdd.pdf">Android 2.3 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-2.3_r13-linux_x86-arm.zip">Android 2.3 R13 Compatibility Test Suite (CTS)</a></li>
@@ -120,7 +160,7 @@
<h2 id="android-22">Android 2.2</h2>
<p>Android 2.2 is the release of the development milestone code-named
FroYo. Source code for Android 2.2 is found in the 'froyo' branch in the
-open-source tree.</p>
+open source tree.</p>
<ul>
<li><a href="2.2/android-2.2-cdd.pdf">Android 2.2 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-2.2_r8-linux_x86-arm.zip">Android 2.2 R8 Compatibility Test Suite (CTS)</a></li>
@@ -128,7 +168,7 @@
<h2 id="android-21">Android 2.1</h2>
<p>Android 2.1 is the release of the development milestone code-named
Eclair. Source code for Android 2.1 is found in the 'eclair' branch in the
-open-source tree. Note that for technical reasons, there is no compatibility
+open source tree. Note that for technical reasons, there is no compatibility
program for Android 2.0 or 2.0.1, and new devices must use Android 2.1.</p>
<ul>
<li><a href="2.1/android-2.1-cdd.pdf">Android 2.1 Compatibility Definition Document (CDD)</a></li>
@@ -137,16 +177,14 @@
<h2 id="android-16">Android 1.6</h2>
<p>Android 1.6 was the release of the development milestone code-named Donut.
Android 1.6 was obsoleted by Android 2.1. Source code for Android 1.6 is found
-in the 'donut' branch in the open-source tree.</p>
+in the 'donut' branch in the open source tree.</p>
<ul>
<li><a href="1.6/android-1.6-cdd.pdf">Android 1.6 Compatibility Definition Document (CDD)</a></li>
<li><a href="https://dl.google.com/dl/android/cts/android-cts-1.6_r1-x86.zip">Android 1.6 R1 Compatibility Test Suite (CTS)</a></li>
</ul>
<h2 id="compatibility-test-suite-manual">Compatibility Test Suite Manual</h2>
-<p>The CTS user manual is applicable to any CTS version, but CTS 2.1 R2 and
-beyond require <a href="cts-intro.html">additional steps</a> to run the accessibility tests.</p>
<ul>
-<li><a href="android-cts-manual.pdf">Compatibility Test Suite (CTS) User Manual</a></li>
+<li><a href="cts/index.html">Compatibility Test Suite (CTS) User Manual</a></li>
</ul>
<h2 id="cts-media-files">CTS Media Files</h2>
<p>These media files are required for the CTS media stress tests.</p>
diff --git a/src/compatibility/images/compat-ecosystem.png b/src/compatibility/images/compat-ecosystem.png
new file mode 100644
index 0000000..4b166d1
--- /dev/null
+++ b/src/compatibility/images/compat-ecosystem.png
Binary files differ
diff --git a/src/compatibility/index.jd b/src/compatibility/index.jd
index b3c375a..d3911a3 100644
--- a/src/compatibility/index.jd
+++ b/src/compatibility/index.jd
@@ -2,77 +2,94 @@
@jd:body
<!--
- Copyright 2015 The Android Open Source Project
+ Copyright 2015 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
+ 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.
+ 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.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
-<p>Android's purpose is to establish an open platform for developers to build innovative apps.
-The Android Compatibility program defines the technical details of the Android platform and provides
-tools used by OEMs to ensure that developers' apps run on a variety of devices. The Android SDK
-provides built-in tools that developers use to clearly state the device features their apps
-require. And Google Play shows apps only to those devices that can properly run them.
-</p>
+<p>Android's purpose is to establish an open platform for developers to build
+innovative apps.</p>
+<ul>
+<li>The Android Compatibility program defines technical details of the
+Android platform and provides tools for OEMs to ensure developer applications
+run on a variety of devices.</li>
+<li>The Android SDK provides built-in tools for developers to clearly state the
+device features required by their applications.
+<li>Google Play shows applications only to those devices that can properly run
+those applications.</li></li>
-<h2 id="why-build-compatible-android-devices">Why build compatible Android devices?</h2>
-<h3 id="users-want-a-customizable-device">Users want a customizable device.</h3>
+<h2 id="why-build-compatible-android-devices">Why build compatible Android
+devices?</h2>
+
+<h3 id="users-want-a-customizable-device">Users want customizable devices</h3>
+
+<div class="figure">
+ <img src="images/compat-ecosystem.png" alt="Compatibility ecosystem" id="figure1" />
+ <p class="img-caption">
+ <strong>Figure 1.</strong> The Android ecosystem thrives with device compatibility
+ </p>
+</div>
+
<p>A mobile phone is a highly personal, always-on, always-present gateway to
the Internet. We haven't met a user yet who didn't want to customize it by
extending its functionality. That's why Android was designed as a robust
platform for running aftermarket applications.</p>
-<h3 id="developers-outnumber-us-all">Developers outnumber us all.</h3>
-<p>No device manufacturer can hope to write all the software that a person could
-conceivably need. We need third-party developers to write the apps users want;
-so the Android Open Source Project aims to make it as easy and open as
-possible for developers to build apps.</p>
-<h3 id="everyone-needs-a-common-ecosystem">Everyone needs a common ecosystem.</h3>
-<p>Every line of code developers write to work around a particular phone's bug
-is a line of code that didn't add a new feature. The more compatible phones
-there are, the more apps there will be. By building a fully compatible Android
-device, you benefit from the huge pool of apps written for Android, while
-increasing the incentive for developers to build more of those apps.</p>
-<h2 id="android-compatibility-is-free-and-its-easy">Android compatibility is free, and it's easy.</h2>
-<p>If you are building a mobile device, you can follow these steps to make
-sure your device is compatible with Android. For more details about the
-Android compatibility program in general, see <a href="overview.html">the program overview</a>.</p>
-<p>Building a compatible device is a three-step process:</p>
+
+<h3 id="developers-outnumber-us-all">Developers outnumber us all</h3>
+<p>No device manufacturer can write all the software a user could conceivably
+need. We need third-party developers to write the apps users want, so the
+Android Open Source Project (AOSP) aims to make application development as easy
+and open as possible.</p>
+
+<h3 id="everyone-needs-a-common-ecosystem">Everyone needs a common ecosystem</h3>
+<p>Every line of code developers write to work around a bug is a line of code
+that didn't add a new feature. The more compatible mobile devices are, the more
+applications we'll have to run on those devices. By building a fully compatible
+Android device, you benefit from the huge pool of apps written for Android while
+increasing the incentive for developers to build more apps.</p>
+
+<h2 id="android-compatibility-is-free-and-its-easy">Android compatibility is
+free, and it's easy</h2>
+<p>To build an Android-compatible mobile device, follow this three-step
+process:</p>
<ol>
-<li>
-<p><em>Obtain the <a href="{@docRoot}source/index.html">Android software source
-code</a></em>.
- This is the source code for the Android platform that you port to your hardware.</p>
-</li>
-<li>
-<p><em>Comply with the <a href="{@docRoot}compatibility/android-cdd.pdf">Android
-Compatibility Definition Document (CDD)</a></em>.
- The CDD enumerates the software and hardware requirements of a compatible Android device.</p>
-</li>
-<li>
-<p><em>Pass the <a href="{@docRoot}compatibility/cts-intro.html">Compatibility
-Test Suite (CTS)</a></em>.
- Use the CTS as an ongoing aid to compatibility during the development process.</p>
-</li>
+<li><em>Obtain the <a href="{@docRoot}source/index.html">Android software source
+code</a></em>. This is the source code for the Android platform that you port
+to your hardware.</li>
+<li><em>Comply with the <a href="{@docRoot}compatibility/android-cdd.pdf">Android
+Compatibility Definition Document (CDD)</a></em>. The CDD enumerates the
+software and hardware requirements of a compatible Android device.</li>
+<li><em>Pass the <a href="{@docRoot}compatibility/cts-intro.html">Compatibility
+Test Suite (CTS)</a></em>. Use the CTS as an ongoing aid to evaluate
+compatibility during the development process.</li>
</ol>
-<p>After complying with the CDD and passing the CTS, your device is now Android
-compatible. Android apps in the ecosystem will have a consistent experience on
-your device.</p>
+<p>After complying with the CDD and passing the CTS, your device is Android
+compatible, meaning Android apps in the ecosystem provide a consistent
+experience when running on your device. For details about the Android
+compatibility program, see the <a href="overview.html">program overview</a>.</p>
-<h2 id="licensing-gms">Licensing Google Mobile Services</h2>
-<p>If you've built an Android compatible device, you may wish to inquire about
-licensing Google’s proprietary suite of apps that run on top of Android -
-Google Mobile Services (GMS, which include Google Play, YouTube, Google Maps,
-Gmail, and more). Google Mobile Services is not part of the Android Open Source
-Project and is available only through a license with Google. Please visit the
-‘contact’ us section for more information on how to inquire about a GMS
-license.</p>
+<h2 id="licensing-gms">Licensing Google Mobile Services (GMS)</h2>
+<p>After building an Android compatible device, consider licensing Google Mobile
+Services (GMS), Google’s proprietary suite of apps (Google Play, YouTube, Google
+Maps, Gmail, and more ) that run on top of Android. GMS is not part of the
+Android Open Source Project and is available only through a license with Google.
+For information on how to request a GMS license, see
+<a href="contact-us.html">Contact Us</a>.</p>
diff --git a/src/compatibility/overview.jd b/src/compatibility/overview.jd
index ac0fb9f..0a1bfca 100644
--- a/src/compatibility/overview.jd
+++ b/src/compatibility/overview.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,10 +16,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
<p>The Android compatibility program makes it easy for mobile device
manufacturers to develop compatible Android devices.</p>
-<h1 id="program-goals">Program goals</h1>
+<h2 id="program-goals">Program goals</h2>
<p>The Android compatibility program works for the benefit of the entire
Android community, including users, developers, and device manufacturers.</p>
<p>Each group depends on the others. Users want a wide selection of devices
@@ -79,7 +86,7 @@
the source code tree, there is a separate CTS and CDD for each version as
well. The CDD, CTS, and source code are -- along with your hardware and your
software customizations -- everything you need to create a compatible device.</p>
-<h1 id="compatibility-definition-document-cdd">Compatibility Definition Document</h1>
+<h2 id="compatibility-definition-document-cdd">Compatibility Definition Document</h2>
<p>For each release of the Android platform, a detailed CDD will be provided. The CDD represents the "policy"
aspect of Android compatibility.</p>
<p>No test suite, including CTS, can truly be comprehensive. For instance, the
@@ -99,9 +106,9 @@
start by checking out the source code for that version, and then read the
corresponding CDD and stay within its guidelines. For additional details,
simply examine <a href="/compatibility/android-cdd.pdf">the latest CDD</a>.</p>
-<h1 id="compatibility-test-suite-cts">Compatibility Test Suite</h1>
-<p>The CTS is a free, commercial-grade test suite, available for
-<a href="downloads.html">download</a>.
+<h2 id="compatibility-test-suite-cts">Compatibility Test Suite</h2>
+<p>The <a href="cts/index.html">CTS</a> is a free, commercial-grade test suite,
+available for <a href="downloads.html">download</a>.
The CTS represents the "mechanism" of compatibility.</p>
<p>The CTS runs on a desktop machine and executes test cases directly on
attached devices or an emulator. The CTS is a set of unit tests designed to be
@@ -109,11 +116,11 @@
the engineers building a device. Its intent is to reveal incompatibilities
early on, and ensure that the software remains compatible throughout the
development process.</p>
-<h1 id="compatibility-test-suite-verifier-cts-verifier">Compatibility Test Suite Verifier (CTS Verifier)</h1>
+<h2 id="compatibility-test-suite-verifier-cts-verifier">Compatibility Test Suite Verifier (CTS Verifier)</h2>
<p>The Compatibility Test Suite Verifier (CTS Verifier) is a supplement to the
CTS available for <a href="downloads.html">download</a>.
CTS Verifier provides tests for APIs and functions that cannot be tested on a
stationary device without manual input (e.g. audio quality, accelerometer, etc).</p>
-<p>For details on the CTS, consult the <a href="cts-intro.html">CTS introduction</a>.</p>
+<p>For details on the CTS, consult the <a href="cts/index.html">CTS introduction</a>.</p>
diff --git a/src/compatibility/source/android-cdd-footer.html b/src/compatibility/source/android-cdd-footer.html
index dfb0f51..fce6481 100644
--- a/src/compatibility/source/android-cdd-footer.html
+++ b/src/compatibility/source/android-cdd-footer.html
@@ -24,7 +24,7 @@
<table class="noborder" style="border-top: 1px solid silver; width: 100%">
<tr>
- <td class="noborder"><img src="images/android-logo.png" alt="Android logo"/></td>
+ <td class="noborder"><img src="../images/android-logo.png" alt="Android logo"/></td>
<td class="noborder" style="text-align:right">
Page <span class="page"></span> of <span class="topage"></span>
</td>
@@ -34,4 +34,4 @@
</div>
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/src/devices/audio/avoiding_pi.jd b/src/devices/audio/avoiding_pi.jd
index 2e0a07a..022c766 100644
--- a/src/devices/audio/avoiding_pi.jd
+++ b/src/devices/audio/avoiding_pi.jd
@@ -78,6 +78,13 @@
</p>
<p>
+A common workaround for priority inversion is to increase audio buffer sizes.
+However, this method increases latency and merely hides the problem
+instead of solving it. It is better to understand and prevent priority
+inversion, as seen below.
+</p>
+
+<p>
In the Android audio implementation, priority inversion is most
likely to occur in these places. And so you should focus your attention here:
</p>
diff --git a/src/devices/audio/debugging.jd b/src/devices/audio/debugging.jd
index 78ca801..cc4a9c5 100644
--- a/src/devices/audio/debugging.jd
+++ b/src/devices/audio/debugging.jd
@@ -50,7 +50,7 @@
and may require changes for other versions.
</p>
-<h3>Compile-time setup</h3>
+<h3 id="compile">Compile-time setup</h3>
<ol>
<li><code>cd frameworks/av/services/audioflinger</code></li>
@@ -62,7 +62,7 @@
<li>Push or sync the new <code>libaudioflinger.so</code> to the device's <code>/system/lib</code>.</li>
</ol>
-<h3>Run-time setup</h3>
+<h3 id="runtime">Run-time setup</h3>
<ol>
<li><code>adb shell getprop | grep ro.debuggable</code>
@@ -112,7 +112,7 @@
but you can get similar results using "4."
</p>
-<h3>Test and acquire data</h3>
+<h3 id="test">Test and acquire data</h3>
<ol>
<li>Run your audio test.</li>
@@ -148,7 +148,7 @@
older dumps are removed after that limit is reached.</li>
</ul>
-<h3>Restore</h3>
+<h3 id="restore">Restore</h3>
<p>
As noted above, the tee sink feature should not be left enabled.
@@ -168,7 +168,7 @@
<h2 id="mediaLog">media.log</h2>
-<h3>ALOGx macros</h3>
+<h3 id="alogx">ALOGx macros</h3>
<p>
The standard Java language logging API in Android SDK is
@@ -202,7 +202,7 @@
<ul>
<li>
-They are suspectible to "log spam": the log buffer is a shared resource
+They are susceptible to "log spam": the log buffer is a shared resource
so it can easily overflow due to unrelated log entries, resulting in
missed information. The <code>ALOGV</code> variant is disabled at
compile-time by default. But of course even it can result in log spam
@@ -222,7 +222,7 @@
</li>
</ul>
-<h3>NBLOG, media.log, and MediaLogService</h3>
+<h3 id="nblog">NBLOG, media.log, and MediaLogService</h3>
<p>
The <code>NBLOG</code> APIs and associated <code>media.log</code>
@@ -240,7 +240,7 @@
By convention, each thread should use it's own timeline.
</p>
-<h3>Benefits</h3>
+<h3 id="benefits">Benefits</h3>
<p>
The benefits of the <code>media.log</code> system are that it:
@@ -254,7 +254,7 @@
</li>
</ul>
-<h3>Architecture</h3>
+<h3 id="architecture">Architecture</h3>
<p>
The diagram below shows the relationship of the <code>mediaserver</code> process
@@ -329,7 +329,7 @@
<code>FastMixer</code> and <code>FastCapture</code> threads.
</p>
-<h3>How to use</h3>
+<h3 id="how">How to use</h3>
<h4>Add logs</h4>
diff --git a/src/devices/audio/images/round_trip_bar_graph.png b/src/devices/audio/images/round_trip_bar_graph.png
index 0476574..87ec89f 100644
--- a/src/devices/audio/images/round_trip_bar_graph.png
+++ b/src/devices/audio/images/round_trip_bar_graph.png
Binary files differ
diff --git a/src/devices/audio/images/venn.png b/src/devices/audio/images/venn.png
new file mode 100644
index 0000000..1db4f53
--- /dev/null
+++ b/src/devices/audio/images/venn.png
Binary files differ
diff --git a/src/devices/audio/implement.jd b/src/devices/audio/implement.jd
index 82cb111..2ab82b0 100644
--- a/src/devices/audio/implement.jd
+++ b/src/devices/audio/implement.jd
@@ -1,4 +1,4 @@
-page.title=Audio
+page.title=Audio Implementation
@jd:body
<!--
diff --git a/src/devices/audio/index.jd b/src/devices/audio/index.jd
index bfa616d..82a3886 100644
--- a/src/devices/audio/index.jd
+++ b/src/devices/audio/index.jd
@@ -17,14 +17,6 @@
limitations under the License.
-->
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
<img style="float: right; margin: 0px 15px 15px 15px;"
src="images/ape_fwk_hal_audio.png" alt="Android Audio HAL icon"/>
@@ -127,4 +119,4 @@
<a href="http://developer.android.com/reference/android/media/package-summary.html">android.media</a>.
</dd>
-</dl>
\ No newline at end of file
+</dl>
diff --git a/src/devices/audio/latency.jd b/src/devices/audio/latency.jd
index 59c3f73..a45bf20 100644
--- a/src/devices/audio/latency.jd
+++ b/src/devices/audio/latency.jd
@@ -50,4 +50,8 @@
<td>Round-trip audio latency results</td>
<td><a href="latency_measurements.html">Audio Latency Measurements</a></td>
</tr>
+<tr>
+ <td>Applications</td>
+ <td><a href="latency_app.html">Audio Latency for App Developers</a></td>
+</tr>
</table>
diff --git a/src/devices/audio/latency_app.jd b/src/devices/audio/latency_app.jd
new file mode 100644
index 0000000..5672147
--- /dev/null
+++ b/src/devices/audio/latency_app.jd
@@ -0,0 +1,180 @@
+page.title=Audio Latency for App Developers
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>For the lowest audio latency possible, we recommend you use Android native audio
+based on OpenSL ES 1.0.1.</p>
+
+<h2 id=implementation>Implementation checklist</h2>
+
+<p>To use Android native audio:</p>
+
+<ol>
+
+<li>
+Download and install the
+<a href="https://developer.android.com/tools/sdk/ndk/index.html">Android NDK</a>.
+In the rest of this document, we'll assume <code>NDKroot</code> is the
+directory where you installed NDK.
+</li>
+
+<li>
+Read the <a href="#supporting">supporting documentation.</a>
+</li>
+
+<li>
+Check for API level 9 or higher.
+</li>
+
+<li>
+Check for feature
+<a href="http://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features">android.hardware.audio.low_latency.</a>
+</li>
+
+<li>
+Use the recommended native buffer size and sample rate returned by
+<a href="http://developer.android.com/reference/android/media/AudioManager.html#getProperty(java.lang.String)">android.media.AudioManager.getProperty(java.lang.String)</a>
+<p> <strong>Note</strong>: the same buffer size and sample rate should also be used for input.</p>
+</li>
+
+<li>
+Usually an OpenSL ES buffer count of 1 is sufficient.
+</li>
+
+<li>
+Keep your callback handlers short, without bursty CPU usage or unbounded blocking. Avoid
+<a href="avoiding_pi.html">priority inversion.</a>
+</li>
+
+<li>
+Consider using
+<a href="avoiding_pi.html#nonBlockingAlgorithms">non-blocking algorithms</a>
+to communicate between input and output callback handlers,
+and between the callback handlers and the rest of your application.
+</li>
+
+</ol>
+
+<h2 id=supporting>Supporting documentation</h2>
+
+<h3 id=opensl_es_1_0_1>OpenSL ES 1.0.1</h3>
+
+<p>
+Use a PDF viewer to review the
+<a href="https://www.khronos.org/registry/sles/specs/OpenSL_ES_Specification_1.0.1.pdf">OpenSL 1.0.1 Specification.</a>
+This is a rather long reference, and not all of it will be relevant to you; but you
+will need to consult it for details on the API.
+</p>
+
+<p class="note">
+<strong>Note</strong>: this document describes the full OpenSL ES 1.0.1, but Android
+native audio is actually based on a subset of OpenSL ES 1.0.1 with some Android-specific extensions.
+</p>
+
+<p>
+Documents describing later versions of OpenSL ES, such as 1.1,
+are not relevant to Android.
+</p>
+
+<h3 id=opensl_es_for_android>OpenSL ES for Android</h3>
+
+<p>
+The document "OpenSL ES for Android" is provided in the NDK installation,
+and is not currently available online. Open this link in a browser:
+</p>
+
+<pre>
+NDKroot/docs/Additional_library_docs/opensles/index.html
+</pre>
+
+<p>
+You’ll want to skim the whole
+document, but pay special attention to the "Performance" subsection of the
+"Programming notes" section.
+</p>
+
+<p>
+Section "Supported features from OpenSL ES 1.0.1"
+describes the subset supported by Android.
+</p>
+
+<p>
+Section "Android extensions" describes Android-specific extensions
+that aren't included in base OpenSL ES 1.0.1.
+</p>
+
+<h3 id=relationship>Relationship with OpenSL ES 1.0.1</h3>
+
+<p>
+This Venn diagram shows the relationship between
+Android native audio and OpenSL ES 1.0.1.
+</p>
+
+<img src="images/venn.png" alt="Venn diagram" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Venn diagram
+</p>
+
+<h2 id=resources>Other resources</h2>
+
+<h3 id=source_android_com>source.android.com</h3>
+
+<p>
+The site <a href="{@docRoot}">source.android.com</a>
+is primarily designed for OEMs building Android
+devices, and the SoC vendors who supply components to these OEMs.
+</p>
+
+<p>
+However, there is a wealth of useful information about latency at this site, so
+you may want to review it. See the articles at
+<a href="latency.html">Audio Latency.</a>
+</p>
+
+<h3 id=android_ndk>android-ndk</h3>
+
+<p>
+If you have questions about how to use Android native audio, you can ask at the discussion group
+<a href="https://groups.google.com/forum/#!forum/android-ndk">android-ndk.</a>
+</p>
+
+<h3 id=videos>Videos</h3>
+
+<dl>
+
+<dt><a href="https://youtu.be/d3kfEeMZ65c">High performance audio on Android</a>
+(Google I/O 2013)</dt>
+<dd>The whole video is about latency.</dd>
+
+<dt><a href="https://youtu.be/92fgcUNCHic">Building great multi-media experiences on Android</a>
+(Google I/O 2014)</dt>
+<dd>The first 14 minutes are about audio in general and input latency in particular.</dd>
+
+<dt><a href="https://youtu.be/PnDK17zP9BI">Audio latency: buffer sizes</a>
+(100 Days of Google Dev)</dt>
+<dd>Describes the relationship between audio latency, buffer sizes, and task scheduling.</dd>
+
+</dl>
diff --git a/src/devices/audio/latency_contrib.jd b/src/devices/audio/latency_contrib.jd
index fb7cd71..2969ba2 100644
--- a/src/devices/audio/latency_contrib.jd
+++ b/src/devices/audio/latency_contrib.jd
@@ -49,6 +49,9 @@
system designer then increases buffer sizes or buffer counts.
This has the desired result of eliminating the underruns or overruns, but it also
has the undesired side effect of increasing latency.
+ For more information about buffer sizes, see the video
+ <a href="https://youtu.be/PnDK17zP9BI">Audio latency: buffer sizes</a>.
+
</p>
<p>
@@ -64,6 +67,7 @@
<ul>
<li>Linux CFS (Completely Fair Scheduler)</li>
<li>high-priority threads with SCHED_FIFO scheduling</li>
+ <li>priority inversion</li>
<li>long scheduling latency</li>
<li>long-running interrupt handlers</li>
<li>long interrupt disable time</li>
@@ -123,6 +127,18 @@
with the scheduling of true periodic threads.
</p>
+<h3 id="priorityInversion">Priority inversion</h3>
+<p>
+ <a href="http://en.wikipedia.org/wiki/Priority_inversion">Priority inversion</a>
+ is a classic failure mode of real-time systems,
+ where a higher-priority task is blocked for an unbounded time waiting
+ for a lower-priority task to release a resource such as (shared
+ state protected by) a
+ <a href="http://en.wikipedia.org/wiki/Mutual_exclusion">mutex</a>.
+ See the article "<a href="avoiding_pi.html">Avoiding priority inversion</a>" for techniques to
+ mitigate it.
+</p>
+
<h3 id="schedLatency">Scheduling latency</h3>
<p>
Scheduling latency is the time between when a thread becomes
diff --git a/src/devices/audio/latency_measure.jd b/src/devices/audio/latency_measure.jd
index f6b1d3e..d0113d2 100644
--- a/src/devices/audio/latency_measure.jd
+++ b/src/devices/audio/latency_measure.jd
@@ -57,7 +57,7 @@
<li>Use a General Purpose Input/Output (GPIO) pin for the same purpose.</li>
<li>Use JTAG or another debugging port.</li>
<li>Use the screen backlight. This might be risky as the
- backlight may have a non-neglible latency, and can contribute to
+ backlight may have a non-negligible latency, and can contribute to
an inaccurate latency reading.
</li>
</ul>
@@ -67,12 +67,10 @@
<ol>
<li>Run an app that periodically pulses the LED at
the same time it outputs audio.
-
- <p class="note"><b>Note:</b> To get useful results, it is crucial to use the correct
+ <p class="note"><strong>Note:</strong> To get useful results, it is crucial to use the correct
APIs in the test app so that you're exercising the fast audio output path.
See <a href="latency_design.html">Design For Reduced Latency</a> for
- background.
- </p>
+ background.</p>
</li>
<li>Place a light sensor next to the LED.</li>
<li>Connect the probes of a dual-channel oscilloscope to both the wired headphone
@@ -120,6 +118,11 @@
precise output latency or input latency values in isolation, but might be useful
for establishing rough estimates.</p>
+ <p>
+ Output latency to on-device speaker can be significantly larger than
+ output latency to headset connector. This is due to speaker correction and protection.
+ </p>
+
<p>
We have published an example implementation at
<a href="https://android.googlesource.com/platform/frameworks/wilhelm/+/master/tests/examples/slesTestFeedback.cpp">slesTestFeedback.cpp</a>.
@@ -147,6 +150,10 @@
<strong>Figure 1.</strong> Round-trip measurement
</p>
+<p>You may need to remove the USB cable to reduce noise,
+and adjust the volume level to get a stable oscillation.
+</p>
+
<h2 id="measuringInput">Measuring Input Latency</h2>
<p>
diff --git a/src/devices/audio/latency_measurements.jd b/src/devices/audio/latency_measurements.jd
index e66b5f9..3897612 100644
--- a/src/devices/audio/latency_measurements.jd
+++ b/src/devices/audio/latency_measurements.jd
@@ -76,7 +76,7 @@
<p>
The measurements below were taken with the
-<a href="loopback.html">Dr. Rick O’Rang audio loopback dongle</a>
+<a href="loopback.html">Dr. Rick O'Rang audio loopback dongle</a>
and an
<a href="latency_measure.html#larsenTest">audio feedback (Larsen effect) test</a>.
</p>
@@ -282,6 +282,16 @@
</tr>
<tr>
+ <td>Nexus 7<br />2013</td>
+ <td>6.0</td>
+ <td>MRA58K</td>
+ <td>48000</td>
+ <td>240</td>
+ <td>5</td>
+ <td>55</td>
+</tr>
+
+<tr>
<td>Nexus 5</td>
<td>4.4.4</td>
<td>KTU84P</td>
@@ -312,6 +322,16 @@
</tr>
<tr>
+ <td>Nexus 5</td>
+ <td>6.0</td>
+ <td>MRA58K</td>
+ <td>48000</td>
+ <td>192</td>
+ <td>4</td>
+ <td>38</td>
+</tr>
+
+<tr>
<td>Nexus 9</td>
<td>5.0.0</td>
<td>LRX21L</td>
@@ -332,6 +352,26 @@
</tr>
<tr>
+ <td>Nexus 9</td>
+ <td>5.1.1</td>
+ <td>LMY47X</td>
+ <td>48000</td>
+ <td>256</td>
+ <td>5.3</td>
+ <td>32</td>
+</tr>
+
+<tr>
+ <td>Nexus 9</td>
+ <td>6.0</td>
+ <td>MRA58K</td>
+ <td>48000</td>
+ <td>128</td>
+ <td>2.6</td>
+ <td>15</td>
+</tr>
+
+<tr>
<td>Nexus 6</td>
<td>5.0.1</td>
<td>LRX22C</td>
@@ -351,6 +391,16 @@
<td>42</td>
</tr>
+<tr>
+ <td>Nexus 6</td>
+ <td>6.0</td>
+ <td>MRA58K</td>
+ <td>48000</td>
+ <td>192</td>
+ <td>4</td>
+ <td>33</td>
+</tr>
+
</table>
<img src="images/round_trip_bar_graph.png" alt="Round-trip latency bar graph" id="figure3" />
diff --git a/src/devices/audio/midi.jd b/src/devices/audio/midi.jd
new file mode 100644
index 0000000..b03ee80
--- /dev/null
+++ b/src/devices/audio/midi.jd
@@ -0,0 +1,175 @@
+page.title=MIDI
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>
+<a href="http://en.wikipedia.org/wiki/MIDI">MIDI</a> (Musical Instrument Digital Interface)
+is a standard protocol for inter-connecting computers with musical instruments, stage lighting,
+and other time-oriented media.
+</p>
+
+<p>
+The physical <a href="http://en.wikipedia.org/wiki/Transport_layer">transport layer</a>
+specified in original MIDI 1.0 is a current loop with
+<a href="http://en.wikipedia.org/wiki/DIN_connector">5-pin DIN</a> connector.
+</p>
+
+<p>
+Since MIDI 1.0, additional transports have been defined, including MIDI over USB
+and a proposed draft for MIDI over
+<a href="http://en.wikipedia.org/wiki/Bluetooth_low_energy">Bluetooth Low Energy</a> (BLE.)
+</p>
+
+<p>
+Strictly speaking, MIDI is unrelated to audio. But since MIDI is commonly used with
+music, this article is placed in the audio section.
+</p>
+
+<h2 id="for-android">MIDI for Android</h2>
+
+<p>
+Android 3.1 and later support
+<a href="http://en.wikipedia.org/wiki/USB_On-The-Go">USB On-The-Go</a>,
+which permits an Android device to act as USB host to drive USB
+peripherals. The USB host mode APIs introduced in Android 3.1 permit
+developers to implement MIDI over USB at the application level, but until
+recently there have been no built-in platform APIs for MIDI.
+</p>
+
+<p>
+Beginning with the Android 6.0 (Marshmallow) release, device makers can enable optional MIDI support in the platform.
+Supported transports include USB, draft BLE, and virtual (inter-app).
+</p>
+
+<p>
+For details on application programming with the new MIDI APIs, see the
+<a href="https://developer.android.com/reference/android/media/midi/package-summary.html"><code>android.media.midi</code></a>
+package.
+</p>
+
+<p>
+The remainder of this article discusses how an Android device maker can
+enable MIDI support in the platform.
+</p>
+
+<h2 id="transport">Enabling transports</h2>
+
+<p>
+The implementation depends on ALSA for USB host mode and USB peripheral mode transports.
+ALSA is not used for the BLE and virtual transports.
+</p>
+
+<h3 id="usb-host">USB host mode</h3>
+
+<p>
+To enable MIDI for USB host mode, first support USB host mode in general, and
+then enable <code>CONFIG_SND_RAWMIDI</code> and <code>CONFIG_SND_USB_MIDI</code> in your kernel configuration.
+See <a href="{@docRoot}devices/tech/config/kernel.html">Android Kernel Configuration.</a>
+</p>
+
+<p>
+The MIDI over USB transport is formally defined by the
+<a href="http://www.usb.org/developers/docs/devclass_docs/midi10.pdf">
+Universal Serial Bus Device Class Definition for MIDI Devices Release 1.0 Nov 1, 1999</a>
+standard published by the
+<a href="http://www.usb.org/">USB Implementers Forum, Inc</a>.
+</p>
+
+<h3 id="usb-peripheral">USB peripheral mode</h3>
+
+<p>
+To enable MIDI for USB peripheral mode, you may need to apply patches
+to your Linux kernel to integrate the
+<code>drivers/usb/gadget/f_midi.c</code> into the USB gadget
+driver. As of this writing, these patches are available for Linux kernel version
+3.10. These patches have not yet been updated for
+<a href="http://en.wikipedia.org/wiki/Configfs">ConfigFs</a>
+(a new architecture
+for USB gadget drivers), nor are they merged at upstream
+<a href="http://kernel.org">kernel.org</a>.
+</p>
+
+<p>
+The patches are shown in commit order for the kernel tree at project <code>kernel/common</code>
+branch <code>android-3.10</code>:
+</p>
+<ol>
+<li><a href="https://android-review.googlesource.com/#/c/127450/">https://android-review.googlesource.com/#/c/127450/</a></li>
+<li><a href="https://android-review.googlesource.com/#/c/127452/">https://android-review.googlesource.com/#/c/127452/</a></li>
+<li><a href="https://android-review.googlesource.com/#/c/143714/">https://android-review.googlesource.com/#/c/143714/</a></li>
+</ol>
+
+<p>
+In addition, the end user must also check the box for MIDI
+in the <em>Settings / Developer options / Networking / Select USB Configuration</em> dialog,
+or by pulling down from the top of screen while attached
+to the USB host, selecting entry "USB for ...", and then choosing <strong>MIDI</strong>.
+</p>
+
+<h3 id="ble">BLE</h3>
+
+<p>
+MIDI over BLE is always enabled, provided the device supports BLE.
+As this transport is in draft status, it is subject to change.
+</p>
+
+<h3 id="virtual">Virtual (inter-app)</h3>
+
+<p>
+The virtual (inter-app) transport is always enabled.
+</p>
+
+<h2 id="claim-feature">Claiming the feature</h2>
+
+<p>
+Applications can screen for the presence of MIDI support using the
+<code>android.software.midi</code> feature.
+</p>
+
+<p>
+To claim MIDI support, add this line to your <code>device.mk</code>:
+</p>
+<pre>
+PRODUCT_COPY_FILES += \
+frameworks/native/data/etc/android.software.midi.xml:system/etc/permissions/android.software.midi.xml
+</pre>
+
+<p>
+See the
+<a href="{@docRoot}compatibility/android-cdd.pdf">Android Compatibility Definition Document (CDD)</a>
+for information
+on requirements to claim the feature.
+</p>
+
+<h2 id="hostDebugging">Debugging while in host mode</h2>
+
+<p>
+While in USB host mode, Android Debug Bridge (adb) debugging over USB is unavailable.
+See section <a href="http://developer.android.com/tools/help/adb.html#wireless">Wireless usage</a>
+of
+<a href="http://developer.android.com/tools/help/adb.html">Android Debug Bridge</a>
+for an alternative.
+</p>
diff --git a/src/devices/audio/midi_test.jd b/src/devices/audio/midi_test.jd
new file mode 100644
index 0000000..fa80670
--- /dev/null
+++ b/src/devices/audio/midi_test.jd
@@ -0,0 +1,259 @@
+page.title=MIDI Test Procedure
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>These tests may be used to validate the MIDI feature on Android devices.
+Successful execution of these tests is a prerequisite to
+<a href="midi.html#claim-feature">claim the MIDI feature</a>.
+</p>
+
+<h2 id="preparation">Preparation</h2>
+
+
+<h3 id="hardware">Hardware</h3>
+
+<p>
+The following hardware is needed for the tests.
+</p>
+
+<ul>
+ <li> MIDI keyboard with USB connector, e.g. the <a href="http://www.akaipro.com/product/lpk25">Akai LPK25</a></li>
+ <li> MIDI keyboard with Bluetooth Low Energy (BLE) support, e.g. the <a href="http://miselu.com/">Miselu C.24</a></li>
+ <li> USB cables</li>
+ <li> USB On-The-Go (OTG) adapter to convert a female USB-A to male micro-USB or USB-C</li>
+ <li> Android device running Android 6.0 Marshmallow or later release</li>
+ <li> Optional: desktop computer</li>
+</ul>
+
+<h3 id="apps">Apps</h3>
+
+
+<p>Several apps are used by this test procedure:</p>
+
+<table>
+<tr>
+ <th>App</th>
+ <th>Description</th>
+</tr>
+<tr>
+ <td><a href="https://github.com/philburk/android-midisuite/tree/master/MidiScope">MidiScope</a> or
+ <a href="https://github.com/googlesamples/android-MidiScope">MidiScope</a></td>
+ <td>displays MIDI messages on-screen</td>
+</tr>
+<tr>
+ <td><a href="https://github.com/philburk/android-midisuite/tree/master/MidiKeyboard">MidiKeyboard</a></td>
+ <td>sends MIDI messages by pressing an on-screen music keyboard</td>
+</tr>
+<tr>
+ <td><a href="https://github.com/philburk/android-midisuite/tree/master/MidiSynthExample">MidiSynthExample</a> or
+ <br /><a href="https://github.com/googlesamples/android-MidiSynth">MidiSynth</a></td>
+ <td>simple MIDI synthesizer that uses sawtooth oscillators</td>
+</tr>
+<tr>
+ <td><a href="https://github.com/philburk/android-midisuite/tree/master/MidiBtlePairing">MidiBtlePairing</a></td>
+ <td>pairs an Android device with a BLE peripheral</td>
+</tr>
+<tr>
+ <td><a href="https://github.com/philburk/android-midisuite/tree/master/MidiTools">MidiTools</a></td>
+ <td>library dependency of the above apps</td>
+</tr>
+</table>
+
+<p>
+Most of these apps are part of the GitHub project
+<a href="https://github.com/philburk/android-midisuite">android-midisuite</a>.
+</p>
+
+<p>Each test has a list of apps that are used. After building each app, you can install the app using
+<a href="http://developer.android.com/tools/help/adb.html">Android Debug Bridge</a> (ADB).
+For example, to install the <em>MidiScope</em> app:</p>
+
+<ol>
+ <li> Use a workstation with ADB installed.</li>
+ <li> Connect a USB cable from the workstation to the Android device.</li>
+ <li> You may need to allow the USB connection on the Android device; see <a href="midi.html#usb-peripheral">USB peripheral mode</a></li>
+ <li> On the workstation, enter:</li>
+</ol>
+
+<pre>
+cd <em><this-folder></em>
+adb install -r MidiScope.apk
+</pre>
+
+
+<h2 id="virtual_synth_tests">Virtual synth tests</h2>
+
+
+<p>Note that a MIDI input port can have only one connection. So if another app is
+already using an input port, that port will not be available. If you cannot connect to
+an input port then try closing other apps.</p>
+
+<p>Hardware needed: Android device under test</p>
+
+<h3 id="simple_connection">Simple connection</h3>
+
+
+<p>Apps needed: <em>MidiKeyboard</em>, <em>MidiSynthExample</em></p>
+
+<p>This tests device enumeration, virtual devices, port connections, and message
+sending.</p>
+
+<ol>
+ <li> Adjust volume on Android device to about halfway.</li>
+ <li> Orient phone in landscape mode.</li>
+ <li> Launch <em>MidiKeyboard</em> app.</li>
+ <li> Select <strong>SynthExample</strong> from the spinner menu.</li>
+ <li> Play keys. You should hear notes being played in the <em>SynthExample</em> app.</li>
+ <li> Exit the application by pressing the <strong>Back</strong> button so that the port will be
+closed.</li>
+</ol>
+
+<h2 id="host_mode">USB test: host mode</h2>
+
+
+<p>Hardware needed: USB MIDI keyboard, USB cable, OTG adapter</p>
+
+<p>Repeat these tests several times. We have seen the USB stack crash hard on some
+prototype devices if devices were plugged in and unplugged a few times.</p>
+
+<h3 id="keyboard_already_plugged_in">Keyboard already plugged in</h3>
+
+
+<p>Apps needed: <em>MidiSynthExample</em> or <em>MidiScope</em></p>
+
+<p>This tests USB MIDI in host mode.</p>
+
+<ol>
+ <li> Adjust volume on Android device to about halfway.</li>
+ <li> Plug in USB keyboard using the OTG adapter.</li>
+ <li> Launch <em>SynthExample</em> app or the <em>MidiScope</em> app.</li>
+ <li> From the menu select the USB keyboard. It will display the brand.</li>
+ <li> Play notes on the keyboard. If you ran <em>SynthExample</em> then you should hear notes
+being played on the phone. If you ran <em>MidiScope</em> then you should see <em>NoteOn</em> and
+<em>NoteOff</em> messages on-screen.</li>
+ <li> Unplug the keyboard. The <em>Sender for Synth</em> menu should display <em>- - - - -</em>.</li>
+ <li> Exit the application by pressing the <strong>Back</strong> button.</li>
+</ol>
+
+<h3 id="hot_plug_usb_keyboard">Hot-plug USB keyboard</h3>
+
+
+<p>Apps needed: <em>MidiSynthExample</em> or <em>MidiScope</em></p>
+
+<p>This tests USB MIDI in host mode.</p>
+
+<ol>
+ <li> Adjust volume on Android device to about halfway.</li>
+ <li> Make sure there is not a USB MIDI keyboard plugged in.</li>
+ <li> Launch <em>SynthExample</em> app.</li>
+ <li> At middle, next to <em>Sender for Synth</em>, look in menu. You should not see the USB
+keyboard listed.</li>
+ <li> Plug in USB keyboard using the OTG adapter.</li>
+ <li> At middle, next to <em>Sender for Synth</em>, select the USB keyboard. It will display
+the brand.</li>
+ <li> Play notes on the keyboard. You should hear notes being played on the phone.</li>
+ <li> At middle, next to <em>Sender for Synth</em>, select <strong>- - - - -</strong>.</li>
+ <li> Play notes on the keyboard. You should hear nothing.</li>
+ <li> At middle, next to <em>Sender for Synth</em>, select the USB keyboard. It will display
+the brand.</li>
+ <li> Play notes on the keyboard. You should hear notes being played on the phone.</li>
+ <li> Unplug the synthesizer. The <em>Sender for Synth</em> menu should display <em>- - - - -</em>.</li>
+ <li> Exit the application by pressing the <strong>Back</strong> button.</li>
+</ol>
+
+<h2 id="peripheral_mode">USB test: peripheral mode</h2>
+
+
+<p>Hardware needed: USB cable, OTG adapter</p>
+
+<h3 id="android_to_android">Android-to-Android</h3>
+
+
+<p>Apps needed: <em>MidiKeyboard</em> on Android device under test, <em>MidiScope</em> on another
+Android device.</p>
+
+<p>Use Android devices as a peripheral controller for another Android device. To help test
+this mode, use another Android device running in host mode. Note that
+you could modify the test to work with a desktop computer running Digital Audio Workstation (DAW)
+software such as
+GarageBand.</p>
+
+<ol>
+ <li> Connect the USB cable to the Android device under test (Android device <strong>A</strong>).</li>
+ <li> Use an OTG adapter to connect the other end of the cable to a second Android
+device <strong>B</strong> that operates in host mode.</li>
+ <li> On Android device A:
+ <ol>
+ <li> Drag finger down from top of screen.</li>
+ <li> Select <strong>USB for Charging</strong> icon.</li>
+ <li> Select <strong>MIDI</strong>.</li>
+ <li> Launch <em>MidiKeyboard</em> app.</li>
+ <li> Select <strong>Android USB Peripheral Port</strong> from <em>Receiver for Keys</em> menu at top.</li>
+ </ol>
+ </li>
+ <li> On Android device B:
+ <ol>
+ <li> Launch <em>MidiScope</em> app.</li>
+ <li> Select the other Android device as the source.</li>
+ </ol>
+ </li>
+ <li> On Android device A:
+ <ol>
+ <li> Play notes on the keyboard and look for <em>NoteOn</em> and <em>NoteOff</em> on Android device B.</li>
+ </ol>
+ </li>
+ </ol>
+
+<h2 id="bluetooth_le_test">BLE test</h2>
+
+
+<p>Hardware needed: MIDI keyboard supporting BLE</p>
+
+<h3 id="basic_pairing_and_playing">Basic pairing and playing</h3>
+
+
+<p>Apps needed: <em>MidiBtlePairing</em>, <em>MidiSynthExample</em></p>
+
+<p>Test a keyboard connected to Android over BLE.</p>
+
+<ol>
+ <li> Reboot the Android device.</li>
+ <li> Power on the BLE keyboard.<br />
+ (The Miselu C.24 keyboard is powered on by pushing the button near the back so
+that it pops open. The power button on the C.24 pulses blue when in pairing
+mode.)</li>
+ <li> Launch the <em>MidiBtlePairing</em> app. It has a <em>MIDI+BTLE</em> icon.</li>
+ <li> Press the <strong>Bluetooth Scan</strong> button.</li>
+ <li> Select desired BLE peripheral.</li>
+ <li> The app should return to the main page, and you should see the peripheral listed. If
+you are using a C.24, then you will notice that the light should turn green on
+the C.24 to indicate paired mode.</li>
+ <li> Exit the app by pressing the <strong>Home</strong> button, not the <strong>Back</strong> button.</li>
+ <li> Launch the SynthExample app.</li>
+ <li> Select the BLE keyboard as the sender from the menu.</li>
+ <li> You should be able to press keys on the BLE keyboard and hear notes on
+Android.</li>
+</ol>
diff --git a/src/devices/audio/terminology.jd b/src/devices/audio/terminology.jd
index cec0bcd..ef4caa9 100644
--- a/src/devices/audio/terminology.jd
+++ b/src/devices/audio/terminology.jd
@@ -341,6 +341,12 @@
Definition Audio</a>.
</dd>
+<dt>line level</dt>
+<dd>
+<a href="http://en.wikipedia.org/wiki/Line_level">Line level</a> is the strength
+of an analog audio signal that passes between audio components, not transducers.
+</dd>
+
<dt>MHL</dt>
<dd>
Mobile High-Definition Link. Mobile audio/video interface, often over micro-USB
@@ -389,7 +395,7 @@
<ul>
<li><a href="http://en.wikipedia.org/wiki/General-purpose_input/output">GPIO</a></li>
<li><a href="http://en.wikipedia.org/wiki/I%C2%B2C">I²C</a>, for control channel</li>
-<li><a href="http://en.wikipedia.org/wiki/I%C2%B2S">I²S</a>, for audio data</li>
+<li><a href="http://en.wikipedia.org/wiki/I%C2%B2S">I²S</a>, for audio data, simpler than SLIMbus</li>
<li><a href="http://en.wikipedia.org/wiki/McASP">McASP</a></li>
<li><a href="http://en.wikipedia.org/wiki/SLIMbus">SLIMbus</a></li>
<li><a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a></li>
@@ -763,4 +769,4 @@
operate in volume indices rather than absolute attenuation factors.
</dd>
-</dl>
\ No newline at end of file
+</dl>
diff --git a/src/devices/audio/usb.jd b/src/devices/audio/usb.jd
index b885f60..1a0ce67 100644
--- a/src/devices/audio/usb.jd
+++ b/src/devices/audio/usb.jd
@@ -67,7 +67,7 @@
</p>
<p>
-<b>Note:</b> the terms <i>device</i> or <i>accessory</i> are common synonyms for
+<p class="note"><strong>Note:</strong> The terms <i>device</i> and <i>accessory</i> are common synonyms for
<i>peripheral</i>. We avoid those terms here, as they could be confused with
Android <a href="http://en.wikipedia.org/wiki/Mobile_device">device</a>
or the Android-specific concept called
@@ -310,7 +310,7 @@
<p>
In asynchronous (also called implicit feedback) sub-mode,
-the sink or source determines the sample rate, and the host accomodates.
+the sink or source determines the sample rate, and the host accommodates.
The primary theoretical advantage of asynchronous sub-mode is that the source
or sink USB clock is physically and electrically closer to (and indeed may
be the same as, or derived from) the clock that drives the DAC or ADC.
@@ -452,7 +452,7 @@
<p>
Which design is better? The answer depends on your needs.
Each has advantages and disadvantages.
-<b>Note:</b> this is an artificial comparison, since
+<p class="note"><strong>Note:</strong> This is an artificial comparison, since
a real Android device would probably have both options available.
</p>
diff --git a/src/devices/bluetooth.jd b/src/devices/bluetooth.jd
index 8677b7d..a1ec72f 100644
--- a/src/devices/bluetooth.jd
+++ b/src/devices/bluetooth.jd
@@ -26,12 +26,12 @@
<img style="float: right; margin: 0px 15px 15px 15px;" src="images/ape_fwk_hal_bluetooth.png" alt="Android Bluetooth HAL icon"/>
-<p>Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: The Bluetooth Embedded System (BTE), which implements the core Bluetooth functionality and the Bluetooth Application Layer (BTA), which communicates with Android framework applications.</p>
+<p>Android provides a default Bluetooth stack that is divided into two layers: The Bluetooth Embedded System (BTE), which implements the core Bluetooth functionality, and the Bluetooth Application Layer (BTA), which communicates with Android framework applications.</p>
<p>To fully leverage the <a href="http://developer.android.com/about/versions/android-5.0.html#BluetoothBroadcasting">Bluetooth Low Energy APIs</a> added in Android 5.0, you should implement the <a href="Android-5.0-Bluetooth-HCI-Reqs.pdf">Android 5.0 Bluetooth HCI Requirements</a>.</p>
<h2 id="architecture">Architecture</h2>
-<p>A Bluetooth system service communicates with the Bluetooth stack through JNI and with applications through Binder IPC. The system service provides developers access to various Bluetooth profiles. The following diagram shows the general structure of the Bluetooth stack:
+<p>A Bluetooth system service communicates with the Bluetooth stack through JNI and with applications through Binder IPC. The system service provides developers with access to various Bluetooth profiles. The following diagram shows the general structure of the Bluetooth stack:
</p>
<img src="images/ape_fwk_bluetooth.png" alt="Android Bluetooth architecture" id="figure1" />
@@ -41,7 +41,7 @@
<dl>
<dt>Application framework</dt>
- <dd>At the application framework level is the app's code, which utilizes the <a
+ <dd>At the application framework level is application code, which utilizes the <a
href="http://developer.android.com/reference/android/bluetooth/package-summary.html">android.bluetooth</a>
APIs to interact with the Bluetooth hardware. Internally, this code calls the Bluetooth process through
the Binder IPC mechanism.</dd>
@@ -61,16 +61,16 @@
<dt>HAL</dt>
<dd>The hardware abstraction layer defines the standard interface that the <a
href="http://developer.android.com/reference/android/bluetooth/package-summary.html">android.bluetooth</a> APIs
- and Bluetooth process calls into and that you must implement to have your Bluetooth hardware
- function correctly. The header files for the Bluetooth HAL is located
- in the <code>hardware/libhardware/include/hardware/bluetooth.h</code> and
+ and Bluetooth process call into and that you must implement to have your Bluetooth hardware
+ function correctly. The header file for the Bluetooth HAL
+ is <code>hardware/libhardware/include/hardware/bluetooth.h</code>. Additionally, please review all of the
<code>hardware/libhardware/include/hardware/bt_*.h</code> files.
</dd>
<dt>Bluetooth stack</dt>
<dd>The default Bluetooth stack is provided for you and is located in
- <code>external/bluetooth/bluedroid</code>. The stack implements the generic Bluetooth HAL as well
- as customizes it with extensions and configuration changes.
+ <code>system/bt</code>. The stack implements the generic Bluetooth HAL and
+ customizes it with extensions and configuration changes.
</dd>
<dt>Vendor extensions</dt>
@@ -80,13 +80,17 @@
</dl>
-
<h2 id="implementing">Implementing the HAL</h2>
-<p>The Bluetooth HAL is located in the <code>hardware/libhardware/include/hardware/</code> directory. Please see that directory for the <strong>complete set</strong> of files, which include but are not limited to the following:
-</p>
+<p>The Bluetooth HAL is located in <code>/hardware/libhardware/include/hardware/bluetooth.h</code>.
+Thus, the <code>bluetooth.h</code> file contains the basic interface for the Bluetooth stack, and you must implement its functions.</p>
+
+<p>Profile-specific files are located in the same directory. For details, see the <a
+href="{@docRoot}devices/halref/dir_6b11132f1a015b03f2670f21bef1d871.html">HAL File Reference</a>.</p>
+
+<p>The following is a <strong>partial</strong> list of the profile-related
+files. For the <strong>complete set</strong>, see the <code>/hardware/libhardware/include/hardware/</code> directory:</p>
<ul>
- <li><code>bluetooth.h</code>: Includes the interface definition for the Bluetooth hardware on the device.</li>
<li><code>bt_av.h</code>: Includes the interface definition for the A2DP profile.</li>
<li><code>bt_gatt.h</code>, <code>bt_gatt_client.h</code>, and <code>bt_gatt_server.h</code>: These include the interface definition for the GATT profile.</li>
<li><code>bt_hf.h</code>: Includes the interface definition for the HFP profile.</li>
@@ -100,22 +104,18 @@
<p>Keep in mind that your Bluetooth implementation is not constrained to the features
and profiles exposed in the HAL. You can find the default implementation located
- in the BlueDroid Bluetooth stack in the <code>external/bluetooth/bluedroid</code> directory,
+ in the Bluetooth stack in the <code>system/bt</code> directory,
which implements the default HAL and also extra features and customizations.</p>
-</p>
-<h2>Customizing the BlueDroid Stack</h2>
-<p>If you are using the default BlueDroid stack, but want to make a few customizations, you can
- do the following things:</p>
-
+<h2 id="customizing">Customizing the Native Bluetooth Stack</h2>
+<p>If you are using the default Bluetooth stack, but want to make a few customizations, you can
+ do the following:</p>
<ul>
<li>Custom Bluetooth profiles - If you want to add Bluetooth profiles that do not have
- HAL interfaces provided by Android, you must supply an SDK add-on download to make the profile available to app developers,
- make the APIs available in the Bluetooth system process app (<code>packages/apps/Bluetooth</code>), and add them
- to the BlueDroid stack (<code>external/bluetooth/bluedroid</code>).</li>
+ HAL interfaces provided by Android, you must supply an SDK add-on download to make the profile available to app developers, make the APIs available in the Bluetooth system process app (<code>packages/apps/Bluetooth</code>), and add them to the default stack (<code>system/bt</code>).</li>
<li>Custom vendor extensions and configuration changes - You can add things such as extra AT commands or device-specific configuration changes
- by creating a <code>libbt-vendor</code> module. See the <code>vendor/broadcom/libbt-vendor</code> directory
+ by creating a <code>libbt-vendor</code> module. See the <code>/hardware/broadcom/libbt</code> directory
for an example.</li>
<li>Host Controller Interface (HCI) - You can provide your own HCI by creating a <code>libbt-hci</code> module, which
is mainly used for debug tracing. See the <code>external/bluetooth/hci</code> directory for an example.</li>
diff --git a/src/devices/camera/camera3_3Amodes.jd b/src/devices/camera/camera3_3Amodes.jd
index 89d9841..35fa90d 100644
--- a/src/devices/camera/camera3_3Amodes.jd
+++ b/src/devices/camera/camera3_3Amodes.jd
@@ -73,7 +73,7 @@
triggered.<br/>
AF_MODE_CONTINUOUS_VIDEO: Smooth continuous focusing, for recording video.
Triggering immediately locks focus in current position. Canceling resumes
- cotinuous focusing.<br/>
+ continuous focusing.<br/>
AF_MODE_CONTINUOUS_PICTURE: Fast continuous focusing, for zero-shutter-lag still
capture. Triggering locks focus once currently active sweep concludes. Canceling
resumes continuous focusing.<br/>
diff --git a/src/devices/camera/camera3_requests_methods.jd b/src/devices/camera/camera3_requests_methods.jd
index bde2e44..4da58da 100644
--- a/src/devices/camera/camera3_requests_methods.jd
+++ b/src/devices/camera/camera3_requests_methods.jd
@@ -94,9 +94,9 @@
given device. The framework will use this to dump all state as quickly as
possible in order to prepare for a configure_streams() call.<br/>
No buffers are required to be successfully returned, so every buffer held at the
- time of flush() (whether sucessfully filled or not) may be returned with
+ time of flush() (whether successfully filled or not) may be returned with
CAMERA3_BUFFER_STATUS_ERROR. Note the HAL is still allowed to return valid
- (STATUS_OK) buffers during this call, provided they are succesfully filled.<br/>
+ (STATUS_OK) buffers during this call, provided they are successfully filled.<br/>
All requests currently in the HAL are expected to be returned as soon as
possible. Not-in-process requests should return errors immediately. Any
interruptible hardware blocks should be stopped, and any uninterruptible blocks
diff --git a/src/devices/camera/images/ape_fwk_camera.png b/src/devices/camera/images/ape_fwk_camera.png
index 102461e..cb8831b 100644
--- a/src/devices/camera/images/ape_fwk_camera.png
+++ b/src/devices/camera/images/ape_fwk_camera.png
Binary files differ
diff --git a/src/devices/camera/images/camera-hal-overview.png b/src/devices/camera/images/camera-hal-overview.png
index fed29e7..3f39356 100644
--- a/src/devices/camera/images/camera-hal-overview.png
+++ b/src/devices/camera/images/camera-hal-overview.png
Binary files differ
diff --git a/src/devices/camera/images/camera-ops-flow.png b/src/devices/camera/images/camera-ops-flow.png
index 7326782..2d5cd4f 100644
--- a/src/devices/camera/images/camera-ops-flow.png
+++ b/src/devices/camera/images/camera-ops-flow.png
Binary files differ
diff --git a/src/devices/camera/images/camera_block.png b/src/devices/camera/images/camera_block.png
index b7a58eb..29b92e9 100644
--- a/src/devices/camera/images/camera_block.png
+++ b/src/devices/camera/images/camera_block.png
Binary files differ
diff --git a/src/devices/camera/images/camera_hal.png b/src/devices/camera/images/camera_hal.png
index 28fa927..ffb1406 100644
--- a/src/devices/camera/images/camera_hal.png
+++ b/src/devices/camera/images/camera_hal.png
Binary files differ
diff --git a/src/devices/camera/images/camera_model.png b/src/devices/camera/images/camera_model.png
index 50cbabc..a8810c6 100644
--- a/src/devices/camera/images/camera_model.png
+++ b/src/devices/camera/images/camera_model.png
Binary files differ
diff --git a/src/devices/camera/images/camera_simple_model.png b/src/devices/camera/images/camera_simple_model.png
index fd0fac0..625dd8f 100644
--- a/src/devices/camera/images/camera_simple_model.png
+++ b/src/devices/camera/images/camera_simple_model.png
Binary files differ
diff --git a/src/devices/camera/images/crop-region-11-ratio.png b/src/devices/camera/images/crop-region-11-ratio.png
index 8e28230..f6406d7 100644
--- a/src/devices/camera/images/crop-region-11-ratio.png
+++ b/src/devices/camera/images/crop-region-11-ratio.png
Binary files differ
diff --git a/src/devices/camera/images/crop-region-169-ratio.png b/src/devices/camera/images/crop-region-169-ratio.png
index 62837e2..d190858 100644
--- a/src/devices/camera/images/crop-region-169-ratio.png
+++ b/src/devices/camera/images/crop-region-169-ratio.png
Binary files differ
diff --git a/src/devices/camera/images/crop-region-43-ratio.png b/src/devices/camera/images/crop-region-43-ratio.png
index f48046b..420068b 100644
--- a/src/devices/camera/images/crop-region-43-ratio.png
+++ b/src/devices/camera/images/crop-region-43-ratio.png
Binary files differ
diff --git a/src/devices/camera/images/crop-region-43-square-ratio.png b/src/devices/camera/images/crop-region-43-square-ratio.png
index 3794dbe..9257dda 100644
--- a/src/devices/camera/images/crop-region-43-square-ratio.png
+++ b/src/devices/camera/images/crop-region-43-square-ratio.png
Binary files differ
diff --git a/src/devices/camera/index.jd b/src/devices/camera/index.jd
index 1e5cab8..9bf74df 100644
--- a/src/devices/camera/index.jd
+++ b/src/devices/camera/index.jd
@@ -30,7 +30,7 @@
camera framework APIs in <a href="http://developer.android.com/reference/android/hardware/package-summary.html">android.hardware</a> to your underlying camera driver and hardware. The camera subsystem includes implementations for camera pipeline components while the camera HAL provides interfaces for use in implementing your version of these components.</p>
<h2 id="architecture">Architecture</h2>
-<p>The following figure and list describe the components involved and where to find the source for each:
+<p>The following figure and list describe the HAL components:
</p>
<img src="images/ape_fwk_camera.png" alt="Android camera architecture" id="figure1" />
diff --git a/src/devices/devices_toc.cs b/src/devices/devices_toc.cs
index 8fd6d69..85c5f76 100644
--- a/src/devices/devices_toc.cs
+++ b/src/devices/devices_toc.cs
@@ -46,11 +46,21 @@
<li><a href="<?cs var:toroot ?>devices/audio/testing_circuit.html">Light Testing Circuit</a></li>
<li><a href="<?cs var:toroot ?>devices/audio/loopback.html">Audio Loopback Dongle</a></li>
<li><a href="<?cs var:toroot ?>devices/audio/latency_measurements.html">Measurements</a></li>
+ <li><a href="<?cs var:toroot ?>devices/audio/latency_app.html">Applications</a></li>
</ul>
</li>
<li><a href="<?cs var:toroot ?>devices/audio/avoiding_pi.html">Priority Inversion</a></li>
<li><a href="<?cs var:toroot ?>devices/audio/src.html">Sample Rate Conversion</a></li>
<li><a href="<?cs var:toroot ?>devices/audio/debugging.html">Debugging</a></li>
+ <li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>devices/audio/midi.html">
+ <span class="em">MIDI</span>
+ </a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>devices/audio/midi_test.html">MIDI Test Procedure</a></li>
+ </ul>
<li><a href="<?cs var:toroot ?>devices/audio/usb.html">USB Digital Audio</a></li>
<li><a href="<?cs var:toroot ?>devices/audio/tv.html">TV Audio</a></li>
</ul>
@@ -240,6 +250,7 @@
</a>
</div>
<ul>
+ <li><a href="<?cs var:toroot ?>devices/tech/debug/asan.html">AddressSanitizer</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/debug/dumpsys.html">Dumpsys</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/debug/native-memory.html">Native Memory Use</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/debug/netstats.html">Network Use</a></li>
@@ -248,6 +259,21 @@
</li>
<li class="nav-section">
+ <div class="nav-section-header">
+ <a href="<?cs var:toroot ?>devices/tech/admin/index.html">
+ <span class="en">Device Administration</span></a>
+ </div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/implement.html">Implementation</a></li>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/multi-user.html">Multiple Users</a></li>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/managed-profiles.html">Managed Profiles</a></li>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/provision.html">Provisioning</a></li>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/multiuser-apps.html">Multiuser Apps</a></li>
+ <li><a href="<?cs var:toroot ?>devices/tech/admin/testing-setup.html">Testing Setup</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
<div class="nav-section-header empty">
<a href="<?cs var:toroot ?>devices/halref/index.html">
<span class="en">HAL File Reference</span>
@@ -269,6 +295,7 @@
<li><a href="<?cs var:toroot ?>devices/tech/ota/sign_builds.html">Signing Builds for Release</a></li>
</ul>
</li>
+
<li class="nav-section">
<div class="nav-section-header">
<a href="<?cs var:toroot ?>devices/tech/power/index.html"><span class="en">Power</span></a>
@@ -309,6 +336,7 @@
</a>
</div>
<ul>
+ <li><a href="<?cs var:toroot ?>devices/tech/security/enhancements/enhancements60.html">Android 6.0</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/security/enhancements/enhancements50.html">Android 5.0</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/security/enhancements/enhancements44.html">Android 4.4</a></li>
<li><a href="<?cs var:toroot ?>devices/tech/security/enhancements/enhancements43.html">Android 4.3</a></li>
diff --git a/src/devices/drm.jd b/src/devices/drm.jd
index 3d47e30..87b967a 100644
--- a/src/devices/drm.jd
+++ b/src/devices/drm.jd
@@ -227,7 +227,7 @@
<ul>
<li>OnEventListener for results of asynchronous APIs</li>
-<li>OnErrorListener for recieving errors of asynchronous APIs</li>
+<li>OnErrorListener for receiving errors of asynchronous APIs</li>
<li>OnInfoListener for any supplementary information during DRM
transactions.</li>
</ul>
diff --git a/src/devices/graphics/architecture.jd b/src/devices/graphics/architecture.jd
index 75623cc..77593f2 100644
--- a/src/devices/graphics/architecture.jd
+++ b/src/devices/graphics/architecture.jd
@@ -55,7 +55,7 @@
out in a few places.</p>
<p>At various points I will refer to source code from the AOSP sources or from
-Grafika. Grafika is a Google open-source project for testing; it can be found at
+Grafika. Grafika is a Google open source project for testing; it can be found at
<a
href="https://github.com/google/grafika">https://github.com/google/grafika</a>.
It's more "quick hack" than solid example code, but it will suffice.</p>
@@ -158,10 +158,12 @@
primary component of which is a BufferQueue - for which SurfaceFlinger acts as
the consumer. A Binder object for the producer side is passed through the
WindowManager to the app, which can then start sending frames directly to
-SurfaceFlinger. (Note: The WindowManager uses the term "window" instead of
+SurfaceFlinger.</p>
+
+<p class="note"><strong>Note:</strong> The WindowManager uses the term "window" instead of
"layer" for this and uses "layer" to mean something else. We're going to use the
SurfaceFlinger terminology. It can be argued that SurfaceFlinger should really
-be called LayerFlinger.)</p>
+be called LayerFlinger.</p>
<p>For most apps, there will be three layers on screen at any time: the "status
bar" at the top of the screen, the "navigation bar" at the bottom or side, and
@@ -272,10 +274,11 @@
layer's name is indicative of its original role: On a device with
<code>/dev/graphics/fb0</code> and no overlays, all composition would be done
with GLES, and the output would be written to the framebuffer. On recent devices there
-generally is no simple framebuffer, so the FB_TARGET layer is a scratch buffer.
-(Note: This is why screen grabbers written for old versions of Android no
-longer work: They're trying to read from The Framebuffer, but there is no such
-thing.)</p>
+generally is no simple framebuffer, so the FB_TARGET layer is a scratch buffer.</p>
+
+<p class="note"><strong>Note:</strong> This is why screen grabbers written for old versions of Android no
+longer work: They're trying to read from the Framebuffer, but there is no such
+thing.</p>
<p>The overlay planes have another important role: they're the only way to display
DRM content. DRM-protected buffers cannot be accessed by SurfaceFlinger or the
diff --git a/src/devices/graphics/implement.jd b/src/devices/graphics/implement.jd
index 59aca16..3f3654a 100644
--- a/src/devices/graphics/implement.jd
+++ b/src/devices/graphics/implement.jd
@@ -203,9 +203,9 @@
synchronization allows producers and consumers of graphics buffers to signal
when they are done with a buffer. This allows the Android system to
asynchronously queue buffers to be read or written with the certainty that
-another consumer or producer does not currently need them. See the <a
-href="#synchronization_framework">Synchronization framework</a> section for an overview of
-this mechanism.</p>
+another consumer or producer does not currently need them. See the
+<a href="{@docRoot}devices/graphics/index.html#synchronization_framework">Synchronization
+framework</a> section for an overview of this mechanism.</p>
<p>The benefits of explicit synchronization include less behavior variation
between devices, better debugging support, and improved testing metrics. For
diff --git a/src/devices/graphics/index.jd b/src/devices/graphics/index.jd
index 3bba9dd..1c5b025 100644
--- a/src/devices/graphics/index.jd
+++ b/src/devices/graphics/index.jd
@@ -209,8 +209,9 @@
<p>Since Android graphics offer no explicit parallelism, vendors have long
implemented their own implicit synchronization within their own drivers. This
is no longer required with the Android graphics synchronization framework. See
-the <a href="#explicit_synchronization">Explicit synchronization</a> section
-for implementation instructions.</p>
+the
+<a href="{@docRoot}devices/graphics/implement.html#explicit_synchronization">Explicit
+synchronization</a> section for implementation instructions.</p>
<p>The synchronization framework explicitly describes dependencies between
different asynchronous operations in the system. The framework provides a
diff --git a/src/devices/hal.jd b/src/devices/hal.jd
deleted file mode 100644
index e464a88..0000000
--- a/src/devices/hal.jd
+++ /dev/null
@@ -1,124 +0,0 @@
-page.title=The Hardware Abstraction Layer
-@jd:body
-
-<!--
- Copyright 2013 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.
--->
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<p>
- The hardware abstraction layer (HAL) defines a standard interface for hardware vendors to
- implement and allows Android to be agnostic about lower-level driver
- implementations. The HAL allows you to implement functionality
- without affecting or modifying the higher level system. HAL implementations
- are packaged into modules (<code>.so</code>) file and loaded by the Android
- system at the appropriate time.
-<h2 id="structure">
- Standard HAL structure
-</h2>
-<p>
- Each hardware-specific HAL interface has properties that are common to all HAL interfaces. These
- properties are defined in <code>hardware/libhardware/include/hardware/hardware.h</code> and
- guarantees that HALs have a predictable structure.
- This interface allows the Android system to load the correct versions of your
- HAL modules in a consistent way. There are two general components
- that a HAL interface consists of: a module and a device.
-</p>
-<p>
- A module represents your packaged HAL implementation, which is stored as a shared library (<code>.so file</code>). It contains
- metadata such as the version, name, and author of the module, which helps Android find and load it correctly. The
- <code>hardware/libhardware/include/hardware/hardware.h</code> header file defines a
- struct, <code>hw_module_t</code>, that represents a module and contains information such as
- the module version, author, and name.</p>
-
- <p>In addition, the <code>hw_module_t</code> struct contains
- a pointer to another struct, <code>hw_module_methods_t</code>, that contains a pointer to
- an "open" function for the module. This open function is used to initate communication with
- the hardware that the HAL is serving as an abstraction for. Each hardware-specific HAL usually
- extends the generic <code>hw_module_t</code> struct with additional information
- for that specific piece of hardware. For example in the camera HAL, the <code>camera_module_t</code> struct
- contains a <code>hw_module_t</code> struct along with other camera-specific function pointers:
-</p>
-
-<pre>
-typedef struct camera_module {
- hw_module_t common;
- int (*get_number_of_cameras)(void);
- int (*get_camera_info)(int camera_id, struct camera_info *info);
-} camera_module_t;
-</pre>
-
-<p>When you implement a HAL and create the module struct, you must name it
- <code>HAL_MODULE_INFO_SYM</code>. For instance, here is an example from the Galaxy Nexus audio HAL:</p>
-<pre>
-struct audio_module HAL_MODULE_INFO_SYM = {
- .common = {
- .tag = HARDWARE_MODULE_TAG,
- .module_api_version = AUDIO_MODULE_API_VERSION_0_1,
- .hal_api_version = HARDWARE_HAL_API_VERSION,
- .id = AUDIO_HARDWARE_MODULE_ID,
- .name = "Tuna audio HW HAL",
- .author = "The Android Open Source Project",
- .methods = &hal_module_methods,
- },
-};
-</pre>
-<p>
- A device abstracts the actual hardware of your product. For example, an audio module can contain
- a primary audio device, a USB audio device, or a Bluetooth A2DP audio device. A device
- is represented by the <code>hw_device_t</code> struct. Like a module, each type of device
- defines a more-detailed version of the generic <code>hw_device_t</code> that contains
- function pointers for specific features of the hardware. For example, the
- <code>audio_hw_device_t</code> struct type contains function pointers to audio device operations:
-</p>
-
-<pre>
-struct audio_hw_device {
- struct hw_device_t common;
-
- /**
- * used by audio flinger to enumerate what devices are supported by
- * each audio_hw_device implementation.
- *
- * Return value is a bitmask of 1 or more values of audio_devices_t
- */
- uint32_t (*get_supported_devices)(const struct audio_hw_device *dev);
- ...
-};
-typedef struct audio_hw_device audio_hw_device_t;
-</pre>
-
-<p>
- In addition to these standard properties, each hardware-specific HAL interface can define more of its
- own features and requirements. See the <a href="{@docRoot}guide/reference/files.html">HAL reference documentation</a>
- as well as the individual instructions for each HAL for more information on how to implement a specific interface.
-</p>
-
-<h2 id="modules">HAL modules</h2>
-<p>HAL implementations are built into modules (<code>.so</code>) files and are dynamically linked by Android when appropriate.
- You can build your modules by creating <code>Android.mk</code> files for each of your HAL implementations
- and pointing to your source files. In general, your shared libraries must be named in a certain format, so that
- they can be found and loaded properly. The naming scheme varies slightly from module to module, but they follow
- the general pattern of: <code><module_type>.<device_name></code>.</p>
-
- <p>For more information about setting up the build for each HAL, see its respective documentation.</p>
-
-</p>
diff --git a/src/devices/images/ape_fwk_bluetooth.png b/src/devices/images/ape_fwk_bluetooth.png
index c79fe5b..7a8ba54 100644
--- a/src/devices/images/ape_fwk_bluetooth.png
+++ b/src/devices/images/ape_fwk_bluetooth.png
Binary files differ
diff --git a/src/devices/index.jd b/src/devices/index.jd
index a09d10c..07687de 100644
--- a/src/devices/index.jd
+++ b/src/devices/index.jd
@@ -121,7 +121,7 @@
<p>In addition, the <code>hw_module_t</code> struct contains
a pointer to another struct, <code>hw_module_methods_t</code>, that contains a pointer to
- an "open" function for the module. This open function is used to initate communication with
+ an "open" function for the module. This open function is used to initiate communication with
the hardware that the HAL is serving as an abstraction for. Each hardware-specific HAL usually
extends the generic <code>hw_module_t</code> struct with additional information
for that specific piece of hardware. For example in the camera HAL, the <code>camera_module_t</code> struct
@@ -195,7 +195,7 @@
<p>
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 wake locks (a memory management system that is more agressive in
+such as wake locks (a memory management system that is more aggressive in
preserving memory), 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.
diff --git a/src/devices/input/getevent.jd b/src/devices/input/getevent.jd
index 8bf4093..3717f63 100644
--- a/src/devices/input/getevent.jd
+++ b/src/devices/input/getevent.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,9 +16,17 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>The <code>getevent</code> tool runs on the device and provides information about input
devices and a live dump of kernel input events.</p>
-<p>It is very useful tool for ensuring that device drivers are reporing the
+<p>It is very useful tool for ensuring that device drivers are reporting the
expected set of capabilities for each input device and are generating the
desired stream of input events.</p>
<h2 id="usage">Usage</h2>
diff --git a/src/devices/input/input-device-configuration-files.jd b/src/devices/input/input-device-configuration-files.jd
index 877053c..ffe9ba4 100644
--- a/src/devices/input/input-device-configuration-files.jd
+++ b/src/devices/input/input-device-configuration-files.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Input device configuration files (<code>.idc</code> files) contain device-specific
configuration properties that affect the behavior of input devices.</p>
<p>Input device configuration files are typically not necessary for standard
diff --git a/src/devices/input/key-character-map-files.jd b/src/devices/input/key-character-map-files.jd
index 6872cdb..aa9ff88 100644
--- a/src/devices/input/key-character-map-files.jd
+++ b/src/devices/input/key-character-map-files.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Key character map files (<code>.kcm</code> files) are responsible for mapping combinations
of Android key codes with modifiers to Unicode characters.</p>
<p>Device-specific key layout files are <em>required</em> for all internal (built-in)
@@ -56,7 +64,7 @@
(see <code>KeyCharacterMap.VIRTUAL_KEYBOARD</code>). It is present on all Android devices
beginning with Android Honeycomb 3.0. The purpose of the virtual keyboard device
is to provide a known built-in input device that can be used for injecting
-keystokes into applications by the IME or by test instrumentation, even
+keystrokes into applications by the IME or by test instrumentation, even
for devices that do not have built-in keyboards.</p>
<p>The virtual keyboard is assumed to have a full QWERTY layout that is the
same on all devices. This makes it possible for applications to inject
diff --git a/src/devices/input/key-layout-files.jd b/src/devices/input/key-layout-files.jd
index d353d08..2b7cd53 100644
--- a/src/devices/input/key-layout-files.jd
+++ b/src/devices/input/key-layout-files.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Key layout files (<code>.kl</code> files) are responsible for mapping Linux key codes
and axis codes to Android key codes and axis codes and specifying associated
policy flags.</p>
diff --git a/src/devices/input/keyboard-devices.jd b/src/devices/input/keyboard-devices.jd
index 74bafaa..821e201 100644
--- a/src/devices/input/keyboard-devices.jd
+++ b/src/devices/input/keyboard-devices.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,10 +16,18 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Android supports a variety of keyboard devices including special function
keypads (volume and power controls), compact embedded QWERTY keyboards,
and fully featured PC-style external keyboards.</p>
-<p>This document decribes physical keyboards only. Refer to the Android SDK
+<p>This document describes physical keyboards only. Refer to the Android SDK
for information about soft keyboards (Input Method Editors).</p>
<h2 id="keyboard-classification">Keyboard Classification</h2>
<p>An input device is classified as a keyboard if either of the following
diff --git a/src/devices/input/overview.jd b/src/devices/input/overview.jd
index 118fabf..44091cf 100644
--- a/src/devices/input/overview.jd
+++ b/src/devices/input/overview.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>The Android input subsystem nominally consists of an event pipeline
that traverses multiple layers of the system.</p>
<h2 id="input-pipeline">Input Pipeline</h2>
@@ -173,7 +181,7 @@
using constants that begin with the prefix <code>SW_</code>. The Linux
kernel input drivers report switch state changes as <code>EV_SW</code> events.</p>
<p>Android applications generally do not receive events from switches,
-but the system may use them interally to control various
+but the system may use them internally to control various
device-specific functions.</p>
</dd>
<dt>Android Key Code</dt>
diff --git a/src/devices/input/touch-devices.jd b/src/devices/input/touch-devices.jd
index 298ba15..4a4b6d7 100644
--- a/src/devices/input/touch-devices.jd
+++ b/src/devices/input/touch-devices.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Android supports a variety of touch screens and touch pads, including
stylus-based digitizer tablets.</p>
<p>Touch screens are touch devices that are associated with a display such that
@@ -418,7 +426,7 @@
<p>Reporting tilt information is <em>optional</em> but recommended for stylus devices.</p>
</li>
<li>
-<p>If the tool type is reported by <code>ABS_MT_TOOL_TYPE</code>, it will supercede any tool
+<p>If the tool type is reported by <code>ABS_MT_TOOL_TYPE</code>, it will supersede any tool
type information reported by <code>BTN_TOOL_*</code>.
If no tool type information is available at all, the tool type defaults to
<code>MotionEvent.TOOL_TYPE_FINGER</code>.</p>
diff --git a/src/devices/input/validate-keymaps.jd b/src/devices/input/validate-keymaps.jd
index 6a907a1..4a099d4 100644
--- a/src/devices/input/validate-keymaps.jd
+++ b/src/devices/input/validate-keymaps.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>The Android framework has a small tool called <code>validatekeymaps</code> to validate the
syntax of input device configuration files, key layout files, key character
maps files and virtual key definition files.</p>
diff --git a/src/devices/sensors/sensor-types.jd b/src/devices/sensors/sensor-types.jd
index 7ebac25..add3796 100644
--- a/src/devices/sensors/sensor-types.jd
+++ b/src/devices/sensors/sensor-types.jd
@@ -247,7 +247,7 @@
<ul>
<li> For example, the power consumption of a game rotation vector is probably equal
to the sum of the power consumptions of: the accelerometer chip, the gyroscope
- chip, the chip processing the data, and the busses transporting the data. </li>
+ chip, the chip processing the data, and the buses transporting the data. </li>
<li> As another example, the drift of a game rotation vector will depend as much on
the quality of the calibration algorithm as on the physical sensor
characteristics. </li>
@@ -608,7 +608,7 @@
Gyroscope</p>
<p>Reporting-mode: <em><a href="report-modes.html#continuous">Continuous</a></em></p>
<p><code>getDefaultSensor(SENSOR_TYPE_ORIENTATION)</code> <em>returns a non-wake-up sensor</em></p>
-<p>Note: This is an older sensor type that has been deprecated in the Android SDK.
+<p class="note"><strong>Note:</strong> This is an older sensor type that has been deprecated in the Android SDK.
It has been replaced by the rotation vector sensor, which is more clearly
defined. Use the rotation vector sensor over the orientation sensor whenever
possible.</p>
diff --git a/src/devices/sensors/versioning.jd b/src/devices/sensors/versioning.jd
index 130c58c..8fb2af0 100644
--- a/src/devices/sensors/versioning.jd
+++ b/src/devices/sensors/versioning.jd
@@ -129,12 +129,12 @@
<p>For continuous sensors, set it to the maximum sampling period allowed in
microseconds.</p>
-<p>Note:</p>
+<p>The following are applicable for <code>period_ns</code>, <code>maxDelay</code>, and <code>minDelay</code>:</p>
<ul>
<li><code>period_ns</code> is in nanoseconds whereas
<code>maxDelay</code>/<code>minDelay</code> are in microseconds.</li>
-<li><code>maxDelay </code>should always fit within a 32-bit signed integer. It
-is declared as 64 bit on 64 bit architectures only for binary compatibility reasons.</li>
+<li><code>maxDelay</code> should always fit within a 32-bit signed integer. It
+is declared as 64-bit on 64-bit architectures only for binary compatibility reasons.</li>
</ul>
<p><em>flags</em>: This field defines the reporting mode of the sensor and whether the sensor is
diff --git a/src/devices/tech/admin/images/multi-user-perms.png b/src/devices/tech/admin/images/multi-user-perms.png
new file mode 100644
index 0000000..f955ddc
--- /dev/null
+++ b/src/devices/tech/admin/images/multi-user-perms.png
Binary files differ
diff --git a/src/devices/tech/admin/implement.jd b/src/devices/tech/admin/implement.jd
new file mode 100644
index 0000000..03ce93c
--- /dev/null
+++ b/src/devices/tech/admin/implement.jd
@@ -0,0 +1,147 @@
+page.title=Implementing Device Administration
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>This page walks you through the many features in Android 5.0 and higher
+platform release that need to be enabled and validated on devices to make them
+ready for managed profile and device owner user cases that are essential to using
+them in a corporate environment. In addition to the related Android Open Source
+Project (AOSP) code, there are a number of additional components required for a
+device to function with managed profiles.</p>
+
+<h2 id=requirements>Requirements</h2>
+
+<p>The following uses-feature need to be defined:</p>
+
+<pre>
+android.software.managed_users
+android.software.device_admin
+</pre>
+
+<p>Confirm with: <code>adb shell pm list features</code></p>
+
+<p>It should not be a low-RAM device, meaning <code>ro.config.low_ram</code>
+should not be defined. The framework automatically limits the number of users
+to 1 when the <code>low_ram</code> flag is defined.</p>
+
+<p>By default, only applications that are essential for correct operation of the
+profile should be enabled as part of provisioning a managed device.</p>
+
+<p>OEMs must ensure the managed profile or device has all required applications by
+modifying:</p>
+
+<pre>
+vendor_required_apps_managed_profile.xml
+vendor_required_apps_managed_device.xml
+</pre>
+
+<p>Here are examples from a Nexus device:</p>
+
+<code>packages/apps/ManagedProvisioning/res/values/vendor_required_apps_managed_device.xml</code>
+
+<pre>
+<resources>
+ <!-- A list of apps to be retained on the managed device -->
+ <string-array name="vendor_required_apps_managed_device">
+ <item>com.android.vending</item> <!--Google Play -->
+ <item>com.google.android.gms</item> <!--Required by Play -->
+ <item>com.google.android.contacts</item> <!--Google or OEM Contacts-->
+ <item>com.google.android.googlequicksearchbox</item> <!--Google Launcher -->
+ <item>com.google.android.launcher</item> <!--Google Launcher or OEM Launcher -->
+ <item>com.google.android.dialer</item> <!--Google or OEM dialer to enable making phone calls -->
+ </string-array>
+</resources>
+</pre>
+
+<code>
+packages/apps/ManagedProvisioning/res/values/vendor_required_apps_managed_profile.xml
+</code>
+
+<pre>
+<resources>
+ <!-- A list of apps to be retained in the managed profile. This includes any Google experience apps required. -->
+ <string-array name="vendor_required_apps_managed_profile">
+ <item>com.android.vending</item> <!-- Google Play -->
+ <item>com.google.android.gms</item> <!-- Required by Play -->
+ <item>com.google.android.contacts</item> <!-- Google or OEM Contacts -->
+ </string-array>
+</resources>
+</pre>
+
+<h3 id=launcher>Launcher</h3>
+
+<p>The launcher must support badging applications with the icon badge provided
+in the Android Open Source Project (AOSP) to represent the managed applications
+and other badge user interface elements such as recents and notifications.</p>
+
+<p>Update the Launcher to support badging. If you use <a
+href="https://android.googlesource.com/platform/packages/apps/Launcher3/">launcher3</a>
+in AOSP as-is, then you likely already support this badging feature.
+</p>
+
+<h3 id=nfc>NFC</h3>
+
+<p>On devices with NFC, NFC must be enabled in the Android Setup Wizard and
+configured to accept managed provisioning intents:</p>
+
+<code>packages/apps/Nfc/res/values/provisioning.xml</code>
+
+<pre>
+<bool name="enable_nfc_provisioning">true</bool>
+<item>application/com.android.managedprovisioning</item>
+</pre>
+
+<h3 id=setup_wizard>Setup Wizard</h3>
+
+<p>The Android Setup Wizard needs to support device owner provisioning. When it
+opens, it needs to check if another process (such as device owner provisioning)
+has already finished the user setup. If this is the case, it needs to fire a
+home intent and finish the setup wizard. </p>
+
+<p>This intent will be caught by the provisioning application, which will then
+hand over control to the newly set device owner. This can be achieved by adding
+the following to your setup wizard’s main activity:</p>
+
+<pre>
+@Override
+ protected void onStart() {
+ super.onStart();
+
+ // When returning to a setup wizard activity, check to see if another setup process
+ // has intervened and, if so, complete an orderly exit
+ boolean completed = Settings.Secure.getInt(getContentResolver(),
+ Settings.Secure.USER_SETUP_COMPLETE, 0) != 0;
+ if (completed) {
+ startActivity(new Intent(Intent.ACTION_MAIN, null)
+ .addCategory(Intent.CATEGORY_HOME)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ | Intent.FLAG_ACTIVITY_CLEAR_TASK
+ | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED));
+ finish();
+ }
+
+ ...
+ }
+</pre>
diff --git a/src/devices/tech/admin/index.jd b/src/devices/tech/admin/index.jd
new file mode 100644
index 0000000..7798355
--- /dev/null
+++ b/src/devices/tech/admin/index.jd
@@ -0,0 +1,62 @@
+page.title=Device Administration
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>Devices running Android 5.0 and later with the managed_users feature
+declared can be used in a <a href="http://www.android.com/work/">corporate
+environment</a> under the auspices of each company’s information technology (IT)
+department. This is possible with the introduction of <a href="multi-user.html">multiple
+users</a>, <a href="managed-profiles.html">managed profiles</a>, and enterprise
+mobility management (EMM) applications, as well as enhancements to default
+<a
+href="{@docRoot}devices/tech/security/encryption/index.html">encryption</a>,
+<a
+href="{@docRoot}devices/tech/security/verifiedboot/index.html">verified
+boot</a>, and <a
+href="{@docRoot}devices/tech/security/selinux/index.html">SELinux</a>.</p>
+
+<p>With these enhancements, either users or their IT departments may create
+managed profiles that separate corporate employer data from personal user
+information. Follow the documents within this section of the site to properly
+implement corporate device administration.</p>
+
+<h2 id=summary>Summary</h2>
+
+<p>Follow this flow to employ device administration:</p>
+
+<ol>
+ <li>Gain an understanding of key concepts, such as <a
+href="multi-user.html">multiple users</a> and <a
+href="managed-profiles.html">managed profiles</a>.
+ <li><a href="implement.html">Implement device administration</a> via custom
+overlay files.
+ <li><a href="testing-setup.html">Test</a> and validate your devices with EMM providers and applications.
+</ol>
+
+<h2 id=supporting_documentation>Supporting documentation</h2>
+
+<p><a href="http://developer.android.com/guide/topics/admin/device-admin.html">Device Administration API</a></p>
+
+<p><a href="https://developer.android.com/training/enterprise/index.html">Building Apps for Work</a></p>
diff --git a/src/devices/tech/admin/managed-profiles.jd b/src/devices/tech/admin/managed-profiles.jd
new file mode 100644
index 0000000..483fbe4
--- /dev/null
+++ b/src/devices/tech/admin/managed-profiles.jd
@@ -0,0 +1,172 @@
+page.title=Employing Managed Profiles
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>A <em>managed profile</em> or <em>work profile</em> is an Android <a
+href="multi-user.html">user</a> with some additional special properties around
+management and visual aesthetic.</p>
+
+<h2 id=purpose>DevicePolicyManager APIs</h2>
+
+<p>Android 5.x or newer offers a greatly improved DevicePolicyManager with dozens of new
+APIs to support both corporate-owned and bring your own device (BYOD)
+administration use cases. Examples include app restrictions, silent
+installation of certificates, and cross-profile sharing intent access control.
+You may use the sample Device Policy Client (DPC) app, <a
+href="https://developer.android.com/samples/BasicManagedProfile/index.html">BasicManagedProfile.apk</a>,
+as a starting point. See <a
+href="https://developer.android.com/training/enterprise/work-policy-ctrl.html">Building
+a Work Policy Controller</a> for additional details.
+
+<h2 id=purpose>Purpose</h2>
+
+<p>The primary goal of a managed profile is to create a segregated and secure
+space for managed (for example, corporate) data to reside. The administrator of
+the profile has full control over scope, ingress, and egress of data as well as
+its lifetime. These policies offer great powers and therefore fall upon the
+managed profile instead of the device administrator.</p>
+
+<ul>
+ <li><strong>Creation</strong> - Managed profiles can be created by any application in the primary user. The
+user is notified of managed profile behaviors and policy enforcement before
+creation.
+ <li><strong>Management</strong> - Management is performed by applications that programmatically invoke APIs in
+the <a href="http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html">DevicePolicyManager</a> class to restrict use. Such applications are referred to as <em>profile owners</em> and are defined at initial profile setup. Policies unique to managed profile
+involve app restrictions, updatability, and intent behaviors.
+ <li><strong>Visual treatment</strong> - Applications, notifications, and widgets from the managed profile are always
+badged and typically made available inline with user interface (UI) elements
+from the primary user.
+</ul>
+
+<h2 id=data_segregation>Data Segregation </h2>
+
+<h3 id=applications>Applications</h3>
+
+<p>Applications are scoped with their own segregated data when the same app exists
+in the primary user and managed profile. Generally, applications cannot
+communicate directly with one another across the profile-user boundary and act
+independently of one another.</p>
+
+<h3 id=accounts>Accounts</h3>
+
+<p>Accounts in the managed profile are distinctly unique from the primary user.
+There is no way to access credentials across the profile-user boundary. Only
+apps in their respective context are able to access their respective accounts.</p>
+
+<h3 id=intents>Intents</h3>
+
+<p>The administrator controls whether intents are resolved in/out of managed
+profile or not. Applications from the managed profile are default scoped to
+stay within the managed profile exception of the Device Policy API.</p>
+
+<h3 id=settings>Settings</h3>
+
+<p>Enforcement of settings is generally scoped to the managed profile with a few
+exceptions. Specifically, lockscreen and encryption settings are still scoped
+to the device and shared between the primary user and managed profile.
+Otherwise, a profile owner does not have any device administrator privileges
+outside the managed profile.</p>
+
+<p>Managed profiles are implemented as a new kind of secondary user, such that:</p>
+
+<pre>
+uid = 10000 * userid + appid
+</pre>
+
+
+<p>They have separate app data like regular users:</p>
+
+<pre>
+/data/user/<userid>
+</pre>
+
+<p>The UserId is calculated for all system requests using <code>Binder.getCallingUid()</code>, and all system state and responses are separated by userId. You may consider
+instead using <code>Binder.getCallingUserHandle</code> rather than <code>getCallingUid</code> to avoid confusion between uid and userId.</p>
+
+<p>The AccountManagerService maintains a separate list of accounts for each user.</p>
+
+<p>The main differences between a managed profile and a regular secondary user are
+as follows:</p>
+
+<ul>
+ <li> The managed profile is associated with its parent user and started alongside
+the primary user at boot time.
+ <li> Notifications for managed profiles are enabled by ActivityManagerService
+allowing the managed profile to share the activity stack with the primary user.
+ <li> Some other system services shared are: IME, A11Y services, Wi-Fi, and NFC.
+ <li> New Launcher APIs allow launchers to display badged apps and whitelisted
+widgets from the managed profile alongside apps in the primary profile without
+switching users.
+</ul>
+
+<h2 id=device_administration>Device administration</h2>
+
+<p>Android device administration includes two new types of device administrators for
+enterprises:</p>
+
+<ul>
+ <li><em>Profile owner</em>—Designed for bring your own device (BYOD) environments
+ <li><em>Device Owner</em>—Designed for corp-liable environments
+</ul>
+
+<p>The majority of the new device administrator APIs that have been added for
+Android 5.0 are available only to profile or device owners. Traditional device
+administrators remain but are applicable to the simpler consumer-only case
+(e.g. find my device).</p>
+
+<h3 id=profile_owners>Profile owners</h3>
+
+<p>A Device Policy Client (DPC) app typically functions as the profile owner. The
+DPC app is typically provided by an enterprise mobility management (EMM)
+partner, such as Google Apps Device Policy.</p>
+
+<p>The profile owner app creates a managed profile on the device by sending the
+<code>ACTION_PROVISION_MANAGED_PROFILE</code> intent. This profile is
+distinguished by the appearance of badged instances of
+apps, as well as personal instances. That badge, or Android device
+administration icon, identifies which apps are work apps.</p>
+
+<p>The EMM has control only over the managed profile (not personal space) with some
+exceptions, such as enforcing the lock screen.</p>
+
+<h3 id=device_owners>Device owners</h3>
+
+<p>The device owner can be set only in an unprovisioned device:</p>
+
+<ul>
+ <li>Can be provisioned only at initial device setup
+ <li>Enforced disclosure always displayed in quick-settings
+</ul>
+
+<p>Device owners can conduct some tasks profile owners cannot, and here are a few examples:</p>
+
+<ul>
+ <li>Wipe device data
+ <li>Disable Wi-Fi/ BT
+ <li>Control <code>setGlobalSetting</code>
+ <li><code>setLockTaskPackages</code> (the ability to whitelist packages that can pin themselves to the foreground)
+ <li>Set <code>DISALLOW_MOUNT_PHYSICAL_MEDIA</code> (<code>FALSE</code> by default.
+When <code>TRUE</code>, physical media, both portable and adoptable, cannot be mounted.)
+</ul>
diff --git a/src/devices/tech/admin/multi-user.jd b/src/devices/tech/admin/multi-user.jd
new file mode 100644
index 0000000..8319be0
--- /dev/null
+++ b/src/devices/tech/admin/multi-user.jd
@@ -0,0 +1,162 @@
+page.title=Supporting Multiple Users
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>This document describes the Android multi-user feature. It allows more than one
+user on a single Android device by separating their accounts and application
+data. For instance, parents may let their children use the family tablet. Or a
+critical team might share a mobile device for on-call duty.</p>
+
+<h1 id=definitions>Definitions</h1>
+
+<p>Before supporting multiple Android users, you should understand the basic
+concepts involved. Here are the primary terms used when describing Android
+users and accounts:</p>
+
+<ul>
+ <li><em>User</em> - Each user is intended to be used by a different physical person. Each user
+has distinct application data and some unique settings, as well as a user
+interface to explicitly switch between users. A user can run in the background
+when another user is active; the system manages shutting down users to conserve
+resources when appropriate. Secondary users can be created either directly via
+the primary user interface or from a <a
+href="https://developer.android.com/guide/topics/admin/device-admin.html">Device
+Administration</a> application.
+ <li><em>Account</em> - Accounts are contained within a user but are not defined by a user. Nor is a
+user defined by or linked to any given account. Users and profiles contain
+their own unique accounts but are not required to have accounts to be
+functional. The list of accounts differs by user. See the <a href="https://developer.android.com/reference/android/accounts/Account.html">Account class</a> definition.
+ <li><em>Profile<strong></em> </strong>- A profile has separated app data but shares some system-wide settings (for
+example, Wi-Fi and Bluetooth). A profile is a subset of and tied to the
+existence of a user. A user can have multiple profiles. They are created
+through a <a href="https://developer.android.com/guide/topics/admin/device-admin.html">Device
+Administration</a> application. A profile always has an immutable
+association to a ‘parent’ user, defined by the user that created the profile.
+Profiles do not live beyond the lifetime of the creating user.
+ <li><em>App</em> - An application’s data exists within each associated user. App data is
+sandboxed from other applications within the same user. Apps within the same
+user can interact with each other via IPC. See <a href="https://developer.android.com/training/enterprise/index.html">Building Apps for Work</a>.
+</ul>
+
+<h2 id=user_types>User types</h2>
+
+<ul>
+ <li><em>Primary</em> - The first user added to a device. The primary user cannot be removed except
+by factory reset. This user also has some special privileges and settings only
+it can set. The primary user is always running even when other users are in the
+foreground.
+ <li><em>Secondary</em> - Any user added to the device other than the primary user. They can be
+removed by either themselves or the primary user and cannot impact other users
+on a device. Secondary users can run in the background and will continue to
+have network connectivity when they do.
+ <li><em>Guest<strong></em> </strong>- A guest user is a temporary secondary user with an explicit option to quick
+delete the guest user when its usefulness is over. There can be only one guest
+user at a time.
+</ul>
+
+<h2 id=profile_types>Profile types</h2>
+
+<ul>
+ <li><em>Managed<strong></em> </strong>- Managed profiles are created by an application to contain work data and
+apps. They are managed exclusively by the ‘profile owner’, the app who created
+the corp profile. Launcher, notifications and recent tasks are shared by the
+primary user and the corp profile.
+ <li><em>Restricted</em> - Restricted profiles use the accounts based off the primary user. The Primary
+user can control what apps are available on the restricted profile. Restricted
+profiles are available only on tablets.
+</ul>
+
+<h1 id=effects>Effects</h1>
+
+<p>When users are added to a device, some functionality will be curtailed when
+another user is in the foreground. Since app data is separated by user, the
+state of those apps differs by user. For example, email destined for an account
+of a user not currently in focus won’t be available until that user and account
+are active on the device.</p>
+
+<p>The default state is only the primary user has full access to phone calls and
+texts. The secondary user may receive inbound calls but cannot send or receive
+texts. The primary user must enable these functions for others.</p>
+
+ <p class="note"><strong>Note</strong>: To enable or disable the phone and SMS functions for a secondary user, go to
+Settings > Users, select the user, and switch the <em>Allow phone calls and SMS</em> setting to off.</p>
+
+<p>Please note, some restrictions exist when a secondary user is in background.
+For instance, the background secondary user will not be able to display the
+user interface or make Bluetooth services active. Finally, background secondary
+users will be halted by the system process if the device needs additional
+memory for operations in the foreground user.</p>
+
+<p>Here are aspects of behavior to keep in mind when employing multiple users on
+an Android device:</p>
+
+<ul>
+ <li>Notifications appear for all accounts of a single user at once.
+ <li>Notifications for other users do not appear until they are active.
+ <li>Each user gets his or her own workspace to install and place apps.
+ <li>No user has access to the app data of another user.
+ <li>Any user can affect the installed apps for all users.
+ <li>The primary user can remove apps or even the entire workspace established by
+secondary users.
+</ul>
+
+<h1 id=implementation>Implementation</h1>
+
+<h2 id=managing_users>Managing users</h2>
+
+<p>Management of users and profiles (with the exception of restricted profiles) is
+performed by applications that programmatically invoke API in the <code>DevicePolicyManager</code> class to restrict use.</p>
+
+<p>Schools and enterprises may employ users and profiles to manage the lifetime
+and scope of apps and data on devices. They may use the types outlined above in
+conjunction with the <a href="http://developer.android.com/reference/android/os/UserManager.html">UserManager API</a> to build unique solutions tailored to their use cases.</p>
+
+<h2 id=applying_the_overlay>Applying the overlay</h2>
+
+<p>The multi-user feature is disabled by default in the Android 5.0 release. To
+enable it, device manufacturers must define a resource overlay that replaces
+the following values in frameworks/base/core/res/res/values/config.xml:</p>
+
+<pre>
+<!-- Maximum number of supported users -->
+<integer name="config_multiuserMaximumUsers">1</integer>
+<!-- Whether Multiuser UI should be shown -->
+<bool name="config_enableMultiUserUI">false</bool>
+</pre>
+
+<p>To apply this overlay and enable guest and secondary users on the device, use the
+<code>DEVICE_PACKAGE_OVERLAYS</code> feature of the Android build system to:</p>
+
+<ul>
+ <li> Replace the value for <code>config_multiuserMaximumUsers</code> with one greater than 1
+ <li> Replace the value of <code>config_enableMultiUserUI</code> with: <code>true</code>
+</ul>
+
+<p>Device manufacturers may decide upon the maximum number of users.</p>
+
+<p>That said, if device manufacturers or others have modified settings, they need
+to ensure SMS and telephony work as defined in the <a
+href="{@docRoot}compatibility/android-cdd.pdf">Android Compatibility Definition
+Document</a> (CDD).</p>
diff --git a/src/devices/tech/admin/multiuser-apps.jd b/src/devices/tech/admin/multiuser-apps.jd
new file mode 100644
index 0000000..6577bcf
--- /dev/null
+++ b/src/devices/tech/admin/multiuser-apps.jd
@@ -0,0 +1,104 @@
+page.title=Building Multiuser-Aware Apps
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>When a device supports <a href="multi-user.html">multiple users</a>, its apps must be made aware of these distinct users.</p>
+
+<p>Certain apps need to have some components run as singletons and can accept
+requests from any user. Only system apps can currently use this feature.</p>
+
+<p>This facility:</p>
+
+<ul>
+ <li>Conserves resources
+ <li>Arbitrates one or more shared resources across users
+ <li>Reduces network overhead by using a single server connection
+</ul>
+
+<p>See the diagram below for a depiction of permissions flow with multiple users.</p>
+
+<p><img src="images/multi-user-perms.png" alt="Multiple users permissions flow" />
+<p class="img-caption"><strong>Figure 1.</strong> Multiple users permissions</p>
+
+<h2 id=enabling_a_singleton_component>Enabling a singleton component</h2>
+
+<p>To identify an app as a singleton, Add <code>android:singleUser=”true”</code> to your service or provider in the Android manifest.</p>
+
+<p>The system will instantiate that component in the process running as user 0
+only. Any requests to connect to that provider or service from any user will be
+routed to the process in user 0. If this is the only component in your app,
+only one instance of your app will run.</p>
+
+<p>Activities in your package will still be launched in a separate process for
+each user, with the UID being in the UID range for that user (such as 1010034).</p>
+
+<h2 id=interacting_with_users>Interacting with users</h2>
+
+<h3 id=perms_required>Set permissions</h3>
+
+<p>These permissions are required</p>
+
+<pre>
+INTERACT_ACROSS_USERS (signature|system)
+INTERACT_ACROSS_USERS_FULL (signature)
+</pre>
+
+<h3 id=apis>Employ APIs</h3>
+
+<p>Use the following APIs to make apps aware of multiple users.</p>
+
+<ol>
+ <li> Extract the user handle from incoming Binder calls:
+ <ul>
+ <li> <code>int userHandle = UserHandle.getCallingUserId()</code>
+ </ul>
+ <li> Use new, protected APIs to start services, activities, broadcasts on a specific
+user:
+ <ul>
+ <li><code>Context.startActivityAsUser(Intent, UserHandle)</code>
+ <li><code>Context.bindServiceAsUser(Intent, …, UserHandle)</code>
+ <li><code>Context.sendBroadcastAsUser(Intent, … , UserHandle)</code>
+ <li><code>Context.startServiceAsUser(Intent, …, UserHandle)
+UserHandle</code> can be an explicit user or one of the special handles: <code>UserHandle.CURRENT</code> or <code>UserHandle.ALL</code>. <code>CURRENT</code> indicates the user that is currently in the foreground. You can use <code>ALL</code> when you want to send a broadcast to all users.
+ </ul>
+ <li>Communicate with components in your own app:
+<code>(INTERACT_ACROSS_USERS)</code>
+Or with components in other apps:
+<code>(INTERACT_ACROSS_USERS_FULL)</code>
+ <li>You may need to create proxy components that run in the user’s process that
+then access the <code>singleUser</code> component in user 0.
+ <li>Query users and their handles with the new <code>UserManager</code> system service:
+ <ul>
+ <li><code>UserManager.getUsers()</code>
+ <li><code>UserManager.getUserInfo()</code>
+ <li><code>UserManager.supportsMultipleUsers()</code>
+ <li><code>UserManager.getUserSerialNumber(int userHandle)</code> - a non-recycled number that corresponds to a user handle.
+ <li><code>UserManager.getUserHandle(int serialNumber)</code>
+ <li><code>UserManager.getUserProfiles() </code>- returns the collection of self and managed profiles, if any.
+ </ul>
+ <li>Register to listen to specific or all users and the callbacks with new APIs on
+ContentObserver, PackageMonitor, BroadcastReceiver that provide additional
+information about which user has caused the callback.
+</ol>
diff --git a/src/devices/tech/admin/provision.jd b/src/devices/tech/admin/provision.jd
new file mode 100644
index 0000000..a1b20bc
--- /dev/null
+++ b/src/devices/tech/admin/provision.jd
@@ -0,0 +1,171 @@
+page.title=Provisioning for Device Administration
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>This page describes the process for deploying devices to corporate users.</p>
+
+<p>Device owner provisioning can be accomplished over NFC or with an activation
+code. See <a href="implement.html">Implementing Device Administration</a> for
+the complete list of requirements.</p>
+
+<p>Download the <a
+href="https://github.com/googlesamples/android-NfcProvisioning">NfcProvisioning
+APK</a> and <a
+href="https://github.com/googlesamples/android-DeviceOwner">Android-DeviceOwner
+APK</a>.</p>
+
+<p class="caution"><strong>Caution:</strong> If provisioning has already
+started, affected devices will first need to be factory reset.</p>
+
+<h2 id=managed_provisioning>Managed Provisioning</h2>
+
+<p>Managed Provisioning is a framework UI flow to ensure users are adequately
+informed of the implications of setting a device owner or managed profile. You can
+think of it as a setup wizard for managed profiles.</p>
+
+<p class="note"><strong>Note:</strong> Remember, the device owner can be set
+only from an unprovisioned device. If
+<code>Settings.Secure.USER_SETUP_COMPLETE</code> has ever been set, then the
+device is considered provisioned & device owner cannot be set.</p>
+
+<p>Please note, devices that enable default encryption offer considerably
+simpler/quicker device administration provisioning flow. The managed provisioning
+component:</p>
+
+<ul>
+ <li>Encrypts the device</li>
+ <li>Creates the managed profile</li>
+ <li>Disables non-required applications</li>
+ <li>Sets the enterprise mobility management (EMM) app as profile owner</li>
+</ul>
+
+<p>In turn, the EMM app:</p>
+
+<ul>
+ <li>Adds user accounts</li>
+ <li>Enforces device compliance</li>
+ <li>Enables any additional system applications</li>
+</ul>
+
+<p>In this flow, managed provisioning triggers device encryption. The framework
+ copies the EMM app into the managed profile as part of managed provisioning.
+ The instance of the EMM app inside of the managed profile gets a callback from the
+framework when provisioning is done.</p>
+
+<p>The EMM can then add accounts and enforce policies; it then calls
+<code>setProfileEnabled()</code>, which makes the launcher icons visible.</p>
+
+<h2 id=profile_owner_provisioning>Profile Owner Provisioning</h2>
+
+<p>Profile owner provisioning assumes the user of the device oversees its
+management (and not a company IT department). To enable, profile owner
+provisioning, you must send an intent with appropriate extras. See the <a href="https://developer.android.com/samples/BasicManagedProfile/index.html">BasicManagedProfile.apk</a> for an example.</p>
+
+<p>Mobile Device Management (MDM) applications trigger the creation of the managed
+profile by sending an intent with action:</p>
+
+<p><a href="https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/admin/DevicePolicyManager.java">DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE</a></p>
+
+<p>Here is a sample intent that will trigger the creation of the managed profile
+and set the DeviceAdminSample as the profile owner:</p>
+
+<pre>
+adb shell am start -a android.app.action.PROVISION_MANAGED_PROFILE \
+ -c android.intent.category.DEFAULT \
+ -e wifiSsid $(printf '%q' \"GoogleGuest\") \
+ -e deviceAdminPackage "com.google.android.deviceadminsample" \
+ -e android.app.extra.deviceAdminPackageName $(printf '%q'
+ .DeviceAdminSample\$DeviceAdminSampleReceiver) \
+ -e android.app.extra.DEFAULT_MANAGED_PROFILE_NAME "My Organisation"
+</pre>
+
+<h2 id=device_owner_provisioning_via_nfc>Device Owner Provisioning via NFC</h2>
+
+<p>Device owner provisioning via NFC is similar to the profile owner method but
+requires more bootstrapping before managed provisioning.</p>
+
+<p>To use this method, <a href="http://developer.android.com/guide/topics/connectivity/nfc/nfc.html">NFC bump</a> the device from the first page of setup wizard (SUW). This offers a low-touch
+flow and configures Wi-Fi, installs the DPC, and sets the DPC as device owner.</p>
+
+<p>Here is the typical NFC bundle:</p>
+
+<pre>
+ EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
+ EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LOCATION
+ EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM
+ EXTRA_PROVISIONING_WIFI_SSID
+ EXTRA_PROVISIONING_WIFI_SECURITY_TYPE
+</pre>
+
+<p>The device must have NFC configured to accept the managed provisioning mimetype
+from SUW:</p>
+
+<pre>
+/packages/apps/Nfc/res/values/provisioning.xml
+
+ <bool name="enable_nfc_provisioning">true</bool>
+ <item>application/com.android.managedprovisioning</item>
+</pre>
+
+<h2 id=device_owner_provisioning_with_activation_code>Device Owner Provisioning with Activation Code</h2>
+
+<p>Select <em>Add Work Account</em> from the setup wizard. This triggers a
+lookup of the EMM from Android servers.</p>
+
+<p>The device installs the EMM app and starts provisioning flow. As an extra
+option, Android device administration supports the option of using email
+address with a six-digit activation code to bootstrap the process as part of
+setup wizard.</p>
+
+<h2 id=emm_benefits>EMM benefits</h2>
+
+<p>An EMM can help by conducting these tasks for you:</p>
+
+<ul>
+ <li>Provision managed profile
+ <li>Apply security policies
+ <ul>
+ <li>Set password complexity
+ <li>Lockdowns: disable screenshots, sharing from managed profile, etc.
+ </ul>
+ <li>Configure enterprise connectivity
+ <ul>
+ <li>Use WifiEnterpriseConfig to configure corporate Wi-Fi
+ <li>Configure VPN on the device
+ <li>Use DPM.setApplicationRestrictions() to configure corporate VPN
+ </ul>
+ <li>Enable corporate app Single Sign-On (SSO)
+ <ul>
+ <li>Install desired corporate apps
+ <li>Use DPM.installKeyPair()to silently install corp client certs
+ <li>Use DPM.setApplicationRestrictions() to configure hostnames, cert alias’ of
+corporate apps
+ </ul>
+</ul>
+
+<p>Managed provisioning is just one piece of the EMM end-to-end workflow, with the
+ end goal being to make corporate data accessible to apps in the managed profile.</p>
+
+<p>See <a href="testing-setup.html">Setting up Device Testing</a> for testing instructions.</p>
diff --git a/src/devices/tech/admin/testing-setup.jd b/src/devices/tech/admin/testing-setup.jd
new file mode 100644
index 0000000..678c04b
--- /dev/null
+++ b/src/devices/tech/admin/testing-setup.jd
@@ -0,0 +1,93 @@
+page.title=Setting up Device Testing
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>These are the essential elements that must exist for OEM devices to ensure
+minimal support for managed profiles:</p>
+
+<ul>
+ <li>Profile Owner as described in <a
+href="https://developer.android.com/training/enterprise/app-compatibility.html">Ensuring
+Compatibility with Managed Profiles</a>
+ <li>Device Owner
+ <li>Activation Code Provisioning
+ </ul>
+<p>See <a href="implement.html">Implementing Device Administration</a> for the complete list of requirements.</p>
+
+<h2 id=summary>Summary</h2>
+<p>To test your device administration features:</p>
+
+<ol>
+ <li>For device owner, use the <a
+href="https://developer.android.com/samples/BasicManagedProfile/index.html">BasicManagedProfile.apk</a>
+test app.
+ <li>Consider working with other enterprise mobility management (EMM) providers
+directly.
+</ol>
+
+<h2 id=set_up_the_device_owner_for_testing>Set up the device owner for testing</h2>
+<ol>
+ <li>Device MUST be built with <strong>userdebug</strong> or <strong>eng</strong> build.
+ </li>
+ <li>Factory reset the target device (and continue with the next steps in the
+ meantime).
+ </li>
+ <li>Download <a
+ href="http://developer.android.com/downloads/samples/BasicManagedProfile.zip">BasicManagedProfile.zip</a>. (Also see the <a
+ href="http://developer.android.com/samples/BasicManagedProfile/index.html">BasicManagedProfile</a> documentation.)</li>
+ <li>Unzip the file.
+ <li>Navigate (<code>cd</code>) to the unzipped directory.</li>
+ <li>If you don't have it, download the <a href="http://developer.android.com/sdk/index.html#Other">Android SDK Tools</a> package.</li>
+ <li>Create a file with the name <code>local.properties</code> containing the following single
+ line:<br>
+ <code>sdk.dir=<em><path to your android SDK folder></em></code><br>
+ <li>On Linux and Mac OS, run:<br>
+ <code>./gradlew assembleDebug</code><br>
+ Or on windows run:<br>
+ <code>gradlew.bat assembleDebug</code></li>
+ <li>If the build is unsuccessful because you have an outdated android SDK, run:<br>
+ <code><em><your android sdk folder></em>/tools/android update sdk -u -a</code></li>
+ <li>Wait for factory reset to complete if it hasn’t yet.<br>
+ <p class="Caution"><strong>Caution</strong>: Stay on the first screen
+ after factory reset and do not finish the setup wizard.</li>
+ <li>Install the BasicManagedProfile app by running the following command:<br>
+ <code>adb install ./Application/build/outputs/apk/Application-debug.apk </code>
+ </li>
+ <li>Set this app as the device owner by running this command:<br><code>$ adb shell am start -a
+ com.android.managedprovisioning.ACTION_PROVISION_MANAGED_DEVICE --es
+ android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME
+ com.example.android.basicmanagedprofile</code>
+ </li>
+ <li>Go through device owner setup on the device (encrypt, select Wi-Fi, etc.)</li>
+</ol>
+
+<h2 id=verify_the_device_owner_was_correctly_setup>Verify the device owner was correctly setup</h2>
+<ol>
+ <li>Go to <em>Settings > Security > Device Administrators</em>.
+ </li>
+ <li>Confirm the BasicManagedProfile is in the list and verify it cannot be
+ disabled. (This signifies it is a device owner.)
+ </li>
+</ol>
diff --git a/src/devices/tech/config/kernel.jd b/src/devices/tech/config/kernel.jd
index 8d5cf43..9db593e 100644
--- a/src/devices/tech/config/kernel.jd
+++ b/src/devices/tech/config/kernel.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,7 +16,18 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<p>The kernel configuration settings in this document are meant to be used as a base for an Android kernel configuration. All devices should have the options in android-base configuration enabled. While not mandatory, the options in android-recommended configuration enable advanced Android
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<p>The kernel configuration settings in this document are meant to be used as a
+base for an Android kernel configuration. All devices should have the options
+in android-base configuration enabled. While not mandatory, the options in
+android-recommended configuration enable advanced Android
features.</p>
<p>
@@ -29,7 +40,7 @@
This will generate a .config that can then be used to save a new defconfig or
compile a new kernel with Android features enabled.
</p>
-<h3>
+<h3 id="base">
Base Configuration
</h3>
<pre>
@@ -169,7 +180,7 @@
CONFIG_ANDROID_INTF_ALARM_DEV=y
</pre>
-<h3>Recommended Configuration</h3>
+<h3 id="recommended">Recommended Configuration</h3>
<pre>
CONFIG_PANIC_TIMEOUT=5
@@ -289,10 +300,16 @@
CONFIG_SCHED_TRACER=y
</pre>
-<h3>For USB host mode audio</h3>
+<h3 id="audio">For USB host mode audio</h3>
<pre>
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
# CONFIG_USB_AUDIO is for a peripheral mode (gadget) driver
</pre>
+
+<h3 id="midi">For USB host mode MIDI</h3>
+
+<pre>
+CONFIG_SND_USB_MIDI=y
+</pre>
diff --git a/src/devices/tech/dalvik/configure.jd b/src/devices/tech/dalvik/configure.jd
index 052c87f..be336ab 100644
--- a/src/devices/tech/dalvik/configure.jd
+++ b/src/devices/tech/dalvik/configure.jd
@@ -185,6 +185,15 @@
<pre><code>PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := --compiler-filter=interpret-only
$(call add-product-dex-preopt-module-config,services,--compiler-filter=space)</code></pre>
+<p>These flags can also be used to selectively disable pre-optimization of a
+particular module or package by specifying <code>$(call
+add-product-dex-preopt-module-config,<modules>,disable)</code> in a
+product's device.mk file.</p>
+
+<p>Example usage (in product’s device.mk):</p>
+
+<pre><code>$(call add-product-dex-preopt-module-config,Calculator,disable)</code></pre>
+
<h2 id=preloaded_classes_list>Preloaded Classes List</h2>
<p>The preloaded classes list is a list of classes the zygote will initialize on
diff --git a/src/devices/tech/dalvik/constraints.jd b/src/devices/tech/dalvik/constraints.jd
index 8ad6aac..c95bae0 100644
--- a/src/devices/tech/dalvik/constraints.jd
+++ b/src/devices/tech/dalvik/constraints.jd
@@ -231,7 +231,7 @@
</td>
<td>
- For each <code>type_id_item</code>, the <code>desciptor_idx</code> field must contain a valid
+ For each <code>type_id_item</code>, the <code>descriptor_idx</code> field must contain a valid
reference into the <code>string_ids</code> list. The referenced string must be a valid type
descriptor.
</td>
diff --git a/src/devices/tech/dalvik/dalvik-bytecode.jd b/src/devices/tech/dalvik/dalvik-bytecode.jd
index 5695440..f449bce 100644
--- a/src/devices/tech/dalvik/dalvik-bytecode.jd
+++ b/src/devices/tech/dalvik/dalvik-bytecode.jd
@@ -174,7 +174,7 @@
<td>nop</td>
<td> </td>
<td>Waste cycles.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
Data-bearing pseudo-instructions are tagged with this opcode, in which
case the high-order byte of the opcode unit indicates the nature of
the data. See "<code>packed-switch-payload</code> Format",
@@ -209,7 +209,7 @@
<td><code>A:</code> destination register pair (4 bits)<br/>
<code>B:</code> source register pair (4 bits)</td>
<td>Move the contents of one register-pair to another.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
It is legal to move from <code>v<i>N</i></code> to either
<code>v<i>N-1</i></code> or <code>v<i>N+1</i></code>, so implementations
must arrange for both halves of a register pair to be read before
@@ -222,7 +222,7 @@
<td><code>A:</code> destination register pair (8 bits)<br/>
<code>B:</code> source register pair (16 bits)</td>
<td>Move the contents of one register-pair to another.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
Implementation considerations are the same as <code>move-wide</code>,
above.</p>
</td>
@@ -233,7 +233,7 @@
<td><code>A:</code> destination register pair (16 bits)<br/>
<code>B:</code> source register pair (16 bits)</td>
<td>Move the contents of one register-pair to another.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
Implementation considerations are the same as <code>move-wide</code>,
above.</p>
</td>
@@ -425,7 +425,7 @@
<td>monitor-exit vAA</td>
<td><code>A:</code> reference-bearing register (8 bits)</td>
<td>Release the monitor for the indicated object.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
If this instruction needs to throw an exception, it must do
so as if the pc has already advanced past the instruction.
It may be useful to think of this as the instruction successfully
@@ -446,7 +446,7 @@
<code>B:</code> type index (16 bits)</td>
<td>Throw a <code>ClassCastException</code> if the reference in the
given register cannot be cast to the indicated type.
- <p><b>Note:</b> Since <code>A</code> must always be a reference
+ <p class="note"><strong>Note:</strong> Since <code>A</code> must always be a reference
(and not a primitive value), this will necessarily fail at runtime
(that is, it will throw an exception) if <code>B</code> refers to a
primitive type.</p>
@@ -461,7 +461,7 @@
<td>Store in the given destination register <code>1</code>
if the indicated reference is an instance of the given type,
or <code>0</code> if not.
- <p><b>Note:</b> Since <code>B</code> must always be a reference
+ <p class="note"><strong>Note:</strong> Since <code>B</code> must always be a reference
(and not a primitive value), this will always result
in <code>0</code> being stored if <code>C</code> refers to a primitive
type.</td>
@@ -547,7 +547,7 @@
<td>goto +AA</td>
<td><code>A:</code> signed branch offset (8 bits)</td>
<td>Unconditionally jump to the indicated instruction.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
The branch offset must not be <code>0</code>. (A spin
loop may be legally constructed either with <code>goto/32</code> or
by including a <code>nop</code> as a target before the branch.)</p>
@@ -558,7 +558,7 @@
<td>goto/16 +AAAA</td>
<td><code>A:</code> signed branch offset (16 bits)<br/></td>
<td>Unconditionally jump to the indicated instruction.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
The branch offset must not be <code>0</code>. (A spin
loop may be legally constructed either with <code>goto/32</code> or
by including a <code>nop</code> as a target before the branch.)</p>
@@ -640,7 +640,7 @@
<code>C:</code> signed branch offset (16 bits)</td>
<td>Branch to the given destination if the given two registers' values
compare as specified.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
The branch offset must not be <code>0</code>. (A spin
loop may be legally constructed either by branching around a
backward <code>goto</code> or by including a <code>nop</code> as
@@ -661,7 +661,7 @@
<code>B:</code> signed branch offset (16 bits)</td>
<td>Branch to the given destination if the given register's value compares
with 0 as specified.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
The branch offset must not be <code>0</code>. (A spin
loop may be legally constructed either by branching around a
backward <code>goto</code> or by including a <code>nop</code> as
@@ -723,7 +723,7 @@
<code>C:</code> instance field reference index (16 bits)</td>
<td>Perform the identified object instance field operation with
the identified field, loading or storing into the value register.
- <p><b>Note:</b> These opcodes are reasonable candidates for static linking,
+ <p class="note"><strong>Note:</strong> These opcodes are reasonable candidates for static linking,
altering the field argument to be a more direct offset.</p>
</td>
</tr>
@@ -750,7 +750,7 @@
<code>B:</code> static field reference index (16 bits)</td>
<td>Perform the identified object static field operation with the identified
static field, loading or storing into the value register.
- <p><b>Note:</b> These opcodes are reasonable candidates for static linking,
+ <p class="note"><strong>Note:</strong> These opcodes are reasonable candidates for static linking,
altering the field argument to be a more direct offset.</p>
</td>
</tr>
@@ -788,7 +788,7 @@
<code>interface</code> method, that is, on an object whose concrete
class isn't known, using a <code>method_id</code> that refers to
an <code>interface</code>.</p>
- <p><b>Note:</b> These opcodes are reasonable candidates for static linking,
+ <p class="note"><strong>Note:</strong> These opcodes are reasonable candidates for static linking,
altering the method argument to be a more direct offset
(or pair thereof).</p>
</td>
@@ -955,7 +955,7 @@
<td>Perform the indicated binary op on the indicated register (first
argument) and literal value (second argument), storing the result in
the destination register.
- <p><b>Note:</b>
+ <p class="note"><strong>Note:</strong>
<code>rsub-int</code> does not have a suffix since this version is the
main opcode of its family. Also, see below for details on its semantics.
</p>
@@ -982,7 +982,7 @@
<td>Perform the indicated binary op on the indicated register (first
argument) and literal value (second argument), storing the result
in the destination register.
- <p><b>Note:</b> See below for details on the semantics of
+ <p class="note"><strong>Note:</strong> See below for details on the semantics of
<code>rsub-int</code>.</p>
</td>
</tr>
@@ -1031,7 +1031,7 @@
</tbody>
</table>
-<p><b>Note:</b> The total number of code units for an instance of this
+<p class="note"><strong>Note:</strong> The total number of code units for an instance of this
table is <code>(size * 2) + 4</code>.</p>
<h2 id="sparse-switch">sparse-switch-payload format</h2>
@@ -1071,7 +1071,7 @@
</tbody>
</table>
-<p><b>Note:</b> The total number of code units for an instance of this
+<p class="note"><strong>Note:</strong> The total number of code units for an instance of this
table is <code>(size * 4) + 2</code>.</p>
<h2 id="fill-array">fill-array-data-payload format</h2>
@@ -1108,13 +1108,13 @@
</tbody>
</table>
-<p><b>Note:</b> The total number of code units for an instance of this
+<p class="note"><strong>Note:</strong> The total number of code units for an instance of this
table is <code>(size * element_width + 1) / 2 + 4</code>.</p>
<h2 id="math">Mathematical operation details</h2>
-<p><b>Note:</b> Floating point operations must follow IEEE 754 rules, using
+<p class="note"><strong>Note:</strong> Floating point operations must follow IEEE 754 rules, using
round-to-nearest and gradual underflow, except where stated otherwise.</p>
<table class="math">
diff --git a/src/devices/tech/dalvik/dex-format.jd b/src/devices/tech/dalvik/dex-format.jd
index bd167fb..8c59b01 100644
--- a/src/devices/tech/dalvik/dex-format.jd
+++ b/src/devices/tech/dalvik/dex-format.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -275,7 +275,7 @@
= "dex\n035\0"
</pre>
-<p><b>Note:</b> At least a couple earlier versions of the format have
+<p class="note"><strong>Note:</strong> At least a couple earlier versions of the format have
been used in widely-available public software releases. For example,
version <code>009</code> was used for the M3 releases of the
Android platform (November–December 2007),
@@ -306,10 +306,10 @@
<p>The constant <code>NO_INDEX</code> is used to indicate that
an index value is absent.</p>
-<p><b>Note:</b> This value isn't defined to be
+<p class="note"><strong>Note:</strong> This value isn't defined to be
<code>0</code>, because that is in fact typically a valid index.</p>
-<p><b>Also Note:</b> The chosen value for <code>NO_INDEX</code> is
+<p>The chosen value for <code>NO_INDEX</code> is
representable as a single byte in the <code>uleb128p1</code> encoding.</p>
<pre>
@@ -381,8 +381,8 @@
<td> </td>
<td> </td>
<td><code>synchronized</code>: associated lock automatically acquired
- around call to this method. <b>Note:</b> This is only valid to set when
- <code>ACC_NATIVE</code> is also set.</td>
+ around call to this method. <p class="note"><strong>Note:</strong> This is only valid to set when
+ <code>ACC_NATIVE</code> is also set. </p></td>
</tr>
<tr>
<td>ACC_VOLATILE</td>
@@ -482,8 +482,8 @@
<td>0x20000</td>
<td> </td>
<td> </td>
- <td>declared <code>synchronized</code>. <b>Note:</b> This has no effect on
- execution (other than in reflection of this flag, per se).
+ <td>declared <code>synchronized</code>. <p class="note"><strong>Note:</strong> This has no effect on
+ execution (other than in reflection of this flag, per se).</p>
</td>
</tr>
</tbody>
@@ -786,7 +786,7 @@
<tr>
<td>elements</td>
<td>annotation_element[size]</td>
- <td>elements of the annotataion, represented directly in-line (not as
+ <td>elements of the annotation, represented directly in-line (not as
offsets). Elements must be sorted in increasing order by
<code>string_id</code> index.
</td>
@@ -1567,7 +1567,7 @@
followed by a byte of value <code>0</code>. See
"MUTF-8 (Modified UTF-8) Encoding" above for details and
discussion about the data format.
- <p><b>Note:</b> It is acceptable to have a string which includes
+ <p class="note"><strong>Note:</strong> It is acceptable to have a string which includes
(the encoded form of) UTF-16 surrogate code units (that is,
<code>U+d800</code> … <code>U+dfff</code>)
either in isolation or out-of-order with respect to the usual
@@ -1897,7 +1897,7 @@
</tbody>
</table>
-<p><b>Note:</b> All elements' <code>field_id</code>s and
+<p class="note"><strong>Note:</strong> All elements' <code>field_id</code>s and
<code>method_id</code>s must refer to the same defining class.</p>
<h3 id="encoded-field-format">encoded_field format</h3>
@@ -2381,7 +2381,7 @@
to indicate that that value is unknown. (If <code>sig_idx</code> is
<code>-1</code>, though, the same data could be represented more
efficiently using the opcode <code>DBG_START_LOCAL</code>.)
- <p><b>Note:</b> See the discussion under
+ <p class="note"><strong>Note:</strong> See the discussion under
"<code>dalvik.annotation.Signature</code>" below for caveats about
handling signatures.</p>
</td>
@@ -2538,7 +2538,7 @@
</tbody>
</table>
-<p><b>Note:</b> All elements' <code>field_id</code>s and
+<p class="note"><strong>Note:</strong> All elements' <code>field_id</code>s and
<code>method_id</code>s must refer to the same defining class.</p>
<h3 id="field-annotation">field_annotation format</h3>
diff --git a/src/devices/tech/dalvik/instruction-formats.jd b/src/devices/tech/dalvik/instruction-formats.jd
index 91d876a..69b0924 100644
--- a/src/devices/tech/dalvik/instruction-formats.jd
+++ b/src/devices/tech/dalvik/instruction-formats.jd
@@ -66,7 +66,7 @@
<p>Most format IDs consist of three characters, two digits followed by a
letter. The first digit indicates the number of 16-bit code units in the
format. The second digit indicates the maximum number of registers that the
-format contains (maximum, since some formats can accomodate a variable
+format contains (maximum, since some formats can accommodate a variable
number of registers), with the special designation "<code>r</code>" indicating
that a range of registers is encoded. The final letter semi-mnemonically
indicates the type of any extra data encoded by the format. For example,
@@ -200,7 +200,7 @@
(indicated as "<code>vtaboff</code>") and field offsets (indicated as
"<code>fieldoff</code>").</p>
-<p>In the cases where a format value isn't explictly part of the syntax
+<p>In the cases where a format value isn't explicitly part of the syntax
but instead picks a variant, each variant is listed with the prefix
"<code>[<i>X</i>=<i>N</i>]</code>" (e.g., "<code>[A=2]</code>") to indicate
the correspondence.</p>
diff --git a/src/devices/tech/debug/asan.jd b/src/devices/tech/debug/asan.jd
new file mode 100644
index 0000000..9b13a5a
--- /dev/null
+++ b/src/devices/tech/debug/asan.jd
@@ -0,0 +1,260 @@
+page.title=AddressSanitizer
+@jd:body
+
+<!--
+ Copyright 2015 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.
+-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
+<h2 id=purpose>Purpose</h2>
+
+<p>AddressSanitizer (ASan) is a fast compiler-based tool for detecting memory bugs
+in native code. It is comparable to Valgrind (Memcheck tool), but, unlike it,
+ASan:</p>
+
+<ul>
+ <li> + detects overflows on stack and global objects
+ <li> - does not detect uninitialized reads and memory leaks
+ <li> + is much faster (two-three times slowdown compared to Valgrind’s 20-100x)
+ <li> + has less memory overhead
+</ul>
+
+<p>This document describes how to build and run parts of the Android platform with
+AddressSanitizer. If you are looking to build a standalone (i.e. SDK/NDK)
+application with AddressSanitizer, see the <a
+href="https://github.com/google/sanitizers/wiki/AddressSanitizerOnAndroid">AddressSanitizerOnAndroid</a>
+public project site instead.</p>
+
+<p>AddressSanitizer consists of a compiler (<code>external/clang</code>) and a runtime library
+(<code>external/compiler-rt/lib/asan</code>).</p>
+
+<p class="note"><strong>Note</strong>: Use the current master
+branch to gain access to the <a href="#sanitize_target">SANITIZE_TARGET</a>
+feature and the ability to build the entire Android platform with
+AddressSanitizer at once. Otherwise, you are limited to using
+<code>LOCAL_SANITIZE</code>.</p>
+
+<h2 id=building_with_clang>Building with Clang</h2>
+
+<p>As a first step to building an ASan-instrumented binary, make sure that your
+code builds with Clang. This is done by adding <code>LOCAL_CLANG:=true</code>
+to the build rules. Clang may find bugs in your code that GCC missed.</p>
+
+<h2 id=building_executables_with_addresssanitizer>Building executables with AddressSanitizer</h2>
+
+<p>Add <code>LOCAL_SANITIZE:=address</code> to the build rule of the
+executable. This requires: <code>LOCAL_CLANG:=true</code></p>
+
+<pre>
+LOCAL_CLANG:=true
+LOCAL_SANITIZE:=address
+</pre>
+
+<p>When a bug is detected, ASan prints a verbose report both to the standard
+output and to <code>logcat</code> and then crashes the process.</p>
+
+<h2 id=building_shared_libraries_with_addresssanitizer>Building shared libraries with AddressSanitizer</h2>
+
+<p>Due to the way ASan works, a library built with ASan cannot be used by an
+executable that's built without ASan.</p>
+
+<p class="note">Note</strong>: In runtime situations where an ASan library is
+loaded into an incorrect process, you will see unresolved symbol messages
+starting with <code>_asan</code> or <code>_sanitizer</code>.</p>
+
+<p>To sanitize a shared library that is used in multiple executables, not all of
+which are built with ASan, you'll need two copies of the library. The
+recommended way to do this is to add the following to <code>Android.mk</code>
+for the module in question:</p>
+
+<pre>
+LOCAL_CLANG:=true
+LOCAL_SANITIZE:=address
+LOCAL_MODULE_RELATIVE_PATH := asan
+</pre>
+
+<p>This puts the library in <code>/system/lib/asan</code> instead of
+<code>/system/lib</code>. Then, run your executable with:
+<code>LD_LIBRARY_PATH=/system/lib/asan</code></p>
+
+<p>For system daemons, add the following to the appropriate section of
+<code>/init.rc</code> or <code>/init.$device$.rc</code>.</p>
+
+<pre>
+setenv LD_LIBRARY_PATH /system/lib/asan
+</pre>
+
+<p class="warning"><strong>Warning</strong>: The <code>LOCAL_MODULE_RELATIVE_PATH</code>
+setting <strong>moves</strong> your library to <code>/system/lib/asan</code>,
+meaning that clobbering and rebuilding from scratch will result in the
+library missing from <code>/system/lib</code>, and probably an unbootable
+image. That's an unfortunate limitation of the
+current build system. Don't clobber; do <code>make -j $N</code> and <code>adb
+sync</code>.</p>
+
+<p>Verify the process is using libraries from <code>/system/lib/asan</code>
+when present by reading <code>/proc/$PID/maps</code>. If it's not, you may need
+to disable SELinux, like so:</p>
+
+<pre>
+$ adb root
+$ adb shell setenforce 0
+# restart the process with adb shell kill $PID
+# if it is a system service, or may be adb shell stop; adb shell start.
+</pre>
+
+<h2 id=better_stack_traces>Better stack traces</h2>
+
+<p>AddressSanitizer uses a fast, frame-pointer-based unwinder to record a stack
+trace for every memory allocation and deallocation event in the program. Most
+of Android is built without frame pointers. As a result, you will often get
+only one or two meaningful frames. To fix this, either rebuild the library with
+ASan (recommended!), or with:</p>
+
+<pre>
+LOCAL_CFLAGS:=-fno-omit-frame-pointer
+LOCAL_ARM_MODE:=arm
+</pre>
+
+<p>Or set <code>ASAN_OPTIONS=fast_unwind_on_malloc=0</code> in the process
+environment. The latter can be very CPU-intensive, depending on
+the load.</p>
+
+<h2 id=symbolization>Symbolization</h2>
+
+<p>Initially, ASan reports contain references to offsets in binaries and shared
+libraries. There are two ways to obtain source file and line information:</p>
+
+<ul>
+ <li>Ensure llvm-symbolizer binary is present in <code>/system/bin</code>.
+Llvm-symbolizer is built from sources in:
+<code>third_party/llvm/tools/llvm-symbolizer</code> <li>Filter the report
+through the <code>external/compiler-rt/lib/asan/scripts/symbolize.py</code>
+script.
+</ul>
+
+<p>The second approach can provide more data (i.e. file:line locations) because of
+the availability of symbolized libraries on the host.</p>
+
+<h2 id=addresssanitizer_in_the_apps>AddressSanitizer in the apps</h2>
+
+<p>AddressSanitizer cannot see into Java code, but it can detect bugs in the JNI
+libraries. For that, you'll need to build the executable with ASan, which in
+this case is <code>/system/bin/app_process(<em>32|64</code></em>). This will
+enable ASan in all apps on the device at the same time, which is a
+bit stressful, but nothing that a 2GB RAM device cannot handle.</p>
+
+<p>Add the usual <code>LOCAL_CLANG:=true, LOCAL_SANITIZE:=address</code> to
+the app_process build rule in <code>frameworks/base/cmds/app_process</code>. Ignore
+the <code>app_process__asan</code> target in the same file for now (if it is
+still there at the time you read
+this). Edit the Zygote record in
+<code>system/core/rootdir/init.zygote(<em>32|64</em>).rc</code> to add the
+following lines:</p>
+
+<pre>
+setenv LD_LIBRARY_PATH /system/lib/asan:/system/lib
+setenv ASAN_OPTIONS
+allow_user_segv_handler=true
+</pre>
+
+<p>Build, adb sync, fastboot flash boot, reboot.</p>
+
+<h2 id=using_the_wrap_property>Using the wrap property</h2>
+
+<p>The approach in the previous section puts AddressSanitizer into every
+application in the system (actually, into every descendant of the Zygote
+process). It is possible to run only one (or several) applications with ASan,
+trading some memory overhead for slower application startup.</p>
+
+<p>This can be done by starting your app with the “wrap.” property, the same one
+that’s used to run apps under Valgrind. The following example runs the Gmail app
+under ASan:</p>
+
+<pre>
+$ adb root
+$ adb shell setenforce 0 # disable SELinux
+$ adb shell setprop wrap.com.google.android.gm "asanwrapper"
+</pre>
+
+<p>In this context, asanwrapper rewrites <code>/system/bin/app_process</code>
+to <code>/system/bin/asan/app_process</code>, which is built with
+AddressSanitizer. It also adds <code>/system/lib/asan</code> at the start of
+the dynamic library search path. This way ASan-instrumented
+libraries from <code>/system/lib/asan</code> are preferred to normal libraries
+in <code>/system/lib</code> when running with asanwrapper.</p>
+
+<p>Again, if a bug is found, the app will crash, and the report will be printed to
+the log.</p>
+
+<h2 id=sanitize_target>SANITIZE_TARGET</h2>
+
+<p>The master branch has support for building the entire Android platform with
+AddressSanitizer at once.</p>
+
+<p>Run the following commands in the same build tree.</p>
+
+<pre>
+$ make -j42
+$ make USE_CLANG_PLATFORM_BUILD:=true SANITIZE_TARGET=address -j42
+</pre>
+
+<p>In this mode, <code>userdata.img</code> contains extra libraries and must be
+flashed to the device as well. Use the following command line:</p>
+
+<pre>
+$ fastboot flash userdata && fastboot flashall
+</pre>
+
+<p>At the moment of this writing, hammerhead-userdebug and shamu-userdebug boot to
+the UI in this mode.</p>
+
+<p>This works by building two sets of shared libraries: normal in
+<code>/system/lib</code> (the first make invocation), ASan-instrumented in
+<code>/data/lib</code> (the second make invocation). Executables from the
+second build overwrite the ones from the first build. ASan-instrumented
+executables get a different library search path that includes
+<code>/data/lib</code> before <code>/system/lib</code> through the use of
+"/system/bin/linker_asan" in PT_INTERP.</p>
+
+<p>The build system clobbers intermediate object directories when the
+<code>$SANITIZE_TARGET</code> value has changed. This forces a rebuild of all
+targets while preserving installed binaries under <code>/system/lib</code>.</p>
+
+<p>Some targets cannot be built with ASan:</p>
+
+<ul>
+ <li>Statically linked executables.
+ <li><code>LOCAL_CLANG:=false</code> targets
+ <li><code>LOCAL_SANITIZE:=undefined</code>; will not be ASan'd for <code>SANITIZE_TARGET=address</code>
+</ul>
+
+<p>Executables like these are skipped in the SANITIZE_TARGET build, and the
+version from the first make invocation is left in <code>/system/bin</code>.</p>
+
+<p>Libraries like this are simply built without ASan. They can contain some ASan
+code anyway from the static libraries they depend upon.</p>
+
+<h2 id=supporting_documentation>Supporting documentation</h2>
+
+<p><a href="https://github.com/google/sanitizers/wiki/AddressSanitizerOnAndroid">AddressSanitizerOnAndroid</a> public project site</p>
+<p><a href="https://www.chromium.org/developers/testing/addresssanitizer">AddressSanitizer and Chromium</a></p>
+<p><a href="https://github.com/google/sanitizers">Other Google Sanitizers</a></p>
diff --git a/src/devices/tech/debug/dumpsys.jd b/src/devices/tech/debug/dumpsys.jd
index ad93e2f..a866f64 100644
--- a/src/devices/tech/debug/dumpsys.jd
+++ b/src/devices/tech/debug/dumpsys.jd
@@ -97,8 +97,8 @@
<ul>
<li> <a
href="{@docRoot}devices/input/diagnostics.html">Viewing Input Diagnostics (dumpsys input)</a>
- <li> <a href="{@docRoot}devices/tech/ram/procstats.html">Viewing RAM Usage Data (dumpsys procstats)</a>
- <li> <a href="{@docRoot}devices/tech/netstats.html">Viewing Network Data (dumpsys netstats)</a>
+ <li> <a href="procstats.html">Viewing RAM Usage Data (dumpsys procstats)</a>
+ <li> <a href="netstats.html">Viewing Network Data (dumpsys netstats)</a>
<li> <a href="{@docRoot}devices/tech/power/batterystats.html">Viewing Battery Usage Data (dumpsys batterystats)</a>
</ul>
diff --git a/src/devices/tech/debug/index.jd b/src/devices/tech/debug/index.jd
index 50020cc..84fa957 100644
--- a/src/devices/tech/debug/index.jd
+++ b/src/devices/tech/debug/index.jd
@@ -1,8 +1,8 @@
-page.title=Debugging the Android platform
+page.title=Debugging Native Android Platform Code
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,180 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<p>The following sections contain information, documentation, tips and tricks
-about debugging Android at the platform level, typically during development
-of platform-level features.</p>
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc"></ol>
+ </div>
+</div>
+
+<p>This page contains a summary of useful tools and related commands for
+debugging, tracing, and profiling native Android platform code. The pages
+within this section contain detailed information on other debugging tools for
+use during development of platform-level features.</p>
+
+<p>For example, you may learn how to explore system services with <a
+href="dumpsys.html">Dumpsys</a> and evaluate <a
+href="netstats.html">network</a> and <a href="procstats.html">RAM</a> use. See
+the subpages for tools and methods not described below.</p>
+
+<h2 id=debuggerd>debuggerd</h2>
+
+<p>When a dynamically-linked executable starts, several signal handlers are
+registered that connect to <code>debuggerd</code> (or <code>debuggerd64)</code> in the event that signal
+is sent to the process. The <code>debuggerd</code> process dumps registers and unwinds the
+stack. Here is example output (with timestamps and extraneous information removed): </p>
+
+<pre>
+*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
+Build fingerprint: 'Android/aosp_flounder/flounder:5.1.51/AOSP/enh08201009:eng/test-keys'
+Revision: '0'
+ABI: 'arm'
+pid: 1656, tid: 1656, name: crasher >>> crasher <<<
+signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
+Abort message: 'some_file.c:123: some_function: assertion "false" failed'
+ r0 00000000 r1 00000678 r2 00000006 r3 f70b6dc8
+ r4 f70b6dd0 r5 f70b6d80 r6 00000002 r7 0000010c
+ r8 ffffffed r9 00000000 sl 00000000 fp ff96ae1c
+ ip 00000006 sp ff96ad18 lr f700ced5 pc f700dc98 cpsr 400b0010
+backtrace:
+ #00 pc 00042c98 /system/lib/libc.so (tgkill+12)
+ #01 pc 00041ed1 /system/lib/libc.so (pthread_kill+32)
+ #02 pc 0001bb87 /system/lib/libc.so (raise+10)
+ #03 pc 00018cad /system/lib/libc.so (__libc_android_abort+34)
+ #04 pc 000168e8 /system/lib/libc.so (abort+4)
+ #05 pc 0001a78f /system/lib/libc.so (__libc_fatal+16)
+ #06 pc 00018d35 /system/lib/libc.so (__assert2+20)
+ #07 pc 00000f21 /system/xbin/crasher
+ #08 pc 00016795 /system/lib/libc.so (__libc_init+44)
+ #09 pc 00000abc /system/xbin/crasher
+Tombstone written to: /data/tombstones/tombstone_06
+</pre>
+
+<p>This can be pasted into <code>development/scripts/stack</code> to get a more detailed unwind
+with line number information (assuming the unstripped binaries can be found).</p>
+
+<p>Some libraries on the system are built with <code>LOCAL_STRIP_MODULE :=
+keep_symbols</code> to provide usable backtraces directly from debuggerd. This makes
+your library or executable slightly larger, but not nearly as large as an
+unstripped version.</p>
+
+<p>Note also the last line of <code>debuggerd</code> output --- in addition to dumping a
+summary to the log, <code>debuggerd</code> writes a full “tombstone” to disk. This contains
+a lot of extra information that can be helpful in debugging a crash, in
+particular the stack traces for all the threads in the crashing process (not
+just the thread that caught the signal) and a full memory map.</p>
+
+<h2 id=native>Native Debugging with GDB</h2>
+
+<h3 id=running>Debugging a running app</h3>
+
+<p>To connect to an already-running app or native daemon, use <code>gdbclient</code>.</p>
+
+<p>Current versions of gdbclient just require the process ID (PID). So to debug a process with
+PID 1234, simply run:</p>
+<pre>
+$ gdbclient 1234
+</pre>
+<p>The script will set up port forwarding, start the appropriate
+<code>gdbserver</code> on the device, start the appropriate <code>gdb</code> on
+the host, configure <code>gdb</code> to find symbols, and connect
+<code>gdb</code> to the remote <code>gdbserver</code>.</p>
+
+<h3 id=starts>Debugging a native process as it starts</h3>
+
+<p>If you want to debug a process as it starts, you’ll need to use <code>gdbserver</code>
+manually, but that’s easy too:</p>
+
+<pre>
+$ adb shell gdbserver :5039 /system/bin/<em>my_test_app</em>
+Process my_test_app created; pid = 3460
+Listening on port 5039
+</pre>
+
+<p>Identify the app’s PID from the <code>gdbserver</code> output, and then in
+another window:</p>
+
+<pre>
+$ gdbclient <em><app pid></em>
+</pre>
+
+<p>Then enter <strong>continue</strong> at the <code>gdb</code> prompt.</p>
+
+<h3 id=crash>Debugging processes that crash</h3>
+
+<p>If you want <code>debuggerd</code> to suspend crashed processes so you can
+attach <code>gdb</code>, set the appropriate property:</p>
+
+<pre>
+$ adb shell setprop debug.db.uid 999999 # <= M
+$ adb shell setprop debug.debuggerd.wait_for_gdb true # > M
+</pre>
+
+<p>At the end of the usual crash output, <code>debuggerd</code> will give you
+instructions on how to connect <code>gdb</code> using the typical command:
+<pre>
+$ gdbclient <pid>
+</pre>
+
+<h3 id=symbols>Debugging without symbols</h3>
+
+<p>If you don’t have symbols, sometimes <code>gdb</code> will get confused about the
+instruction set it is disassembling (ARM or Thumb). The instruction set that is
+chosen as the default when symbol information is missing can be switched
+between ARM or Thumb like so:</p>
+
+<pre>
+$ set arm fallback-mode arm # or 'thumb'
+</pre>
+
+<h2 id=symbols>Other tools</h2>
+
+<h3 id=valgrind>Valgrind</h3>
+
+<p>The following steps show you how to use <a
+href="http://valgrind.org/">Valgrind</a> on Android. This tool suite contains a
+number of tools including Memcheck for detecting memory-related errors in C and
+C++.</p>
+
+<ol>
+ <li>To install Valgrind, run:
+<pre>
+$ mmm -j6 external/valgrind
+</pre>
+ <li>Push Valgrind to the device:
+ <br>
+<pre>
+$ adb remount
+$ adb sync
+</pre>
+ <li>Set up the temporary directory:
+<pre>
+$ adb shell mkdir /data/local/tmp
+$ adb shell chmod 777 /data/local/tmp
+</pre>
+ <li>Run the system server with Valgrind:
+<pre>
+$ adb root
+$ adb shell setprop wrap.system_server "logwrapper valgrind"
+$ adb shell stop && adb shell start
+</pre>
+ <li>For debug symbols, push unstripped libraries to <code>/data/local/symbols</code>:
+<pre>
+$ adb shell mkdir /data/local/symbols
+$ adb push $OUT/symbols /data/local/symbols
+</pre>
+ <li>To use Valgrind during boot up, edit <code>out/target/product/XXXX/root/init.rc</code> and
+change:<br>
+<code>service example /system/bin/foo --arg1 --arg2</code><br>
+to:<br>
+<code>service example /system/bin/logwrapper /system/bin/valgrind /system/bin/foo --arg1 --arg2</code><br>
+To see the effects, you need to create a <code>boot.img</code> and reflash the device.
+</ol>
+
+<h3 id=systrace>Systrace</h3>
+
+<p>See <a
+href="https://developer.android.com/tools/help/systrace.html">Systrace on
+developer.android.com</a> for deriving execution times of applications and
+other Android system processes.</p>
diff --git a/src/devices/tech/debug/native-memory.jd b/src/devices/tech/debug/native-memory.jd
index d149ec1..eaa8ff5 100644
--- a/src/devices/tech/debug/native-memory.jd
+++ b/src/devices/tech/debug/native-memory.jd
@@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<p>This tip assume that you are working with an eng
+<p>This tip assumes that you are working with an eng
or userdebug build of the platform, not on a production device.</p>
<p>Android's native memory allocator has some useful debugging features. You
can turn on memory tracking with:</p>
@@ -25,7 +25,7 @@
$ adb shell start
</code></pre>
<p>You need to restart the runtime so that zygote and all processes launched from
-it are restarted with the property set. Now all Dalvik processes have memory
+it are restarted with the property set. Now all app processes have memory
tracking turned on. You can look at these with DDMS, but first you need to
turn on its native memory UI:</p>
<ul>
diff --git a/src/devices/tech/index.jd b/src/devices/tech/index.jd
index 62a1f59..9b95216 100644
--- a/src/devices/tech/index.jd
+++ b/src/devices/tech/index.jd
@@ -30,15 +30,7 @@
are looking to modify, contribute to, or port the Android software. This is
"under the hood" information intended for engineers.</p>
-<h2 id="accessory-protocol-information">Accessories</h2>
-<p>Android devices can connect to hardware accessories, such as audio docks,
-keyboards and custom hardware, through USB or Bluetooth. This section
-describes the Android Open Accessory protocol (AOAP) for accessory hardware
-builders.</p>
-<p><a href="{@docRoot}accessories/index.html">» Accessory Protocol
-Information</a></p>
-
-<h2 id="art-technical-information">ART</h2>
+<h2 id="art-technical-information">ART and Dalvik</h2>
<p>The Android runtime (ART) is the heart of Android. It's a fast, ahead-of-time
compiled runtime with modern garbage collection designed to scale.
Android applications are compiled to Dalvik bytecode and run with ART. This
@@ -47,6 +39,14 @@
<p><a href="{@docRoot}devices/tech/dalvik/index.html">» ART and Dalvik
Information</a></p>
+<h2 id="config">Configuration</h2>
+<p>Getting the most out of Android requires tuning of the <a
+href="{@docRoot}devices/tech/config/kernel.html">kernel</a>, <a
+href="{@docRoot}devices/tech/config/renderer.html">OpenGLRenderer</a>, and
+more. See the subpages of this section for details.
+<p><a href="{@docRoot}devices/tech/config/index.html">» Configuration
+Information</a></p>
+
<h2 id="data-usage-technical-information">Data Usage</h2>
<p>Android's data usage features allow users to understand and control how
their device uses network data. This section is designed for systems
@@ -55,32 +55,25 @@
<p><a href="{@docRoot}devices/tech/datausage/index.html">» Data Usage
Information</a></p>
-<h2 id="debugging">Debugging and Tuning</h2>
+<h2 id="debugging">Debugging</h2>
<p>Android is a large and complex system. This section includes tips and tricks
for debugging at the platform level.</p>
<p><a href="{@docRoot}devices/tech/debug/index.html">» Debugging
Information</a></p>
+<h2 id="admin-information">Device Administration</h2>
+<p>Since Android 5.0, the platform supports use cases in a corporate
+environment under the auspices of each company’s information technology (IT)
+department.</p>
+<p><a href="{@docRoot}devices/tech/admin/index.html">» Device
+administration information</a></p>
+
<h2 id="HAL-technical-information">HAL File Reference</h2>
<p>Android's Hardware Abstraction Layer (HAL) provides the interface between
software APIs and hardware drivers. This section contains the commented code
files of the HAL.</p>
<p><a href="{@docRoot}devices/halref/files.html">» HAL Reference</a></p>
-<h2 id="kernel-technical-information">Kernel</h2>
-<p>The kernel configuration settings in this section are meant to be used as
-a base for an Android kernel configuration. All devices should have the
-options in android-base configuration enabled.</p>
-<p><a href="{@docRoot}devices/tech/kernel.html">» Kernel Information</a>
-</p>
-
-<h2 id="lowram-technical-information">Low RAM</h2>
-<p>Android supports devices with limited memory through various optimizations
-such as improved memory management, reduced system memory, and several
-build-time and kernel configuration settings.</p>
-<p><a href="{@docRoot}devices/tech/low-ram.html">» Low RAM Information</a>
-</p>
-
<h2 id="ota-technical-information">OTA Updates</h2>
<p>Android devices in the field can receive and install over-the-air (OTA)
updates to the system and application software. This section describes the
@@ -93,7 +86,7 @@
<p>Battery usage statistics are tracked by the framework. This involves
keeping track of time spent by different device components in different states.
</p>
-<p><a href="{@docRoot}devices/tech/power.html">» Power Information</a>
+<p><a href="{@docRoot}devices/tech/power/index.html">» Power Information</a>
</p>
<h2 id="security-technical-information">Security</h2>
@@ -109,4 +102,4 @@
slot into environments with existing build, test, and reporting
infrastructures.</p>
<p><a href="{@docRoot}devices/tech/test_infra/tradefed/index.html">
-» Trade Federation Testing Infrastructure Overview</a></p>
\ No newline at end of file
+» Trade Federation Testing Infrastructure Overview</a></p>
diff --git a/src/devices/tech/ota/inside_packages.jd b/src/devices/tech/ota/inside_packages.jd
index 41b3d5c..dc06b0b 100755
--- a/src/devices/tech/ota/inside_packages.jd
+++ b/src/devices/tech/ota/inside_packages.jd
@@ -110,7 +110,7 @@
</i>. <i>tgt_sha1</i> and <i>tgt_size</i> are the expected final SHA1 hash and
size of the target file. The remaining arguments must come in pairs: a SHA1
hash (a 40-character hex string) and a blob. The blob is the patch to be
-applied whe the source file's current contents have the given SHA1.
+applied when the source file's current contents have the given SHA1.
<p>The patching is done in a safe manner that guarantees the target file
either has the desired SHA1 hash and size, or it is untouched—it will not be
left in an unrecoverable intermediate state. If the process is interrupted
@@ -285,4 +285,4 @@
<p class="note"><strong>Note:</strong> Prior to Android 4.1, only filenames
were accepted, so to accomplish this the data first had to be unzipped into a
-temporary local file.</p>
\ No newline at end of file
+temporary local file.</p>
diff --git a/src/devices/tech/ota/sign_builds.jd b/src/devices/tech/ota/sign_builds.jd
index e986920..0f0d1e6 100755
--- a/src/devices/tech/ota/sign_builds.jd
+++ b/src/devices/tech/ota/sign_builds.jd
@@ -25,24 +25,128 @@
</div>
</div>
-<p>Android uses cryptographic signatures in two places:</p>
+<p>Android OS images use cryptographic signatures in two places:</p>
<ol>
-<li>Each .apk file must be signed. Android's Package Manager uses an .apk
-signature in two ways:<ul>
+<li>Each .apk file inside the image must be signed. Android's Package Manager
+uses an .apk signature in two ways:<ul>
<li>When an application is replaced, it must be signed by the same key as the
-old application in order to get access to the old application's data.</li>
+old application in order to get access to the old application's data. This
+holds true both for updating user apps by overwriting the .apk, and for
+overriding a system app with a newer version installed under
+<code>/data</code>.</li>
<li>If two or more applications want to share a user ID (so they can share
data, etc.), they must be signed with the same key.</ul></li>
<li>OTA update packages must be signed with one of the keys expected by the
system or the installation process will reject them.</ul></li>
</ol>
-<h2 id="certificates-keys">Certificates and keys</h2>
+
+<h2 id="release-keys">Release keys</h2>
+
+<p>The Android tree includes <i>test-keys</i> under
+<code>build/target/product/security</code>. Building an Android OS image
+using <code>make</code> will sign all .apk files using the test-keys.
+Since the test-keys are publicly known, anybody can sign their own .apk files
+with the same keys, which may allow them to replace or hijack system
+apps built into your OS image. For this reason it is critical to sign any
+publicly released or deployed Android OS image with a special set of
+<i>release-keys</i> that only you have access to.</p>
+
+<p>To generate your own unique set of release-keys, run these commands from
+the root of your Android tree:</p>
+
+<pre class="no-pretty-print">
+subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com'
+mkdir ~/.android-certs
+for x in releasekey platform shared media; do \
+ ./development/tools/make_key ~/.android-certs/$x "$subject"; \
+done
+</pre>
+
+<p><code>$subject</code> should be changed to reflect your organization's
+information. You can use any directory, but be careful to pick a
+location that is backed up and secure. Some vendors choose to encrypt
+their private key with a strong passphrase and store the encrypted key
+in source control; others store their release keys somewhere else entirely,
+such as on an air-gapped computer.</p>
+
+<p>To generate a release image, use:</p>
+
+<pre class="no-pretty-print">
+make dist
+./build/tools/releasetools/sign_target_files_apks \
+ -o \ # explained in the next section
+ -d ~/.android-certs out/dist/*-target_files-*.zip \
+ signed-target_files.zip
+</pre>
+
+<p>The <code>sign_target_files_apks</code> script takes a target-files .zip
+as input and produces a new target-files .zip in which all the .apks have
+been signed with new keys. The newly signed images can be found under
+<code>IMAGES/</code> in <code>signed-target_files.zip</code>.</p>
+
+<h2 id="sign-ota-packages">Signing OTA packages</h2>
+
+A signed target-files zip can be converted into a signed OTA update zip
+using the following procedure:
+
+<pre class="no-pretty-print">
+./build/tools/releasetools/ota_from_target_files \
+ -k ~/.android-certs/releasekey \
+ signed-target_files.zip \
+ signed-ota_update.zip
+</pre>
+
+<h3 id="signatures-sideloading">Signatures and sideloading</h3>
+<p>Sideloading does not bypass recovery's normal package signature
+verification mechanism—before installing a package, recovery will verify that
+it is signed with one of the private keys matching the public keys stored in
+the recovery partition, just as it would for a package delivered over-the-air.
+</p>
+
+<p>Update packages received from the main system are typically verified twice:
+once by the main system, using the
+<code><a href="http://developer.android.com/reference/android/os/RecoverySystem.html#verifyPackage">RecoverySystem.verifyPackage()</a></code>
+method in the android API, and then again by
+recovery. The RecoverySystem API checks the signature against public keys
+stored in the main system, in the file <code>/system/etc/security/otacerts.zip
+</code> (by default). Recovery checks the signature against public keys stored
+in the recovery partition RAM disk, in the file <code>/res/keys</code>.</p>
+
+<p>By default, the target-files .zip produced by the build sets the OTA
+certificate to match the test key. On a released image, a
+different certificate must be used so that devices can verify the
+authenticity of the update package. Passing the <code>-o</code> flag to
+<code>sign_target_files_apks</code>, as shown in the previous section, replaces
+the test key certificate with the release key certificate from your certs
+directory.</p>
+
+<p>Normally the system image and recovery image store the same set of OTA
+public keys. By adding a key to <i>just</i> the recovery set of keys, it is
+possible to sign packages that can be installed only via sideloading
+(assuming the main system's update download mechanism is correctly doing
+verification against otacerts.zip). You can specify extra keys to be
+included only in recovery by setting the PRODUCT_EXTRA_RECOVERY_KEYS
+variable in your product definition:</p>
+
+<p><code>vendor/yoyodyne/tardis/products/tardis.mk</code></p>
+<pre class="no-pretty-print">
+ [...]
+
+PRODUCT_EXTRA_RECOVERY_KEYS := vendor/yoyodyne/security/tardis/sideload
+</pre>
+
+<p>This includes the public key
+<code>vendor/yoyodyne/security/tardis/sideload.x509.pem</code> in the recovery
+keys file so it can install packages signed
+with it. The extra key is <i>not</i> included in otacerts.zip though, so
+systems that correctly verify downloaded packages do not invoke recovery for
+packages signed with this key.</p>
+
+<h2 id="certificates-keys">Certificates and private keys</h2>
<p>Each key comes in two files: the <i>certificate</i>, which has the
extension .x509.pem, and the <i>private key</i>, which has the extension .pk8.
The private key should be kept secret and is needed to sign a package. The key
-may itself be protected by a password—a reasonable strategy is to store your
-keys in source control along with the code—but keep them protected by a
-password known only to the people who make final releases. The certificate, in
+may itself be protected by a password. The certificate, in
contrast, contains only the public half of the key, so it can be distributed
widely. It is used to verify a package has been signed by the corresponding
private key.</p>
@@ -64,7 +168,7 @@
can also specify an entirely different key by pathname, e.g.:</p>
<p><code>device/yoyodyne/apps/SpecialApp/Android.mk</code></p>
-<pre>
+<pre class="no-pretty-print">
[...]
LOCAL_CERTIFICATE := device/yoyodyne/security/special
@@ -74,63 +178,16 @@
</code> key to sign SpecialApp.apk. The build can use only private keys that
are <i>not </i>password protected.</p>
-<h2>Generating keys</h2>
-<p>Android uses 2048-bit RSA keys with public exponent 3. You can generate
-certificate/private key pairs using the openssl tool from
-<a href="http://www.openssl.org/">openssl.org</a>:</p>
-
-<pre>
-# generate RSA key
-% <b>openssl genrsa -3 -out temp.pem 2048</b>
-Generating RSA private key, 2048 bit long modulus
-....+++
-.....................+++
-e is 3 (0x3)
-
-# create a certificate with the public part of the key
-% <b>openssl req -new -x509 -key temp.pem -out releasekey.x509.pem \
- -days 10000 \
- -subj '/C=US/ST=California/L=San Narciso/O=Yoyodyne, Inc./OU=Yoyodyne Mobility/CN=Yoyodyne/emailAddress=yoyodyne@example.com'</b>
-
-# create a PKCS#8-formatted version of the private key
-% <b>openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt</b>
-
-# securely delete the temp.pem file
-% <b>shred --remove temp.pem</b>
-</pre>
-
-<p>The openssl pkcs8 command given above creates a .pk8 file with <i>no</i>
-password, suitable for use with the build system. To create a .pk8 secured
-with a password (which you should do for all actual release keys), replace the
-<code>-nocrypt</code> argument with <code>-passout stdin</code>; then openssl
-will encrypt the private key with a password read from standard input. No
-prompt is printed, so if stdin is the terminal the program will appear to hang
-when it's really just waiting for you to enter a password. Other values can be
-used for the-passout argument to read the password from other locations; for
-details, see the
-<a href="http://www.openssl.org/docs/apps/openssl.html#PASS_PHRASE_ARGUMENTS">
-openssl documentation</a>.</p>
-<p>The temp.pem intermediate file contains the private key without any kind of
-password protection, so dispose of it thoughtfully when generating release
-keys. In particular, the GNUshred utility may not be effective on network or
-journaled filesystems. You can use a working directory located in a RAM disk
-(such as a tmpfs partition) when generating keys to ensure the intermediates
-are not inadvertently exposed.</p>
-
-<h2 id="sign-apps-for-release">Signing apps for release</h2>
-<p>The first step in preparing a build for release is to sign all the .apk
-files in it, replacing the test keys used by the build system. This is done
-with the <code>sign_target_files_apks</code> script. It takes a target-files
-.zip as input and produces a new target-files .zip in which all the .apks have
-been signed with new keys.</p>
-<p>When you run this script, you must specify on the command line a
-replacement key for each key used in the build. The <code>-k <i>src_key</i>=<i>
+<h2 id="advanced-signing-options">Advanced signing options</h2>
+<p>When you run the <code>sign_target_files_apks</code> script, you must
+specify on the command line a replacement key for each key used in the build.
+The <code>-k <i>src_key</i>=<i>
dest_key</i></code> flag specifies key replacements one at a time. The flag
<code>-d <i>dir</i></code> lets you specify a directory with four keys to
replace all those in <code>build/target/product/security</code>; it is
equivalent to using <code>-k</code> four times to specify the mappings:</p>
-<pre>
+<pre class="no-pretty-print">
build/target/product/security/testkey = dir/releasekey
build/target/product/security/platform = dir/platform
build/target/product/security/shared = dir/shared
@@ -143,7 +200,7 @@
required by SpecialApp in the example above. If the keys were in the following
files:</p>
-<pre>
+<pre class="no-pretty-print">
vendor/yoyodyne/security/tardis/releasekey.x509.pem
vendor/yoyodyne/security/tardis/releasekey.pk8
vendor/yoyodyne/security/tardis/platform.x509.pem
@@ -160,11 +217,11 @@
<p>Then you would sign all the apps like this:</p>
-<pre>
+<pre class="no-pretty-print">
% <b>./build/tools/releasetools/sign_target_files_apks \
-d vendor/yoyodyne/security/tardis \
-k vendor/yoyodyne/special=vendor/yoyodyne/special-release \
- -o \ </b># explained in the next section<b>
+ -o \
tardis-target_files.zip signed-tardis-target_files.zip</b>
Enter password for vendor/yoyodyne/security/special-release key>
Enter password for vendor/yoyodyne/security/tardis/media key>
@@ -207,63 +264,68 @@
fingerprint. Run the script with <code>-h</code> to see documentation on all
flags.</p>
-<h2 id="sign-ota-packages">Signing OTA packages</h2>
-<p>You need the following components to sign OTA packages:</p>
-<ol>
-<li>Certificates of the keys you want this build to accept.</li>
-<li>Sign the newly-created package with the private key (must correspond to
-the certificate embedded in the current build of any device to which you want
-to send this package).</li>
-</ol>
-<p>To achieve these components:</p>
-<ul>
-<li>The target-files .zip produced by the build sets the OTA certificate to
-the certificate of the test key. Passing the <code>-o</code> flag to <code>
-sign_target_files_apks</code> replaces this key with the release key from your
-build.</li>
-<li>To sign the OTA update package, use the <code>-k</code> option when
-generating it to specify the key. You should give <code>ota_from_target_files
-</code> the <i>signed</i> version of the target-files .zip as well:
-<pre>
-% <b>./build/tools/releasetools/ota_from_target_files \
- -k vendor/yoyodyne/security/tardis/releasekey \
- signed-tardis-target_files.zip \
- signed-ota_update.zip</b>
-unzipping target target-files...
-(using device-specific extensions from target_files)
-Enter password for vendor/yoyodyne/security/tardis/releasekey key>
-done.</pre></li></ul>
+<h2 id="manually-generating-keys">Manually generating keys</h2>
+<p>Android uses 2048-bit RSA keys with public exponent 3. You can generate
+certificate/private key pairs using the openssl tool from
+<a href="http://www.openssl.org/">openssl.org</a>:</p>
-<h3 id="signatures-sideloading">Signatures and sideloading</h3>
-<p>Sideloading does not bypass recovery's normal package signature
-verification mechanism—before installing a package, recovery will verify that
-it is signed with one of the private keys matching the public keys stored in
-the recovery partition, just as it would for a package delivered over-the-air.
-</p>
-<p>Update packages received from the main system are typically verified twice:
-once by the main system, using the <code><a href="http://developer.android.com/
-reference/android/os/RecoverySystem.html#verifyPackage">RecoverySystem.
-verifyPackage()</a></code> method in the android API, and then again by
-recovery. The RecoverySystem API checks the signature against public keys
-stored in the main system, in the file <code>/system/etc/security/otacerts.zip
-</code> (by default). Recovery checks the signature against public keys stored
-in the recovery partition RAM disk, in the file <code>/res/keys</code>.</p>
-<p>Normally these two locations store the same set of keys. By adding a key to
-<i>just</i> the recovery set of keys, it's possible to sign packages that can
-be installed only via sideloading (assuming the main system's update download
-mechanism is correctly doing verification against otacerts.zip). You can
-specify extra keys to be included only in recovery by setting the
-PRODUCT_EXTRA_RECOVERY_KEYS variable in your product definition:</p>
+<pre class="no-pretty-print">
+# generate RSA key
+% <b>openssl genrsa -3 -out temp.pem 2048</b>
+Generating RSA private key, 2048 bit long modulus
+....+++
+.....................+++
+e is 3 (0x3)
-<p><code>vendor/yoyodyne/tardis/products/tardis.mk</code></p>
-<pre>
- [...]
+# create a certificate with the public part of the key
+% <b>openssl req -new -x509 -key temp.pem -out releasekey.x509.pem \
+ -days 10000 \
+ -subj '/C=US/ST=California/L=San Narciso/O=Yoyodyne, Inc./OU=Yoyodyne Mobility/CN=Yoyodyne/emailAddress=yoyodyne@example.com'</b>
-PRODUCT_EXTRA_RECOVERY_KEYS := vendor/yoyodyne/security/tardis/sideload
+# create a PKCS#8-formatted version of the private key
+% <b>openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt</b>
+
+# securely delete the temp.pem file
+% <b>shred --remove temp.pem</b>
</pre>
-<p>This includes the public key <code>vendor/yoyodyne/security/tardis/sideload.
-x509.pem</code> in the recovery keys file so it can install packages signed
-with it. The extra key is <i>not</i> included in otacerts.zip though, so
-systems that correctly verify downloaded packages do not invoke recovery for
-packages signed with this key.</p>
\ No newline at end of file
+<p>The openssl pkcs8 command given above creates a .pk8 file with <i>no</i>
+password, suitable for use with the build system. To create a .pk8 secured
+with a password (which you should do for all actual release keys), replace the
+<code>-nocrypt</code> argument with <code>-passout stdin</code>; then openssl
+will encrypt the private key with a password read from standard input. No
+prompt is printed, so if stdin is the terminal the program will appear to hang
+when it's really just waiting for you to enter a password. Other values can be
+used for the-passout argument to read the password from other locations; for
+details, see the
+<a href="http://www.openssl.org/docs/apps/openssl.html#PASS_PHRASE_ARGUMENTS">
+openssl documentation</a>.</p>
+<p>The temp.pem intermediate file contains the private key without any kind of
+password protection, so dispose of it thoughtfully when generating release
+keys. In particular, the GNUshred utility may not be effective on network or
+journaled filesystems. You can use a working directory located in a RAM disk
+(such as a tmpfs partition) when generating keys to ensure the intermediates
+are not inadvertently exposed.</p>
+
+<h2 id="creating-image-files">Creating image files</h2>
+
+<p>
+Once you have signed-target-files.zip, you need to
+create the image so you can put it onto a device.
+To create the signed image from the target files, run
+the following command from the root of the Android
+tree:
+</p>
+
+<pre>
+./build/tools/releasetools/img_from_target_files signed-target-files.zip signed-img.zip
+</pre>
+
+The resulting file, <code>signed-img.zip</code>, contains all the .img files.
+
+To load an image onto a device, use fastboot as
+follows:
+
+<pre>
+fastboot update signed-img.zip
+</pre>
diff --git a/src/devices/tech/security/encryption/index.jd b/src/devices/tech/security/encryption/index.jd
index 957e9ed..f7bcc3b 100644
--- a/src/devices/tech/security/encryption/index.jd
+++ b/src/devices/tech/security/encryption/index.jd
@@ -1,4 +1,4 @@
-page.title=Encryption
+page.title=Full Disk Encryption
@jd:body
<!--
@@ -25,9 +25,9 @@
</div>
</div>
-<h2 id=what_is_encryption>What is encryption?</h2>
+<h2 id=what_is_encryption>What is full disk encryption?</h2>
-<p>Encryption is the process of encoding user data on an Android device using an
+<p>Full disk encryption is the process of encoding all user data on an Android device using an
encrypted key. Once a device is encrypted, all user-created data is
automatically encrypted before committing it to disk and all reads
automatically decrypt data before returning it to the calling process.</p>
@@ -50,9 +50,9 @@
encrypted may be returned to an unencrypted state by factory data reset. New Android 5.0
devices encrypted at first boot cannot be returned to an unencrypted state.</p>
-<h2 id=how_android_encryption_works>How Android encryption works</h2>
+<h2 id=how_android_encryption_works>How Android full disk encryption works</h2>
-<p>Android disk encryption is based on <code>dm-crypt</code>, which is a kernel
+<p>Android full disk encryption is based on <code>dm-crypt</code>, which is a kernel
feature that works at the block device layer. Because of
this, encryption works with Embedded MultiMediaCard<strong> (</strong>eMMC) and
similar flash devices that present themselves to the kernel as block
@@ -454,7 +454,7 @@
<td><code>vold.encrypt_progress error_not_encrypted</code></td>
<td>The progress bar UI should
display a message saying an error
-occured, no data was encrypted or
+occurred, no data was encrypted or
lost, and give the user a button to reboot the system.</td>
</tr>
<tr>
diff --git a/src/devices/tech/security/enhancements/enhancements60.jd b/src/devices/tech/security/enhancements/enhancements60.jd
new file mode 100644
index 0000000..7cc786e
--- /dev/null
+++ b/src/devices/tech/security/enhancements/enhancements60.jd
@@ -0,0 +1,38 @@
+page.title=Security Enhancements in Android 6.0
+@jd:body
+
+<p>Every Android release includes dozens of security enhancements to protect
+users. Here are some of the major security enhancements available in Android
+6.0:</p>
+<ul>
+ <li><strong>Runtime Permissions</strong>. Applications request permissions at
+ runtime instead of being granted at App
+ install time. Users can toggle permissions on and off for both M and pre-M
+ applications.</li>
+ <li><strong>Verified Boot</strong>. A set of cryptographic checks of system
+ software are conducted prior to
+ execution to ensure the phone is healthy from the bootloader all the way up to
+ the operating system.</li>
+ <li><strong>Hardware-Isolated Security</strong>. New Hardware Abstraction
+ Layer (HAL) used by Fingerprint API, Lockscreen,
+ Device Encryption, and Client Certificates to protect keys against kernel
+ compromise and/or local physical attacks</li>
+ <li><strong>Fingerprints</strong>. Devices can now be unlocked with just a
+ touch. Developers can also take
+ advantage of new APIs to use fingerprints to lock and unlock encryption keys.</li>
+ <li><strong>SD Card Adoption</strong>. Removable media can be
+ <em>adopted</em> to a device and expand available storage for
+ app local data, photos, videos, etc., but still be protected by block-level
+ encryption.</li>
+ <li><strong>Clear Text Traffic</strong>. Developers can use a new StrictMode
+ to make sure their application doesn't use
+ cleartext.</li>
+ <li><strong>System Hardening</strong>. Hardening of the system via policies
+ enforced by SELinux. This offers better
+ isolation between users, IOCTL filtering, reduce threat of exposed services,
+ further tightening of SELinux domains, and extremely limited /proc access.</li>
+ <li><strong>USB Access Control:</strong> Users must confirm to allow USB
+ access to files, storage, or other
+ functionality on the phone. Default is now <em>charge only</em> with access
+ to storage requiring explicit approval from the user.</li>
+</ul>
diff --git a/src/devices/tech/security/images/android_software_stack.png b/src/devices/tech/security/images/android_software_stack.png
new file mode 100644
index 0000000..170ea33
--- /dev/null
+++ b/src/devices/tech/security/images/android_software_stack.png
Binary files differ
diff --git a/src/devices/tech/security/images/device_states.png b/src/devices/tech/security/images/device_states.png
deleted file mode 100644
index 319c345..0000000
--- a/src/devices/tech/security/images/device_states.png
+++ /dev/null
Binary files differ
diff --git a/src/devices/tech/security/images/dm-verity_mgmt.png b/src/devices/tech/security/images/dm-verity_mgmt.png
index f67b93f..2c2854e 100644
--- a/src/devices/tech/security/images/dm-verity_mgmt.png
+++ b/src/devices/tech/security/images/dm-verity_mgmt.png
Binary files differ
diff --git a/src/devices/tech/security/images/permissions_check.png b/src/devices/tech/security/images/permissions_check.png
new file mode 100644
index 0000000..0dc2e02
--- /dev/null
+++ b/src/devices/tech/security/images/permissions_check.png
Binary files differ
diff --git a/src/devices/tech/security/images/verified_boot.png b/src/devices/tech/security/images/verified_boot.png
index 592aee8..b1c5cb6 100644
--- a/src/devices/tech/security/images/verified_boot.png
+++ b/src/devices/tech/security/images/verified_boot.png
Binary files differ
diff --git a/src/devices/tech/security/implement.jd b/src/devices/tech/security/implement.jd
index 6b9c80e..2a7c890 100644
--- a/src/devices/tech/security/implement.jd
+++ b/src/devices/tech/security/implement.jd
@@ -160,7 +160,7 @@
<li>Where possible, root code <strong>should</strong> be isolated from untrusted data and
accessed via IPC. For example, reduce root functionality to a small Service
accessible via Binder and expose the Service with signature permission to an
-an application with low or no privileges to handle network traffic.</li>
+application with low or no privileges to handle network traffic.</li>
<li>Root processes <strong>must not</strong> listen on a network socket.</li>
<li>Root processes <strong>must not</strong> provide a general-purpose runtime for
applications. (e.g. a Java VM)</li>
diff --git a/src/devices/tech/security/index.jd b/src/devices/tech/security/index.jd
index 1c67377..cb5c881 100644
--- a/src/devices/tech/security/index.jd
+++ b/src/devices/tech/security/index.jd
@@ -64,7 +64,7 @@
the components below are properly secured. With the exception of a small amount
of Android OS code running as root, all code above the Linux Kernel is
restricted by the Application Sandbox.</p>
-<p><img alt="Figure 1: Android software stack" src="images/image00.png" /></p>
+<p><img alt="Figure 1: Android software stack" src="images/android_software_stack.png" /></p>
<p><em>Figure 1: Android software stack.</em></p>
<p>The main Android platform building blocks are:</p>
<ul>
diff --git a/src/devices/tech/security/overview/acknowledgements.jd b/src/devices/tech/security/overview/acknowledgements.jd
index 19e79ec..5b62a71 100644
--- a/src/devices/tech/security/overview/acknowledgements.jd
+++ b/src/devices/tech/security/overview/acknowledgements.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2014 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>The Android Security Team would like to thank the following people and
parties for helping to improve Android security. They have done this either by
finding and responsibly reporting security vulnerabilities to <a
@@ -24,10 +32,14 @@
for the <a href="https://www.google.com/about/appsecurity/patch-rewards/">Patch
Rewards</a> program.</p>
-<h2>2015</h2>
+<h2 id=2015>2015</h2>
<div style="LINE-HEIGHT:25px;">
+<p>
+<a href="mailto:jgor@utexas.edu">jgor</a> of <a href="http://security.utexas.edu">The University of Texas at Austin</a> (<a href="https://twitter.com/indiecom">@indiecom</a>)
+</p>
+
<p><a href="mailto:higongguang@gmail.com">Guang Gong</a> of <a href="http://www.360safe.com/">Qihoo 360 Technology Co. Ltd</a> (<a href="https://twitter.com/oldfresher">@oldfresher</a>)</p>
<p>Stephan Huber of Testlab Mobile Security, <a
@@ -45,7 +57,7 @@
</div>
-<h2>2014</h2>
+<h2 id=2014>2014</h2>
<div style="LINE-HEIGHT:25px;">
<p>Jeff Forristal of <a href="http://www.bluebox.com/blog/">Bluebox
@@ -187,7 +199,7 @@
</div>
-<h2>2013</h2>
+<h2 id=2013>2013</h2>
<div style="LINE-HEIGHT:25px;">
@@ -263,7 +275,7 @@
<p>Kan Yuan</p>
</div>
-<h2>2012</h2>
+<h2 id=2012>2012</h2>
<div style="LINE-HEIGHT:25px;">
@@ -289,8 +301,7 @@
<p><a href="http://thejh.net/">Jann Horn</a></p>
-<p><a href="http://web.ict.kth.se/~rbbo/ussdvul.html">Ravishankar
-Borgaonkar</a> of TU Berlin
+<p>Ravishankar Borgaonkar of TU Berlin
(<a href="https://twitter.com/raviborgaonkar">@raviborgaonkar</a>)</p>
<p><a href="http://roeehay.blogspot.com/">Roee Hay</a>
@@ -301,7 +312,7 @@
</div>
-<h2>2011</h2>
+<h2 id=2011>2011</h2>
<div style="LINE-HEIGHT:25px;">
@@ -309,7 +320,7 @@
</div>
-<h2>2009</h2>
+<h2 id=2009>2009</h2>
<div style="LINE-HEIGHT:25px;">
diff --git a/src/devices/tech/security/overview/app-security.jd b/src/devices/tech/security/overview/app-security.jd
index 3f2811c..f25f067 100644
--- a/src/devices/tech/security/overview/app-security.jd
+++ b/src/devices/tech/security/overview/app-security.jd
@@ -239,7 +239,7 @@
choose to share this information can use Android OS permission checks to
protect the data from third-party applications.</p>
<img alt="Access to sensitive user data available only through protected
-APIs" src="../images/image03.png" id="figure2" />
+APIs" src="../images/permissions_check.png" id="figure2" />
<p class="img-caption">
<strong>Figure 2.</strong> Access to sensitive user data is available only through protected APIs
</p>
@@ -339,7 +339,7 @@
</li>
</ul>
<p><img alt="Architecture of Digital Rights Management on Android
-platform" src="../images/image02.png" id="figure3" /></p>
+platform" src="../../../images/ape_fwk_drm_2.png" id="figure3" /></p>
<p class="img-caption">
<strong>Figure 3.</strong> Architecture of Digital Rights Management on Android platform
</p>
diff --git a/src/devices/tech/security/overview/index.jd b/src/devices/tech/security/overview/index.jd
index e23d734..6b00c55 100644
--- a/src/devices/tech/security/overview/index.jd
+++ b/src/devices/tech/security/overview/index.jd
@@ -39,11 +39,11 @@
and security resources, with appropriate security controls integrated into the
architecture of the system.</li>
<li><strong>Penetration Testing and Code Review</strong>: During the development of the
- platform, Android-created and open-source components are subject to vigorous
+ platform, Android-created and open source components are subject to vigorous
security reviews. These reviews are performed by the Android Security Team,
Google’s Information Security Engineering team, and independent security
consultants. The goal of these reviews is to identify weaknesses and possible
- vulnerabilities well before the platform is open-sourced, and to simulate the
+ vulnerabilities well before the platform is open sourced, and to simulate the
types of analysis that will be performed by external security experts upon
release.</li>
<li><strong>Open Source and Community Review</strong>: The Android Open Source Project enables
diff --git a/src/devices/tech/security/overview/updates-resources.jd b/src/devices/tech/security/overview/updates-resources.jd
index d6b1cb6..c4561f4 100644
--- a/src/devices/tech/security/overview/updates-resources.jd
+++ b/src/devices/tech/security/overview/updates-resources.jd
@@ -252,10 +252,7 @@
<p>Security information exists throughout the Android Open Source and Developer
sites. Good places to start:<br>
<a href="http://source.android.com/devices/tech/security/index.html">http://source.android.com/devices/tech/security/index.html</a><br>
-<a href="https://developer.android.com/guide/topics/security/security.html">https://developer.android.com/guide/topics/security/security.html</a></p>
-
-<p>Security best practices for developers: <a
-href="https://developer.android.com/guide/practices/security.html">https://developer.android.com/guide/practices/security.html</a>.</p>
+<a href="https://developer.android.com/training/articles/security-tips.html">https://developer.android.com/training/articles/security-tips.html</a></p>
<p>Community resource for discussion about Android security: <a
href="https://groups.google.com/forum/?fromgroups#!forum/android-security-discuss">https://groups.google.com/forum/?fromgroups#!forum/android-security-discuss</a></p>
diff --git a/src/devices/tech/security/selinux/customize.jd b/src/devices/tech/security/selinux/customize.jd
index 63b3b56..a84d60f 100644
--- a/src/devices/tech/security/selinux/customize.jd
+++ b/src/devices/tech/security/selinux/customize.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2014 The Android Open Source Project
+ Copyright 2015 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.
@@ -271,3 +271,30 @@
</td>
</tr>
</table>
+
+<h2 id=neverallow>neverallow rules</h2>
+
+<p>SELinux <code>neverallow</code> rules prohibit behavior that should never occur.
+With <a href="{@docRoot}compatibility/index.html">compatibility</a> testing,
+SELinux <code>neverallow</code> rules are now enforced across partner devices.</p>
+
+<p>The following guidelines are intended to help manufacturers avoid errors
+related to <code>neverallow</code> rules during customization. The rule numbers
+used here correspond to Android 5.1 and are subject to change by release.</p>
+
+<p>Rule 48: <code>neverallow { domain -debuggerd -vold -dumpstate
+-system_server } self:capability sys_ptrace;</code><br>
+See the man page for <code>ptrace</code>. The <code>sys_ptrace</code>
+capability grants the ability to <code>ptrace</code> any process, which allows a great deal
+of control over other processes and should belong only to designated system
+components, outlined in the rule. The need for this capability often indicates
+the presence of something that is not meant for user-facing builds or
+functionality that isn’t needed. Remove the unnecessary component.</p>
+
+<p>Rule 76: <code>neverallow { domain -appdomain -dumpstate -shell -system_server -zygote } { file_type -system_file -exec_type }:file execute;</code><br>
+This rule is intended to prevent the execution of arbitrary code on the system.
+Specifically, it asserts that only code on <code>/system</code> gets executed,
+which allows security guarantees thanks to mechanisms such as verified boot.
+Often, the best solution when encountering a problem with this
+<code>neverallow</code> rule is to move the offending code to the
+<code>/system</code> partition.</p>
diff --git a/src/devices/tech/security/verifiedboot/dm-verity.jd b/src/devices/tech/security/verifiedboot/dm-verity.jd
index f86c1b2..0b03dda 100644
--- a/src/devices/tech/security/verifiedboot/dm-verity.jd
+++ b/src/devices/tech/security/verifiedboot/dm-verity.jd
@@ -189,6 +189,9 @@
<p>And this table describes those metadata fields.</p>
+<p class="table-caption" id="table1">
+ <strong>Table 1.</strong> Verity metadata fields</p>
+
<table>
<tr>
<th>Field</th>
@@ -233,3 +236,11 @@
<td>0</td>
</tr>
</table>
+
+<h3 id="optimize">Optimizing dm-verity</h3>
+
+<p>To get the best performance out of dm-verity, you should:</p>
+ <ul>
+ <li>In the kernel, turn on NEON SHA-2 for ARMv7 and the SHA-2 extensions for ARMv8.
+ <li>Experiment with different read-ahead and prefetch_cluster settings to find the best configuration for your device.
+ </ul>
diff --git a/src/devices/tech/security/verifiedboot/verified-boot.jd b/src/devices/tech/security/verifiedboot/verified-boot.jd
index c96d930..19a95a4 100644
--- a/src/devices/tech/security/verifiedboot/verified-boot.jd
+++ b/src/devices/tech/security/verifiedboot/verified-boot.jd
@@ -41,6 +41,9 @@
<h2 id=glossary>Glossary</h2>
+<p class="table-caption" id="table1">
+ <strong>Table 1.</strong> Glossary of terms related to verified boot</p>
+
<table>
<tr>
<td>
@@ -65,7 +68,7 @@
</td>
<td>
<p>The device state indicates how freely software can be flashed to the device.
-Device states are LOCKED, UNLOCKED, or VERIFIED.</p>
+Device states are LOCKED and UNLOCKED.</p>
</td>
</tr>
<tr>
@@ -94,38 +97,39 @@
must be used to verify the boot image.</p>
</td>
</tr>
- <tr>
- <td>
-<p>User provided keystore</p>
-</td>
- <td>
-<p>The user keystore is a keystore flashed to the device via <code>fastboot
-flash keystore <path></code>.</p>
-</td>
- </tr>
</table>
<h2 id=overview>Overview</h2>
<p>In addition to device state - which already exists in devices and controls
whether the bootloader allows new software to be flashed - we introduce the
-concept of boot state that indicates the state of device integrity. We also
-add a third device state, which allows developers for example, to flash the
-software more frequently without a data wipe while still benefiting from
-verification.</p>
+concept of boot state that indicates the state of device integrity.</p>
+
+<h3 id=classes>Classes</h3>
+
+<p>We define two implementation classes for verified boot depending on how
+fully the device implements this specification, as follows:</p>
+
+<p><strong>Class A</strong> implements verified boot with full chain of trust
+up to verified partitions. This implementation must support the LOCKED device
+state, and GREEN and RED boot states.</p>
+
+<p><strong>Class B</strong> implements Class A and additionally supports the
+UNLOCKED device state and the ORANGE boot state.</p>
<h3 id=verification_keys>Verification keys</h3>
<p>Bootloader integrity must be verified using a hardware root of trust. For
-verifying boot and recovery images, the bootloader must have a fixed OEM key
-available to it. It must always attempt to verify the boot image using the OEM
-key and only try other possible keys if this verification fails.</p>
+verifying boot and recovery partitions, the bootloader must have a fixed OEM key
+available to it. It must always attempt to verify the boot partition using the OEM
+key first and try other possible keys only if this verification fails.</p>
-<p>It must be possible for the user to flash alternative image verification keys
-to the device, and the bootloader must try verification using these keys if
-verification using the OEM key fails. However, using an image signed with the
-user-provided keystore must result in a notification to be shown, as described
-below.</p>
+<p>In Class B implementations, it must be possible for the user to flash
+software signed with other keys when the device is UNLOCKED. If the device is
+then LOCKED and verification using the OEM key fails, the bootloader must try
+verification using the certificate embedded in the partition signature.
+However, using a partition signed with anything other than the OEM key must
+result in a notification or a warning, as described below.</p>
<h3 id=boot_state>Boot state</h3>
@@ -133,103 +137,62 @@
attempt:</p>
<ul>
- <li> GREEN, indicating a full chain of trust extending from the bootloader to the
-system partition, including the bootloader, boot partition, and system
-partition.
+ <li>GREEN, indicating a full chain of trust extending from the bootloader to
+verified partitions, including the bootloader, boot partition, and all verified
+partitions.
+
+ <li>YELLOW, indicating the boot partition has been verified using the
+embedded certificate, and the signature is valid. The bootloader is required to
+display a notification and the fingerprint of the public key during boot.
+
+ <li>ORANGE, indicating a device may be freely modified. Device integrity is
+left to the user to verify out-of-band. The bootloader must display a warning
+to the user before allowing the boot process to continue.
+
+ <li>RED, indicating the device has failed verification. The bootloader must
+display a warning to the user before allowing the boot process to continue.
</ul>
-<ul>
- <li> YELLOW, indicating a chain of trust starting from a user-provided keystore
-and extending up. To enable users to acquire trust in their keystore,
-bootloaders are required to display a partial hash of the verifying keystore
-during boot.
-</ul>
+<p>The recovery partition must also be verified in the exact same way.</p>
-<ul>
- <li> ORANGE, indicating a device may be freely modified. Device integrity is
-left to the user to verify out-of-band.
-</ul>
+<h3 id=device_state>Device state</h3>
-<ul>
- <li> RED, indicating the device has failed verification. This must display a
-warning to the user before allowing the boot process to continue.
-</ul>
+<p>The device is required to be in one of two states at all times:</p>
-<p>The recovery partition must also be verified and should be verified in the
-exact same way.</p>
+<ol>
+ <li>LOCKED, indicating the device cannot be flashed. A LOCKED device must
+boot into the GREEN, YELLOW, or RED states during any attempted boot.
+
+ <li>UNLOCKED, indicating the device may be flashed freely and is not intended
+to be verified. An UNLOCKED device must always boot to the ORANGE boot state.
+</ol>
<img src="../images/verified_boot.png" alt="Verified boot flow" id="figure1" />
<p class="img-caption"><strong>Figure 1.</strong> Verified boot flow</p>
-<h3 id=device_state>Device state</h3>
-
-<p>The device is required to be in one of three states at all times:</p>
-
-<ol>
- <li>LOCKED, indicating the device cannot currently be flashed. In the image
-above, a LOCKED device must boot into the GREEN state, YELLOW state, or RED
-state during any attempted boot. It must not be possible to alter the user
-keystore in the LOCKED state.
-
- <li>VERIFIED, indicating someone in physical control of the device may perform
-limited actions intended to change the state of the device but may not break
-its current chain of trust. In the image above, a VERIFIED device must boot
-into the GREEN state, YELLOW state, or RED state during each attempted boot. It
-must not be possible to alter the user keystore in the VERIFIED state. It must
-be possible to:
- <ol>
- <li> Flash the following partitions:
- <ol>
- <li> bootloader
- <li> boot partition
- <li> system partition
- <li> vendor partition
- <li> recovery partition
- </ol>
- <li> Erase the following partitions:
- <ol>
- <li> userdata
- <li> cache
- </ol>
- </ol>
-
-<p>Boot and recovery image signatures may be verified during the flashing process,
-and the bootloader may reject images that do not validate against the OEM key
-or the user-provided keystore at this point. However, signatures must also be
-verified again at every boot.
-
- <li>UNLOCKED, indicating the device may be flashed freely and is not intended
-to be verified.
-</ol>
-
<h2 id=detailed_design>Detailed design</h2>
<p>Achieving full chain of trust requires support from both the bootloader and the
-software on the boot partition, specifically <code>init</code>, which is responsible for
-mounting additional partitions. Verification metadata must also be appended to the
-system partition and any additional partitions whose integrity should be
-verified.</p>
+software on the boot partition, which is responsible for mounting further
+partitions. Verification metadata must also be appended to the system partition
+and any additional partitions whose integrity should be verified.</p>
<h3 id=bootloader_requirements>Bootloader requirements</h3>
-<p>The bootloader is the guardian of the device state, manages the user-provided
-keystore, and is responsible for initializing the TEE and binding its root of
-trust.</p>
+<p>The bootloader is the guardian of the device state and is responsible for
+initializing the TEE and binding its root of trust.</p>
<p>Most importantly, the bootloader must verify the integrity of the boot and/or
recovery partition before moving execution to the kernel and display the
-warnings or notifications in the section <a href="#boot_state">Boot state</a>.</p>
+warnings specified in the section <a href="#boot_state">Boot state</a>.</p>
-<h4 id=changing_device_state><strong>Changing device state</strong></h4>
+<h4 id=changing_device_state>Changing device state</h4>
<p>State changes are performed using the <code>fastboot flashing [unlock |
-verified | lock]</code> command. And to protect user data, <strong>all</strong>
+lock]</code> command. And to protect user data, <strong>all</strong>
state transitions require a data wipe. Note the user must be asked for
confirmation before data is deleted.</p>
-<img src="../images/device_states.png" alt="Changing device states" id="figure2" />
-<p class="img-caption"><strong>Figure 2.</strong> Changing device states</p>
-
<ol>
<li>The UNLOCKED to LOCKED transition is anticipated when a user buys a used
development device. As a result of locking the device, the user should have
@@ -237,20 +200,13 @@
<li>The LOCKED to UNLOCKED transition is expected in the case where a developer
wishes to disable verification on the device.
-
- <li>The LOCKED to VERIFIED transition is expected in the case where a developer
-wishes to do development on the device and doesn’t want to wipe data frequently.
-
- <li>The VERIFIED to LOCKED transition is idempotent with the above.
-
- <li>The UNLOCKED to VERIFIED transition is anticipated when a user wishes to put a
-development device in a more secure state but may not want to prevent
-themselves from flashing new system images.
-
- <li> The VERIFIED to UNLOCKED transition is idempotent with the above.
</ol>
<p>Requirements for <code>fastboot</code> commands that alter device state are listed in the table below:</p>
+
+<p class="table-caption" id="table2">
+ <strong>Table 2.</strong> <code>fastboot</code> commands</p>
+
<table>
<tr>
<td>
@@ -266,9 +222,8 @@
flashing lock</code></td>
<td>
<ul>
- <li>Wipe data after asking the user for confirmation
+ <li>Wipe data after asking the user for confirmation
<li>Clear a write-protected bit indicating the device is unlocked
- <li>Clear a write-protected bit indicating the device is verified
</ul>
</td>
</tr>
@@ -278,21 +233,8 @@
flashing unlock</code></td>
<td>
<ul>
- <li>Wipe data after asking the user for confirmation
+ <li>Wipe data after asking the user for confirmation
<li>Set a write-protected bit indicating the device is unlocked
- <li>Clear a write-protected bit indicating the device is verified
-</ul>
-</td>
- </tr>
- <tr>
- <td>
-<code>
-flashing verified</code></td>
- <td>
-<ul>
- <li>Wipe data after asking the user for confirmation
- <li>Clear a write-protected bit indicating the device is unlocked
- <li>Set a write-protected bit indicating the device is verified
</ul>
</td>
</tr>
@@ -300,6 +242,10 @@
<p>When altering partition contents, the bootloader must check the bits set by
the above commands as described in the following table:</p>
+
+<p class="table-caption" id="table3">
+ <strong>Table 3.</strong> <code>fastboot</code> command requirements</p>
+
<table>
<tr>
<td>
@@ -314,128 +260,110 @@
<code>
flash <partition></code></td>
<td>
-<ul>
- <li>If the bit set by <code>flashing unlock</code> is set, flash the partition as normal
- <li>If this bit is not set, check the bit set by <code>flashing verified</code>
- <ul>
- <li>If this bit is not set, exit with an error
- <li>If this bit is set and <partition> is on the list provided in
- the section <a href="#device_state">Device state</a>, flash the partition as normal.
- </ul>
-</ul>
+ <p>If the bit set by <code>flashing unlock</code> is set, flash the
+ partition. Otherwise, do not allow flashing.<p>
</td>
</tr>
</table>
-<p>The same checks should be performed for any <code>fastboot</code> command that can be used to change the contents of partitions.</p>
+<p>The same checks should be performed for any <code>fastboot</code> command
+that can be used to change the contents of partitions.</p>
-<h4 id=managing_user_provided_keystore><strong>Managing user-provided keystore</strong></h4>
+<p class="note"><strong>Note</strong>: Class B implementations must support
+changing device state.</p>
-<p>Users can flash their own verification keys to the device, which must be
-used to verify the integrity of boot and recovery images if verification
-against the OEM key fails. This allows a developer to change the system
-software frequently, for example, while still keeping verified boot enabled.</p>
+<h4 id=binding_tee_root_of_trust>Binding TEE root of trust</h4>
-<p>The bootloader is responsible for maintaining the integrity of the user
-keystore. It must not be possible to change the contents of the keystore unless
-the device is UNLOCKED. When the user flashes a new keystore to the device, the
-bootloader must sign it using the TEE and store the signed keystore. Before
-using keys from the keystore, the bootloader must use the TEE to verify the
-signature.</p>
-
-<p>Requirements for <code>fastboot</code> commands used to manage the user-provided keystore are listed in the table
-below:</p>
-<table>
- <tr>
- <td>
-<p><strong><code>fastboot</code> command</strong></p>
-</td>
- <td>
-<p>Requirements</p>
-</td>
- </tr>
- <tr>
- <td>
-<code>
-flash keystore <filename></code></td>
- <td>
-<ul>
- <li>Check the bit set by <code>flashing unlock</code>; if not set, exit with an error
- <li>Validate the given keystore against the format provided in section <a href="#keystore_format">Keystore format</a>
- <li>Pass the keystore to the TEE for signing
- <li>Write the signed keystore to the write-protected user keystore storage
- area (location to be determined by the OEM)
-</ul>
-</td>
- </tr>
- <tr>
- <td>
-<code>
-erase keystore</code></td>
- <td>
-<ul>
- <li>Check the bit set by <code>flashing unlock</code>; if not set, exit with an error
- <li>Erase the keystore stored in the write-protected user keystore storage area
-</ul>
- </td>
- </tr>
-</table>
-
-<h4 id=binding_tee_root_of_trust><strong>Binding TEE root of trust</strong></h4>
-
-<p>After the bootloader has initialized the TEE and performed boot image
-verification steps, it must pass the following information to the TEE Keymaster
-as the root of trust:</p>
+<p>If TEE is available, the bootloader should pass the following information to
+the TEE to bind the Keymaster root of trust, after partition verification and
+TEE initialization:</p>
<ol>
- <li>The public key that was used to sign the boot image
- <li>The current device state (LOCKED, VERIFIED, or UNLOCKED)
+ <li>the public key that was used to sign the boot partition
+ <li>the current device state (LOCKED or UNLOCKED)
</ol>
-<p>This changes the keys derived by the TEE. For disk encryption, for example,
-this prevents user data from being decrypted when the device is booted using a
-potentially untrusted image signed with a different key.</p>
+<p>This changes the keys derived by the TEE. Taking disk encryption as an example,
+this prevents user data from being decrypted when the device state changes.</p>
<p class="note"><strong>Note:</strong> This means if the system software or the
device state changes, encrypted user data will no longer be accessible as the
TEE will attempt to use a different key to decrypt the data.</p>
-<h4 id=booting_into_recovery><strong>Booting into recovery</strong></h4>
+<h4 id=booting_into_recovery>Booting into recovery</h4>
-<p>The recovery image should be verified in exactly the same manner as the boot
-image.</p>
+<p>The recovery partition should be verified in exactly the same manner as the
+boot partition.</p>
+
+<h4 id=comm_boot_state>Communicating boot state</h4>
+
+<p>System software needs to be able to determine the verification status of
+previous stages. The bootloader must specify the current boot state as a
+parameter on the kernel command line (or through the device tree under
+<code>firmware/android/verifiedbootstate</code>) as described in the table
+below:</p>
+
+<p class="table-caption" id="table4">
+ <strong>Table 4.</strong> Kernel command line parameters</p>
+
+<table>
+ <tr>
+ <th>Kernel command line parameter</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><code>androidboot.verifiedbootstate=green</code></td>
+ <td>Device has booted into GREEN boot state.<br>
+ Boot partition has been verified using the OEM key and it’s valid.</td>
+ </tr>
+ <tr>
+ <td><code>androidboot.verifiedbootstate=yellow</code></td>
+ <td>Device has booted into YELLOW boot state.<br>
+ Boot partition has been verified using the certificate embedded into
+ the signature and it’s valid.</td>
+ </tr>
+ <tr>
+ <td><code>androidboot.verifiedbootstate=orange</code></td>
+ <td>Device has booted into ORANGE boot state.<br>
+ The device is unlocked and no verification has been performed.</td>
+ </tr>
+ <tr>
+ <td><code>androidboot.verifiedbootstate=red</code></td>
+ <td>Device has booted into RED boot state.<br>
+ The device has failed verification.</td>
+ </tr>
+</table>
<h3 id=boot_partition>Boot partition</h3>
-<p>Once execution has moved to the boot and/or recovery image, <code>init</code> is responsible
-for setting up verification for further partitions. Due to its large size, the
-system partition cannot be verified similarly to previous parts but must be
-verified in real time as it’s being accessed by using the dm-verity kernel
-driver.</p>
+<p>Once execution has moved to the boot partition, the software there is responsible
+for setting up verification of further partitions. Due to its large size, the
+system partition typically cannot be verified similarly to previous parts but must be
+verified as it’s being accessed instead using the dm-verity kernel driver or a
+similar solution.</p>
-<p>When <code>fs_mgr</code> flags in the device’s <code>fstab</code> indicate a partition should be
-verified, <code>init</code> will verify the signed verity metadata appended to the partition
-before mounting it and set up the dm-verity device for the partition.</p>
+<p>If dm-verity is used to verify large partitions, the signature of the verity
+metadata appended to each verified partition must be verified before the
+partition is mounted and dm-verity is set up for it.</p>
-<h4 id=managing_dm-verity><strong>Managing dm-verity</strong></h4>
+<h4 id=managing_dm-verity>Managing dm-verity</h4>
-<p>By default, dm-verity operates in verifying mode and verifies each block read
-from the device against a hash tree passed to it by <code>init</code> during set up. If it
+<p>By default, dm-verity operates in enforcing mode and verifies each block read
+from the partition against a hash tree passed to it during setup. If it
comes across a block that fails to verify, it returns an I/O error and makes
the block with unexpected contents inaccessible to user space. Depending on
which block is corrupted, this may cause some of the programs that reside on
the partition to malfunction.</p>
-<p>Using a persistent flag, dm-verity can also be configured to function in
-logging mode. This flag is read by <code>init</code> when setting up dm-verity. And if the
-mode flag is set to logging or verity metadata cannot be verified, a warning
-must be displayed to the user, similar to the warning the bootloader shows
-before booting into RED state.</p>
+<p>Using an optional verity table parameter, dm-verity can be configured to
+function in logging mode. If dm-verity is not started in enforcing mode for any
+reason, or verity metadata cannot be verified, a warning must be displayed to
+the user, similar to the one shown before booting into the RED state.</p>
-<img src="../images/dm-verity_mgmt.png" alt="dm-verity management" id="figure3" />
-<p class="img-caption"><strong>Figure 3.</strong> dm-verity management</p>
+<img src="../images/dm-verity_mgmt.png" alt="dm-verity management" id="figure2" />
+<p class="img-caption"><strong>Figure 2.</strong> dm-verity management</p>
-<h4 id=recovering_from_dm-verity_errors><strong>Recovering from dm-verity errors</strong></h4>
+<h4 id=recovering_from_dm-verity_errors>Recovering from dm-verity errors</h4>
<p>Since the system partition is by far larger than the boot partition, the
probability of verification errors is also higher. Specifically, there is a
@@ -445,31 +373,32 @@
<p>It’s generally not possible to distinguish disk corruption from malicious
changes, so any change to the system partition must result in the user being
-notified, and no unverified data must leak to user space until a warning has
+notified; and no unverified data must leak to user space until a warning has
been shown. However, we must also assume most verification failures are
not the result of malicious behavior; so the user must also have an option to
continue using the device without verification.</p>
-<p>If dm-verity is in verifying mode and a block of a partition fails to verify,
-it will send a <code>uevent</code> to notify user space of the error. This event must be
-handled by software in the boot partition as potentially any program residing
-on the verified partition may not function anymore. When the event is received,
-the persistent dm-verity state must be updated to set the mode flag to logging
-mode, and the device must be rebooted. When the device restarts,
-<code>init</code> will warn the user of changes to the partition before mounting it.</p>
+<p>When a dm-verity error is detected, the device must be rebooted and
+dm-verity must be started in logging mode during all subsequent restarts until
+any of the verified partitions is reflashed or changed by an OTA update. This
+means dm-verity state should be stored in a persistent flag. When a verified
+partition has been changed, the flag must be cleared and dm-verity must again
+be started in enforcing mode. Anytime dm-verity is not started in enforcing
+mode, a warning must be shown to the user before any of the verified partitions
+are mounted.</p>
<h3 id=verified_partition>Verified partition</h3>
<p>In a verified device, the system partition must always be verified. But any
-other read-only partition can also be set to be verified, as well. Specifically,
-any read-only partition that contains executable code must be verified on a
-verified device. This include the vendor partition, if one exists, for example.</p>
+other read-only partition should also be set to be verified, as well. Any
+read-only partition that contains executable code must be verified on a
+verified device. This includes vendor and OEM partitions, if they exist, for example.</p>
<p>In order for a partition to be verified, signed verity metadata must be
appended to it. The metadata consists of a hash tree of the partition contents
and a verity table containing signed parameters and the root of the hash tree.
-If this information is missing or invalid when <code>init</code> attempts to
-mount the device, the user must be warned.</p>
+If this information is missing or invalid when dm-verity is set up for the
+partition, the user must be warned.</p>
<h2 id=implementation_details>Implementation details</h2>
@@ -481,7 +410,6 @@
<h3 id=signature_format>Signature format</h3>
-
<p>The signature on an Android verifiable boot image is an ASN.1 DER-encoded
message, which can be parsed with a decoder similar to the one found at: <a
href="https://android.googlesource.com/platform/bootable/recovery/+/f4a6ab27b335b69fbc419a9c1ef263004b561265/asn1_decoder.cpp">platform/bootable/recovery/asn1_decoder.cpp</a><br/>
@@ -508,9 +436,9 @@
<p>The <code>Certificate</code> field is the full X.509 certificate containing
the public key used for signing, as defined by <a
href="http://tools.ietf.org/html/rfc5280#section-4.1.1.2">RFC5280</a> section
-4.1. The bootloader must ignore this field and must NOT use the key
-specified in the certificate to verify the signature. Signatures must always be
-verified against the OEM key or the user-provided keystore only.</p>
+4.1. When LOCKED, the bootloader must always use the OEM key for verification
+first, and only boot to YELLOW or RED states if the embedded certificate is
+used for verification instead.</p>
<p>The remaining structure is similar to that defined by <a
href="http://tools.ietf.org/html/rfc5280#section-4.1.1.2">RFC5280</a> sections
@@ -526,7 +454,8 @@
<li>Generate the unsigned image.
<li>0-pad the image to the next page size boundary (omit this step if already
aligned).
- <li>Populate the fields of the <code>AuthenticatedAttributes</code> section above based on the padded image and desired target partition.
+ <li>Populate the fields of the <code>AuthenticatedAttributes</code> section
+ above based on the padded image and desired target partition.
<li>Append the <code>AuthenticatedAttributes</code> structure above to the image.
<li>Sign the image.
</ol>
@@ -537,55 +466,23 @@
a header).
<li>Read the signature located at the offset above.
<li>Validate the contents of the <code>AuthenticatedAttributes</code> field.
-If these values do not validate, treat it as a signature validation error.
+ If these values do not validate, treat it as a signature validation error.
<li>Verify the image and <code>AuthenticatedAttributes</code> sections.
</ol>
-<h3 id=keystore_format>Keystore format</h3>
-
-<p>The Android verified boot keystore format is an ASN.1 DER-encoded document. Its
- specification follows:</p>
-
-<pre>
-AndroidVerifiedBootKeystore DEFINITIONS ::=
- BEGIN
- FormatVersion ::= INTEGER
- KeyBag ::= SEQUENCE {
- Key ::= SEQUENCE {
- AlgorithmIdentifier ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters ANY DEFINED BY algorithm
- OPTIONAL
- }
- KeyMaterial ::= RSAPublicKey
- }
- }
- Signature ::= AndroidVerifiedBootSignature OPTIONAL
- END
-</pre>
-
-<p>Where <code>RSAPublicKey</code>, <code>AlgorithmIdentifier</code>, and
-parameters are as specified in <a
-href="http://tools.ietf.org/html/rfc3279#section-2.3.1">RFC3279</a>. Other key
-types specified in RFC3279 section 2.3 may optionally be supported,
-in which case the appropriate type for <code>Key</code> must be used.</p>
-
-<h3 id=keystore_location>Keystore location</h3>
-
-<p>The location of the keystore is not specified here, but that location must be
-known to the bootloader and both readable and writable by it. Reading should
-happen as per the above; writing a new keystore should be accomplished through
-<code>fastboot flash keystore <path></code>. Sufficient storage must be
-provided for at least one key, with storage for additional keys recommended.</p>
-
<h3 id=user_experience>User experience</h3>
<p>A user in the GREEN boot state should see no additional user interaction besides that
-required by normal device boot. In other boot states, the user should see a
+required by normal device boot. In other boot states, the user must see a
warning for at least five seconds. Should the user interact with the device during
-this time, the warning should remain visible until the user agrees to continue.</p>
+this time, the warning must remain visible at least 30 seconds longer, or until
+the user dismisses the warning.</p>
<p>Sample user interaction screens for other states are shown in the following table:</p>
+
+<p class="table-caption" id="table5">
+ <strong>Table 5.</strong> Sample user interaction screens</p>
+
<table>
<tr>
<td>
@@ -601,11 +498,11 @@
</td>
<td>
<img src="../images/boot_yellow1.png" alt="Yellow device state 1" id="figure4" />
-<p class="img-caption"><strong>Figure 4.</strong> Yellow state example 1 UI</p>
+<p class="img-caption"><strong>Figure 3.</strong> Yellow state example 1 UI</p>
</td>
<td>
<img src="../images/boot_yellow2.png" alt="Yellow device state 2" id="figure5" />
-<p class="img-caption"><strong>Figure 5.</strong> Yellow state example 2 UI</p>
+<p class="img-caption"><strong>Figure 4.</strong> Yellow state example 2 UI</p>
</td>
</tr>
@@ -615,7 +512,7 @@
</td>
<td>
<img src="../images/boot_orange.png" alt="Orange device state" id="figure6" />
-<p class="img-caption"><strong>Figure 6.</strong> Orange state example UI</p>
+<p class="img-caption"><strong>Figure 5.</strong> Orange state example UI</p>
</td>
</tr>
<tr>
@@ -624,7 +521,7 @@
</td>
<td>
<img src="../images/boot_red.png" alt="Red device state" id="figure7" />
-<p class="img-caption"><strong>Figure 7.</strong> Red state example UI</p>
+<p class="img-caption"><strong>Figure 6.</strong> Red state example UI</p>
</td>
</tr>
</table>
diff --git a/src/devices/tech/test_infra/tradefed/full_example.jd b/src/devices/tech/test_infra/tradefed/full_example.jd
index 1be769f..4a29013 100644
--- a/src/devices/tech/test_infra/tradefed/full_example.jd
+++ b/src/devices/tech/test_infra/tradefed/full_example.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
<p>This tutorial guides you through the construction of a "hello world" Trade Federation test
configuration, and gives you a hands-on introduction to the Trade Federation framework. Starting
@@ -31,7 +38,7 @@
<p>When you are finished with the tutorial, you will have created a functioning TF configuration and
will have learned many of the most important concepts in the TF framework.</p>
-<h2>Set up TradeFederation development environment</h2>
+<h2 id="setup">Set up Trade Federation development environment</h2>
<p>See the <a href="/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html"
>Machine Setup</a> page for how to setup the development environment. The rest of this tutorial
assumes you have a shell open that has been initialized to the Trade Federation environment.</p>
@@ -40,7 +47,7 @@
Trade Federation framework core library. This can be extended to developing modules outside the
source tree by simply compiling the tradefed JAR, and compiling your modules against that JAR.</p>
-<h2>Creating a test class (D)</h2>
+<h2 id="testclass">Creating a test class (D)</h2>
<p>Lets create a hello world test that just dumps a message to stdout. A tradefed test will
generally implement the <a href="/reference/com/android/tradefed/testtype/IRemoteTest.html"
>IRemoteTest</a> interface.</p>
@@ -69,7 +76,7 @@
<a href="/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html">Machine Setup</a> page
to ensure that you didn't miss any steps.</p>
-<h2>Creating a Configuration (I)</h2>
+<h2 id="createconfig">Creating a Configuration (I)</h2>
<p>Trade Federation tests are made executable by creating a <b>Configuration</b>, which is an XML file
that instructs tradefed on which test (or tests) to run, as well as which other modules to
execute, and in what order.</p>
@@ -86,7 +93,7 @@
<p>Note that we've specified the full class name of the HelloWorldTest. Save this data to a
<code>helloworld.xml</code> file anywhere on your local filesystem (eg <code>/tmp/helloworld.xml</code>).</p>
-<h2>Running the config (R)</h2>
+<h2 id="runconfig">Running the config (R)</h2>
<p>From your shell, launch the tradefed console</p>
<pre><code>$ tradefed.sh
</code></pre>
@@ -98,14 +105,13 @@
</code></pre>
<p>Configurations can be executed using the <code>run <config></code> console command. Try this:</p>
-<p>FIXME: redo this</p>
<pre><code>tf> run /tmp/helloworld.xml
05-12 13:19:36 I/TestInvocation: Starting invocation for target stub on build 0 on device 004ad9880810a548
Hello, TF World!
</code></pre>
<p>You should see "Hello, TF World!" outputted on the terminal.</p>
-<h2>Adding the config to the Classpath (D, I, R)</h2>
+<h2 id="addconfig">Adding the config to the Classpath (D, I, R)</h2>
<p>For convenience of deployment, you can also bundle configs into the tradefed jars
themselves. Tradefed will automatically recognize all configurations placed in 'config' folders on
the classpath.</p>
@@ -126,7 +132,7 @@
Hello, TF World!
</code></pre>
-<h2>Interacting with a Device (D, R)</h2>
+<h2 id="deviceinteract">Interacting with a Device (D, R)</h2>
<p>So far our hello world test isn't doing anything interesting. Tradefed's specialty is running
tests using Android devices, so lets add an Android device to the test.</p>
@@ -176,7 +182,7 @@
<p>You should see the new print message displaying the serial number of the device.</p>
-<h2>Sending Test Results (D)</h2>
+<h2 id="sendresults">Sending Test Results (D)</h2>
<p><code>IRemoteTest</code>s report results by calling methods on the
<a href="/reference/com/android/tradefed/result/ITestInvocationListener.html"
>ITestInvocationListener</a> instance provided to their <code>#run</code> method. Note that the
@@ -211,7 +217,7 @@
<a href="/reference/com/android/tradefed/testtype/package-summary.html">Test Types
documentation</a> for more details.</p>
-<h2>Storing Test Results (I)</h2>
+<h2 id="storeresults">Storing Test Results (I)</h2>
<p>By default, a TF config will use the
<a href="/reference/com/android/tradefed/result/TextResultReporter.html">TextResultReporter</a> as
the test listener implementation. <code>TextResultReporter</code> will dump the results of an
@@ -272,7 +278,7 @@
results to multiple independent destinations. Just specify multiple
<code><result_reporter></code> tags in your config to do this.</p>
-<h2>Logging (D, I, R)</h2>
+<h2 id="logging">Logging (D, I, R)</h2>
<p>TradeFederation includes two logging facilities:</p>
<ol>
<li>ability to capture logs from the device (aka device logcat)</li>
@@ -330,16 +336,16 @@
and send it the invocation listener for processing. <code>XmlResultReporter</code> will save the
captured device logcat as a file.</p>
-<h2>Option Handling (D, I, R)</h2>
+<h2 id="optionhandling">Option Handling (D, I, R)</h2>
<p>Objects loaded from a Trade Federation Configuration (aka <b>Configuration objects</b>) also have the
ability to receive data from command line arguments.</p>
<p>This is accomplished via the <code>@Option</code> annotation. To participate, a Configuration object class
would apply the <code>@Option</code> annotation to a member field, and provide it a unique name. This would
allow that member field's value to be populated via a command line option, and would also
-automatically add that option to the configuration help system (Note: not all field types are
-supported: see the
+automatically add that option to the configuration help system.</p>
+<p class="note"><strong>Note:</strong> Not all field types are supported. See the
<a href="/reference/com/android/tradefed/config/OptionSetter.html">OptionSetter javadoc</a> for a
-description of supported types).</p>
+description of supported types.</p>
<p>Let's add an <code>@Option</code> to the HelloWorldTest:</p>
<pre><code>@Option(name="my_option",
@@ -365,7 +371,7 @@
05-24 18:30:05 I/HelloWorldTest: I received option 'thisisthedefault'
</code></pre>
-<h3>Passing Values from the Command Line</h3>
+<h3 id="passclivalues">Passing Values from the Command Line</h3>
<p>Now pass in a value for my_option: you should see my_option getting populated with that value</p>
<pre><code>tf> run example/helloworld --my_option foo
…
@@ -398,7 +404,7 @@
<a href="/reference/com/android/tradefed/config/Option.Importance.html"
>Option.Importance javadoc</a> for details.</p>
-<h3>Passing Values from a Configuration</h3>
+<h3 id="passconfvalues">Passing Values from a Configuration</h3>
<p>You can also specify an Option's value within the config by adding a
<code><option name="" value=""></code> element. Let's see how this looks in
<code>helloworld.xml</code>:</p>
@@ -430,11 +436,10 @@
05-24 18:53:50 I/HelloWorldTest: Hello, TF World! I have device 004ad9880810a548
</code></pre>
-<h2>That's All, Folks!</h2>
+<h2 id="conclusion">That's All, Folks!</h2>
<p>As a reminder, if you're stuck on something, the
<a href="https://android.googlesource.com/platform/tools/tradefederation/+/master"
>Trade Federation source code</a> has a lot of useful information that isn't
exposed in the documentation. And if all else fails, try asking on the
-<a href="/source/community/index.html">android-platform</a> Google Group, with "Trade Federation"
+<a href="{@docRoot}source/community.html">android-platform</a> Google Group, with "Trade Federation"
in the message subject.</p>
-
diff --git a/src/devices/tech/test_infra/tradefed/fundamentals/index.jd b/src/devices/tech/test_infra/tradefed/fundamentals/index.jd
index 98ab260..68ff06d 100644
--- a/src/devices/tech/test_infra/tradefed/fundamentals/index.jd
+++ b/src/devices/tech/test_infra/tradefed/fundamentals/index.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -70,6 +70,6 @@
<p>If you've gotten through everything here and still have unanswered questions, first try taking
a look at the <a href="https://android.googlesource.com/platform/tools/tradefederation/+/master"
>Trade Federation source code.</a>. Beyond that, feel free to try asking on the
-<a href="/source/community/index.html">android-platform</a> Google Group. For best results, make
+<a href="{@docRoot}source/community.html">android-platform</a> Google Group. For best results, make
sure to mention "Trade Federation" (or "tradefed", or "TF") in the message subject.</p>
diff --git a/src/devices/tech/test_infra/tradefed/fundamentals/options.jd b/src/devices/tech/test_infra/tradefed/fundamentals/options.jd
index 930be9e..f054d43 100644
--- a/src/devices/tech/test_infra/tradefed/fundamentals/options.jd
+++ b/src/devices/tech/test_infra/tradefed/fundamentals/options.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
<p>Option handling lies at the heart of Trade Federation's modular approach. In particular, options
are the mechanism by which the Developer, Integrator, and Test Runner can work together without
@@ -25,11 +32,11 @@
the Test Runner. This mechanism works for all Java intrinsic types, as well as for any
<code>Map</code>s or <code>Collection</code>s of intrinsic types.</p>
-<p><em>Note:</em> the option-handling mechanism only works for classes implementing one of the
+<p class="note"><strong>Note:</strong> The option-handling mechanism only works for classes implementing one of the
interfaces included in the <a href="lifecycle.html">Test Lifecycle</a>, and only when that class is
<em>instantiated</em> by the lifecycle machinery.</p>
-<h2>Developer</h2>
+<h2 id="developer">Developer</h2>
<p>To start off, the developer marks a member with the
<code><a href="https://android.googlesource.com/platform/tools/tradefederation/+/master/src/com/android/tradefed/config/Option.java"
>@Option</a></code> annotation. <!-- note: javadoc for the Option class is broken -->
@@ -60,7 +67,7 @@
or perform some kind of filtering on <code>Map</code> and <code>Collection</code> fields, which are
otherwise append-only.</p>
-<h2>Integrator</h2>
+<h2 id="integrator">Integrator</h2>
<p>The Integrator works in the world of Configurations, which are written in XML. The config format
allows the Integrator to set (or append) a value for any <code>@Option</code> field. For instance,
suppose the Integrator wanted to define a lower-latency test that calls the default number, as well
@@ -83,7 +90,7 @@
</test>
</configuration></pre></code>
-<h2>Test Runner</h2>
+<h2 id="testrunner">Test Runner</h2>
<p>The Test Runner also has access to these configuration points via the Trade Federation console.
First and foremost, they will run a Command (that is, a config and all of its arguments) with the
<code>run command <name></code> instruction (or <code>run <name></code> for short).
@@ -97,4 +104,3 @@
<p>Or, to get a similar effect from the opposite direction, the Test Runner could reduce the wait time
for the <code>many-numbers</code> test:</p>
<code><pre>tf >run many-numbers.xml --timeout 5000</code></pre>
-
diff --git a/src/devices/tech/test_infra/tradefed/index.jd b/src/devices/tech/test_infra/tradefed/index.jd
index dabe07f..64939b2 100644
--- a/src/devices/tech/test_infra/tradefed/index.jd
+++ b/src/devices/tech/test_infra/tradefed/index.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,6 +16,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
+
<p>Trade Federation (tradefed or TF for short) is a continuous test framework designed for running tests
on Android devices. It's a Java application which runs on a host computer, and communicates to one or
more Android devices using ddmlib (the library behind DDMS) over adb.</p>
diff --git a/src/devices/tv/HDMI-CEC.jd b/src/devices/tv/HDMI-CEC.jd
index bbf6547..03c364d 100644
--- a/src/devices/tv/HDMI-CEC.jd
+++ b/src/devices/tv/HDMI-CEC.jd
@@ -87,7 +87,7 @@
<p>Here are the key ingredients to a proper Android HDMI-CEC implementation:</p>
<ul>
- <li> A manager class <code>HdmiControlManager</code> provides priviledged apps with the API. System services like TV Input Manager service and Audio service can grab the service directly.</li>
+ <li> A manager class <code>HdmiControlManager</code> provides privileged apps with the API. System services like TV Input Manager service and Audio service can grab the service directly.</li>
<li> The service is designed to allow hosting more than one type of logical device.</li>
<li> HDMI-CEC is connected with the hardware via a hardware abstraction layer (HAL)
to simplify handling differences of the protocol and signalling mechanisms
@@ -104,7 +104,7 @@
<p>Depending on whether your device is a HDMI sink device or a HDMI source device,
-device manufactureres need to set <code>ro.hdmi.device_type</code> in <code>device.mk</code> for <code>HdmiControlService</code> to work correctly.</p>
+device manufacturers need to set <code>ro.hdmi.device_type</code> in <code>device.mk</code> for <code>HdmiControlService</code> to work correctly.</p>
<p>For HDMI source devices, like Over the Top (OTT) boxes, set:</p>
@@ -126,7 +126,7 @@
Note that any change made in the service for manufacturer-specific commands
must not interfere with the way standard commands are handled or the device
will not be Android compatible.</li>
- <li> Access to the HDMI-CEC service is guarded with the protection level <code>SignatureOrSystem</code>. Only system components or the apps placed in <code>/system/priv-app</code> can access the service. This is to protect the service from abuse by apps with malicous intent.</li>
+ <li> Access to the HDMI-CEC service is guarded with the protection level <code>SignatureOrSystem</code>. Only system components or the apps placed in <code>/system/priv-app</code> can access the service. This is to protect the service from abuse by apps with malicious intent.</li>
</ul>
<p>Android supports type <code>TV/Display(0)</code> and <code>playback device(4)</code>, which can issue the One Touch Play command to display. The other types (tuner
diff --git a/src/images/android_framework_details.png b/src/images/android_framework_details.png
index 618f027..ed83453 100644
--- a/src/images/android_framework_details.png
+++ b/src/images/android_framework_details.png
Binary files differ
diff --git a/src/images/android_framework_small.png b/src/images/android_framework_small.png
index 475f58d..6030881 100644
--- a/src/images/android_framework_small.png
+++ b/src/images/android_framework_small.png
Binary files differ
diff --git a/src/images/cts-0.png b/src/images/cts-0.png
deleted file mode 100644
index cca38c5..0000000
--- a/src/images/cts-0.png
+++ /dev/null
Binary files differ
diff --git a/src/index.jd b/src/index.jd
index ba60884..c903f3e 100644
--- a/src/index.jd
+++ b/src/index.jd
@@ -25,12 +25,13 @@
<div class="landing-banner">
<h1 itemprop="name" style="margin-bottom:0;">Welcome to the Android Open Source Project!</h1>
- <p>
- Android is an open-source software stack for a wide range of mobile devices and a corresponding open-source project led by
- Google. Here you can find the information and source code you need to learn more about the Android platform. From there you can
- create custom variants of the Android software stack, port devices and accessories to the Android platform,
- and ensure your devices are compatible with the Android compatibility definition.
- </p>
+<p>
+Android is an open source software stack for a wide range of mobile devices and
+a corresponding open source project led by Google. This site offers the
+information and source code you need to create custom variants of the Android
+stack, port devices and accessories to the Android platform, and ensure your
+devices meet compatibility requirements.
+</p>
<h2 align="center">Android 6.0 Updates Available — see details below</h2>
</div>
@@ -42,6 +43,31 @@
<div class="landing-docs">
<div class="col-8">
<h3>What's New</h3>
+<a href="{@docRoot}source/build-numbers.html">
+ <h4>Android 6.0 and 5.1 Build Numbers and CTS Packages</h4></a>
+ <p>You can now find <strong><a
+ href="{@docRoot}source/build-numbers.html#source-code-tags-and-builds">Build
+ Numbers</a></strong> and CTS packages for <strong><a
+ href="{@docRoot}compatibility/downloads.html#android-60">Android
+ 6.0</a></strong> and <strong><a
+ href="{@docRoot}compatibility/downloads.html#android-51">Android
+ 5.1</a></strong>.</p>
+
+<a href="{@docRoot}devices/halref/index.html">
+ <h4>HAL and Trad Fed Reference Files</h4></a>
+ <p>Both the <strong><a
+ href="{@docRoot}devices/halref/index.html">Hardware Abstraction Layer
+ (HAL)</a></strong> and <strong><a
+ href="{@docRoot}reference/packages.html">Trade Federation Testing
+ Suite</a></strong> reference files have been updated for Android 6.0.</p>
+
+<a href="{@docRoot}devices/tech/security/enhancements/index.html">
+ <h4>Android 6.0 Security Enhancements</h4></a>
+ <p>The Android security team lists the latest measures undertaken to
+ strengthen the operating system in the new <strong><a
+ href="{@docRoot}devices/tech/security/enhancements/enhancements60.html">Security
+ Enhancements in Android 6.0</a></strong>.</p>
+
<a href="{@docRoot}devices/tech/power/index.html">
<h4>Doze and App Standby</h4></a>
<p>New battery-saving features <em>Doze</em> and <em>App Standby</em>
@@ -63,7 +89,7 @@
interfaces in detail, including a list of <strong><a
href="{@docRoot}devices/tech/security/authentication/km-features.html">Keymaster
features</a></strong> and an <strong><a
- href="{@docRoot}devices/tech/security/authentication/km-implementer-ref.html">implementer’s
+ href="{@docRoot}devices/tech/security/authentication/km-implementer-ref.html">implementer's
reference</a></strong>.</p>
<a href="{@docRoot}devices/storage/index.html">
@@ -81,34 +107,11 @@
<p>Instructions now exist for configuring <strong><a
href="{@docRoot}devices/tech/config/runtime_perms.html">runtime permissions</a></strong>,
<strong><a href="{@docRoot}devices/tech/config/voicemail.html">visual
- voicemail</a></strong>, and Android’s new <strong><a
+ voicemail</a></strong>, and Android's new <strong><a
href="{@docRoot}devices/tech/config/filesystem.html">file
system</a></strong>. And carriers get <strong><a
href="{@docRoot}devices/tech/config/carrier.html">custom
configuration</a></strong>.</p>
-
-<a href="{@docRoot}devices/tech/debug/index.html">
- <h4>Tooling</h4></a>
- <p>Information on the <strong><a href="{@docRoot}source/jack.html">Jack
- (Java Android Compiler Kit)</a></strong> default toolchain in Android 6.0 is
- available, as well as instructions for <strong><a
- href="{@docRoot}devices/tech/dalvik/gc-debug.html">debugging garbage collection
- in ART</a></strong>.</p>
-
-<a href="{@docRoot}devices/media/index.html">
- <h4>Media</h4></a>
- <p>The <strong><a
- href="{@docRoot}devices/media/index.html">Media</a></strong> section now
- contains descriptions of media resource manager dependencies for <strong><a
- href="{@docRoot}devices/media/oem.html">OEMs</a></strong> and <strong><a
- href="{@docRoot}devices/media/soc.html">SoC vendors</a></strong>.</p>
-
-<a href="{@docRoot}accessories/stylus.html">
- <h4>Bluetooth Stylus</h4></a>
- <p>The <strong><a
- href="{@docRoot}accessories/index.html">Accessories</a></strong>
- section now explains how to implement a <strong><a
- href="{@docRoot}accessories/stylus.html">Bluetooth Stylus</a></strong>.</p>
</div>
<div class="col-8">
@@ -122,7 +125,7 @@
href="https://android.googlesource.com/">Android Open Source Project (AOSP)
repository</a></strong> to make your changes available to everyone else
in the Android ecosystem.</p>
-<a href="{@docRoot}source/index.html"><img border="0" src="images/android_framework_small.png" alt="Android framework summary" style="display:inline;float:left;margin:5px 10px"></a>
+<a href="{@docRoot}source/index.html"><img border="0" src="images/android_framework_small.png" alt="Android framework summary" style="display:inline;float:right;margin:5px 10px;width:42%;height:42%"></a>
<a href="{@docRoot}devices/index.html">
<h4>Port Android to Devices</h4></a>
<p>Port the latest Android platform and
@@ -140,7 +143,10 @@
<a href="https://android.googlesource.com/platform/docs/source.android.com/">
<h4>Help this Site</h4></a>
- <p>Please note, source.android.com is maintained in the Android Open Source Project. See the <strong><a
+ <p>Use the <strong>Send Feedback</strong> button at the bottom of any
+ page to request improvements to the content or identify errors. In addition,
+ source.android.com is maintained in the Android Open Source Project. See the
+ <strong><a
href="https://android.googlesource.com/platform/docs/source.android.com/+log/master">docs/source.android.com
project log in AOSP</a></strong> for the complete list of changes to this site.
Contribute your own updates to that same project and help maintain source.android.com.</p>
diff --git a/src/source/51-android.rules b/src/source/51-android.rules
new file mode 100644
index 0000000..9e7963e
--- /dev/null
+++ b/src/source/51-android.rules
@@ -0,0 +1,36 @@
+# adb protocol on passion (Nexus One)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
+# fastboot protocol on passion (Nexus One)
+SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
+# adb protocol on crespo/crespo4g (Nexus S)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
+# fastboot protocol on crespo/crespo4g (Nexus S)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
+# adb protocol on stingray/wingray (Xoom)
+SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
+# fastboot protocol on stingray/wingray (Xoom)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
+# adb protocol on maguro/toro (Galaxy Nexus)
+SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
+# fastboot protocol on maguro/toro (Galaxy Nexus)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
+# adb protocol on panda (PandaBoard)
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
+# adb protocol on panda (PandaBoard ES)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
+# fastboot protocol on panda (PandaBoard)
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
+# usbboot protocol on panda (PandaBoard)
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
+# usbboot protocol on panda (PandaBoard ES)
+SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
+# adb protocol on grouper/tilapia (Nexus 7)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
+# fastboot protocol on grouper/tilapia (Nexus 7)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
+# adb protocol on manta (Nexus 10)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
+# fastboot protocol on manta (Nexus 10)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"
+# adb protocol on hammerhead (Nexus 5)
+SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee1", MODE="0600", OWNER="<username>"
diff --git a/src/source/64-bit-builds.jd b/src/source/64-bit-builds.jd
index 2373886..ad174fb 100644
--- a/src/source/64-bit-builds.jd
+++ b/src/source/64-bit-builds.jd
@@ -1,4 +1,4 @@
-page.title=Android Platform 64-bit Build Instructions
+page.title=Understanding 64-bit Builds
@jd:body
<!--
diff --git a/src/source/configure-products.jd b/src/source/add-device.jd
similarity index 97%
rename from src/source/configure-products.jd
rename to src/source/add-device.jd
index 01fc788..8dd5c6b 100644
--- a/src/source/configure-products.jd
+++ b/src/source/add-device.jd
@@ -1,4 +1,4 @@
-page.title=Configuring the Products
+page.title=Adding a New Device
@jd:body
<!--
@@ -24,7 +24,10 @@
</div>
</div>
-<p>Use the information in this page to create the Makefiles for your device and product.</p>
+<p>Use the information in this page to create the Makefiles for your device and
+product. Please note, unlike the other pages in this section, the contents here
+are applicable only when creating an entirely new device type and are intended
+for company build and product teams only.</p>
<h2 id="build-layers">Understand Build Layers</h2>
diff --git a/src/source/build-numbers.jd b/src/source/build-numbers.jd
index d116739..eca6fd7 100644
--- a/src/source/build-numbers.jd
+++ b/src/source/build-numbers.jd
@@ -41,6 +41,11 @@
</thead>
<tbody>
<tr>
+<td>Marshmallow</td>
+<td>6.0</td>
+<td>API level 23</td>
+</tr>
+<tr>
<td>Lollipop</td>
<td>5.1</td>
<td>API level 22</td>
@@ -178,10 +183,136 @@
<th>Supported devices</th>
</tr>
<tr>
+ <td>MRA58K</td>
+ <td>android-6.0.0_r1</td>
+ <td>Marshmallow</td>
+ <td>Nexus 5, Nexus 6, Nexus 7 (flo/deb), Nexus 9 (volantis/volantisg), Nexus Player</td>
+</tr>
+<tr>
+ <td>LMY48W</td>
+ <td>android-5.1.1_r24</td>
+ <td>Lollipop</td>
+ <td>Nexus 6</td>
+</tr>
+<tr>
+ <td>LVY48H</td>
+ <td>android-5.1.1_r23</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For Project Fi ONLY)</td>
+</tr>
+<tr>
+ <td>LYZ28M</td>
+ <td>android-5.1.1_r22</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For T-Mobile ONLY)</td>
+</tr>
+<tr>
+ <td>LMY48U</td>
+ <td>android-5.1.1_r20</td>
+ <td>Lollipop</td>
+ <td>Nexus 7 (deb)</td>
+</tr>
+<tr>
+ <td>LMY48T</td>
+ <td>android-5.1.1_r19</td>
+ <td>Lollipop</td>
+ <td>Nexus 4, Nexus 6, Nexus 9 (volantis/volantisg), Nexus 10</td>
+</tr>
+<tr>
+ <td>LVY48F</td>
+ <td>android-5.1.1_r18</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For Project Fi ONLY)</td>
+</tr>
+<tr>
+ <td>LYZ28K</td>
+ <td>android-5.1.1_r17</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For T-Mobile ONLY)</td>
+</tr>
+<tr>
+ <td>LMY48P</td>
+ <td>android-5.1.1_r16</td>
+ <td>Lollipop</td>
+ <td>Nexus 7 (deb)</td>
+</tr>
+<tr>
+ <td>LMY48N</td>
+ <td>android-5.1.1_r15</td>
+ <td>Lollipop</td>
+ <td>Nexus Player</td>
+</tr>
+<tr>
+ <td>LMY48M</td>
+ <td>android-5.1.1_r14</td>
+ <td>Lollipop</td>
+ <td>Nexus 4, Nexus 5, Nexus 6, Nexus 7 (flo), Nexus 9 (volantis/volantisg), Nexus 10</td>
+</tr>
+<tr>
+ <td>LVY48E</td>
+ <td>android-5.1.1_r13</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For Project Fi ONLY)</td>
+</tr>
+<tr>
+ <td>LYZ28J</td>
+ <td>android-5.1.1_r12</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For T-Mobile ONLY)</td>
+</tr>
+<tr>
+ <td>LMY48J</td>
+ <td>android-5.1.1_r10</td>
+ <td>Lollipop</td>
+ <td>Nexus Player</td>
+</tr>
+<tr>
+ <td>LMY48I</td>
+ <td>android-5.1.1_r9</td>
+ <td>Lollipop</td>
+ <td>Nexus 4, Nexus 5, Nexus 6, Nexus 7 (flo), Nexus 9 (volantis/volantisg), Nexus 10</td>
+</tr>
+<tr>
+ <td>LVY48C</td>
+ <td>android-5.1.1_r8</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For Project Fi ONLY)</td>
+</tr>
+<tr>
+ <td>LMY48G</td>
+ <td>android-5.1.1_r6</td>
+ <td>Lollipop</td>
+ <td>Nexus 7 (flo)</td>
+</tr>
+<tr>
+ <td>LYZ28E</td>
+ <td>android-5.1.1_r5</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For T-Mobile ONLY)</td>
+</tr>
+<tr>
+ <td>LMY47Z</td>
+ <td>android-5.1.1_r4</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (All carriers except T-Mobile US)</td>
+</tr>
+<tr>
+ <td>LMY48B</td>
+ <td>android-5.1.1_r3</td>
+ <td>Lollipop</td>
+ <td>Nexus 5</td>
+</tr>
+<tr>
+ <td>LMY47X</td>
+ <td>android-5.1.1_r2</td>
+ <td>Lollipop</td>
+ <td>Nexus 9 (volantis)</td>
+</tr>
+<tr>
<td>LMY47V</td>
<td>android-5.1.1_r1</td>
<td>Lollipop</td>
- <td>Nexus Player</td>
+ <td>Nexus 7 (flo/grouper), Nexus 10, Nexus Player</td>
</tr>
<tr>
<td>LMY47O</td>
@@ -190,18 +321,36 @@
<td>Nexus 4, Nexus 7 (flo/deb)</td>
</tr>
<tr>
+ <td>LMY47M</td>
+ <td>android-5.1.0_r4</td>
+ <td>Lollipop</td>
+ <td>Nexus 6 (For T-Mobile ONLY)</td>
+</tr>
+<tr>
<td>LMY47I</td>
<td>android-5.1.0_r3</td>
<td>Lollipop</td>
<td>Nexus 5, Nexus 6</td>
</tr>
<tr>
+ <td>LMY47E</td>
+ <td>android-5.1.0_r2</td>
+ <td>Lollipop</td>
+ <td>Nexus 6</td>
+</tr>
+<tr>
<td>LMY47D</td>
<td>android-5.1.0_r1</td>
<td>Lollipop</td>
<td>Nexus 5, Nexus 6, Nexus 7 (grouper/tilapia), Nexus 10, Nexus Player</td>
</tr>
<tr>
+ <td>LRX22L</td>
+ <td>android-5.0.2_r3</td>
+ <td>Lollipop</td>
+ <td>Nexus 9 (volantis/volantisg)</td>
+</tr>
+<tr>
<td>LRX22G</td>
<td>android-5.0.2_r1</td>
<td>Lollipop</td>
diff --git a/src/source/building-dream.jd b/src/source/building-dream.jd
deleted file mode 100644
index 1b6d9ac..0000000
--- a/src/source/building-dream.jd
+++ /dev/null
@@ -1,62 +0,0 @@
-page.title=Building for an Android Dev Phone
-@jd:body
-
-<!--
- Copyright 2013 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.
--->
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<p><em>The information on this page is a bit out of date. We'll update this
-page as soon as we can.</em></p>
-<p>The basic manifest for 1.6 defines which projects are
-needed to do a generic build for the emulator or for unlocked Dream devices
-(e.g. the Android Dev Phone 1). You need to have an appropriate device running
-a matching official image.</p>
-<p>To build donut for dream (your
-device needs to be an ADP1 running an official 1.6 system):</p>
-<ol>
-<li>
-<p>Follow the <a href="downloading.html">normal steps</a> to setup repo and check out the sources.</p>
-</li>
-<li>
-<p>At the root of your source tree, run <code>. build/envsetup.sh</code> like you normally would for an emulator build.</p>
-</li>
-<li>
-<p>Run <code>make adb</code> if you don't already have adb in your path.</p>
-</li>
-<li>
-<p>run <code>adb root</code>.</p>
-</li>
-<li>
-<p>in <code>vendor/htc/dream-open/</code> there is a script called "extract-files.sh" that must be run (from that directory) to extract some proprietary binaries from your device (*). You only need to do this once.</p>
-</li>
-<li>
-<p>run <code>lunch aosp_dream_us-eng</code> to specifically configure the build system for dream (the default is the equivalent of "lunch generic-eng", which doesn't contain dream-specific files).</p>
-</li>
-<li>
-<p>run make from the top of the source tree.</p>
-</li>
-<li>
-<p>from this point, the fastboot tool (which is put automatically in your path) can be used to flash a device: boot the device into the bootloader by holding the back key while pressing the power key, and run <code>fastboot -w flashall</code>.</p>
-</li>
-</ol>
-<p>Note: these instructions work for the sapphire (ADP2) build target, as
-well. Simply replace "dream" with "sapphire" above.</p>
diff --git a/src/source/building-running.jd b/src/source/building-running.jd
deleted file mode 100644
index d9eb0bf..0000000
--- a/src/source/building-running.jd
+++ /dev/null
@@ -1,158 +0,0 @@
-page.title=Building the System
-@jd:body
-
-<!--
- Copyright 2015 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.
--->
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<p>The following instructions to build the Android source tree apply to all
-branches, including <code>master</code>. The basic sequence of build commands
-is as follows:</p>
-
-<h2 id="initialize">Initialize</h2>
-<p>Initialize the environment with the <code>envsetup.sh</code> script. Note
-that replacing <code>source</code> with <code>.</code> (a single dot) saves a few characters,
-and the short form is more commonly used in documentation.</p>
-<pre><code>$ source build/envsetup.sh
-</code></pre>
-<p>or</p>
-<pre><code>$ . build/envsetup.sh
-</code></pre>
-
-<h2 id="choose-a-target">Choose a Target</h2>
-<p>Choose which target to build with <code>lunch</code>. The exact configuration can be passed as
-an argument. For example, the following command:</p>
-<pre><code>$ lunch aosp_arm-eng
-</code></pre>
-<p>refers to a complete build for the emulator, with all debugging enabled.</p>
-<p>If run with no arguments <code>lunch</code> will prompt you to choose a target from the menu. </p>
-<p>All build targets take the form <code>BUILD-BUILDTYPE</code>, where the <code>BUILD</code> is a codename
-referring to the particular feature combination.</p>
-
-<p>The BUILDTYPE is one of the following:</p>
-<table>
-<thead>
-<tr>
-<th>Buildtype</th>
-<th>Use</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td>user</td>
-<td>limited access; suited for production</td>
-</tr>
-<tr>
-<td>userdebug</td>
-<td>like "user" but with root access and debuggability; preferred for debugging</td>
-</tr>
-<tr>
-<td>eng</td>
-<td>development configuration with additional debugging tools</td>
-</tr>
-</tbody>
-</table>
-<p>For more information about building for and running on actual hardware, see
-<a href="building-devices.html">Building for Devices</a>.</p>
-
-<h2 id="build-the-code">Build the code</h2>
-<p>Build everything with <code>make</code>. GNU make can handle parallel
-tasks with a <code>-jN</code> argument, and it's common to use a number of
-tasks N that's between 1 and 2 times the number of hardware
-threads on the computer being used for the build. For example, on a
-dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core),
-the fastest builds are made with commands between <code>make -j16</code> and
-<code>make -j32</code>.</p>
-<pre><code>$ make -j4
-</code></pre>
-<h2 id="run-it">Run It!</h2>
-<p>You can either run your build on an emulator or flash it on a device. Please note that you have already selected your build target with <code>lunch</code>, and it is unlikely at best to run on a different target than it was built for.</p>
-<h3 id="flash-a-device">Flash a Device</h3>
-<p>To flash a device, you will need to use <code>fastboot</code>, which should be included in your path after a successful build. Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with</p>
-<pre><code>$ adb reboot bootloader
-</code></pre>
-<p>Once the device is in fastboot mode, run </p>
-<pre><code>$ fastboot flashall -w
-</code></pre>
-<p>The <code>-w</code> option wipes the <code>/data</code> partition on the device; this is useful for your first time flashing a particular device but is otherwise unnecessary.</p>
-<p>For more information about building for and running on actual hardware, see
-<a href="building-devices.html">Building for Devices.</a></p>
-<h3 id="emulate-an-android-device">Emulate an Android Device</h3>
-<p>The emulator is added to your path automatically by the build process. To run the emulator, type</p>
-<pre><code>$ emulator
-</code></pre>
-<h2 id="using-ccache">Using ccache</h2>
-<p>ccache is a compiler cache for C and C++ that can help make builds faster.
-In the root of the source tree, do the following:</p>
-<pre><code>$ export USE_CCACHE=1
-$ export CCACHE_DIR=/<path_of_your_choice>/.ccache
-$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
-</code></pre>
-<p>The suggested cache size is 50-100G.</p>
-<p>On Linux, you can watch ccache being used by doing the following:</p>
-<pre><code>$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
-</code></pre>
-<p>On Mac OS, you should replace <code>linux-x86</code> with <code>darwin-x86</code>.</p>
-<p>When using Ice Cream Sandwich (4.0.x) or older, you should replace
-<code>prebuilts/misc</code> with <code>prebuilt</code>.</p>
-<h2 id="troubleshooting-common-build-errors">Troubleshooting Common Build Errors</h2>
-<h3 id="wrong-java-version">Wrong Java Version</h3>
-<p>If you are attempting to build a version of Android inconsistent with your
-version of Java, <code>make</code> will abort with a message such as</p>
-<pre><code>************************************************************
-You are attempting to build with the incorrect version
-of java.
-
-Your version is: WRONG_VERSION.
-The correct version is: RIGHT_VERSION.
-
-Please follow the machine setup instructions at
- https://source.android.com/source/download.html
-************************************************************
-</code></pre>
-<p>This may be caused by:</p>
-<ul>
-<li>
-<p>Failing to install the correct JDK as specified in <a href="initializing.html">Initializing the Build Environment</a>.</p>
-</li>
-<li>
-<p>Another JDK previously installed appearing in your path. Prepend the correct JDK to the beginning of your PATH or remove the problematic JDK.</p>
-</li>
-</ul>
-<h3 id="python-version-3">Python Version 3</h3>
-<p>Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:</p>
-<pre><code>$ apt-get install python
-</code></pre>
-<h3 id="case-insensitive-filesystem">Case Insensitive Filesystem</h3>
-<p>If you are building on an HFS filesystem on Mac OS, you may encounter an error such as</p>
-<pre><code>************************************************************
-You are building on a case-insensitive filesystem.
-Please move your source tree to a case-sensitive filesystem.
-************************************************************
-</code></pre>
-<p>Please follow the instructions in <a href="initializing.html">Initializing the Build Environment</a> for creating a case-sensitive disk image.</p>
-<h3 id="no-usb-permission">No USB Permission</h3>
-<p>On most Linux systems, unprivileged users cannot access USB ports by default. If you see a permission denied error, follow the instructions
-<a href="initializing.html">Initializing the Build Environment</a> for configuring USB access. </p>
-<p>If adb was already running and cannot connect to the device after
-getting those rules set up, it can be killed with <code>adb kill-server</code>.
-That will cause adb to restart with the new configuration.</p>
diff --git a/src/source/building.jd b/src/source/building.jd
index 408ddb1..fbfb427 100644
--- a/src/source/building.jd
+++ b/src/source/building.jd
@@ -1,8 +1,8 @@
-page.title=Downloading and Building
+page.title=Building the System
@jd:body
<!--
- Copyright 2014 The Android Open Source Project
+ Copyright 2015 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.
@@ -16,49 +16,147 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<p>The Android build is routinely tested in-house on recent versions of
-Ubuntu LTS (14.04), but most distributions should have the required
-build tools available. We welcome reports of successes or failures on other
-distributions.</p>
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol id="auto-toc">
+ </ol>
+ </div>
+</div>
-<p>Before you download and build the Android source, ensure your system meets the following requirements:</p>
+<p>The following instructions to build the Android source tree apply to all
+branches, including <code>master</code>. The basic sequence of build commands
+is as follows:</p>
+<p class="note"><strong>Note:</strong> If you're building Android 6.0 or later,
+please see <a href="jack.html">Compiling with Jack</a> for information on this
+new default toolchain.</p>
+
+<h2 id="initialize">Set up environment</h2>
+<p>Initialize the environment with the <code>envsetup.sh</code> script. Note
+that replacing <code>source</code> with <code>.</code> (a single dot) saves a few characters,
+and the short form is more commonly used in documentation.</p>
+<pre><code>$ source build/envsetup.sh
+</code></pre>
+<p>or</p>
+<pre><code>$ . build/envsetup.sh
+</code></pre>
+
+<h2 id="choose-a-target">Choose a Target</h2>
+<p>Choose which target to build with <code>lunch</code>. The exact configuration can be passed as
+an argument. For example, the following command:</p>
+<pre><code>$ lunch aosp_arm-eng
+</code></pre>
+<p>refers to a complete build for the emulator, with all debugging enabled.</p>
+<p>If run with no arguments <code>lunch</code> will prompt you to choose a target from the menu. </p>
+<p>All build targets take the form <code>BUILD-BUILDTYPE</code>, where the <code>BUILD</code> is a codename
+referring to the particular feature combination.</p>
+
+<p>The BUILDTYPE is one of the following:</p>
+<table>
+<thead>
+<tr>
+<th>Buildtype</th>
+<th>Use</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>user</td>
+<td>limited access; suited for production</td>
+</tr>
+<tr>
+<td>userdebug</td>
+<td>like "user" but with root access and debuggability; preferred for debugging</td>
+</tr>
+<tr>
+<td>eng</td>
+<td>development configuration with additional debugging tools</td>
+</tr>
+</tbody>
+</table>
+<p>For more information about building for and running on actual hardware, see
+<a href="running.html">Running Builds</a>.</p>
+
+<h2 id="build-the-code">Build the code</h2>
+<p>Build everything with <code>make</code>. GNU make can handle parallel
+tasks with a <code>-jN</code> argument, and it's common to use a number of
+tasks N that's between 1 and 2 times the number of hardware
+threads on the computer being used for the build. For example, on a
+dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core),
+the fastest builds are made with commands between <code>make -j16</code> and
+<code>make -j32</code>.</p>
+<pre><code>$ make -j4
+</code></pre>
+<h2 id="run-it">Run It!</h2>
+<p>You can either run your build on an emulator or flash it on a device. Please note that you have already selected your build target with <code>lunch</code>, and it is unlikely at best to run on a different target than it was built for.</p>
+<h3 id="flash-a-device">Flash a Device</h3>
+<p>To flash a device, you will need to use <code>fastboot</code>, which should be included in your path after a successful build. Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with</p>
+<pre><code>$ adb reboot bootloader
+</code></pre>
+<p>Once the device is in fastboot mode, run </p>
+<pre><code>$ fastboot flashall -w
+</code></pre>
+<p>The <code>-w</code> option wipes the <code>/data</code> partition on the device; this is useful for your first time flashing a particular device but is otherwise unnecessary.</p>
+<p>For more information about building for and running on actual hardware, see
+<a href="running.html">Running Builds</a>.</p>
+<h3 id="emulate-an-android-device">Emulate an Android Device</h3>
+<p>The emulator is added to your path automatically by the build process. To run the emulator, type</p>
+<pre><code>$ emulator
+</code></pre>
+<h2 id="using-ccache">Using ccache</h2>
+<p>ccache is a compiler cache for C and C++ that can help make builds faster.
+In the root of the source tree, do the following:</p>
+<pre><code>$ export USE_CCACHE=1
+$ export CCACHE_DIR=/<path_of_your_choice>/.ccache
+$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
+</code></pre>
+<p>The suggested cache size is 50-100G.</p>
+<p>On Linux, you can watch ccache being used by doing the following:</p>
+<pre><code>$ watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
+</code></pre>
+<p>On Mac OS, you should replace <code>linux-x86</code> with <code>darwin-x86</code>.</p>
+<p>When using Ice Cream Sandwich (4.0.x) or older, you should replace
+<code>prebuilts/misc</code> with <code>prebuilt</code>.</p>
+<h2 id="troubleshooting-common-build-errors">Troubleshooting Common Build Errors</h2>
+<h3 id="wrong-java-version">Wrong Java Version</h3>
+<p>If you are attempting to build a version of Android inconsistent with your
+version of Java, <code>make</code> will abort with a message such as</p>
+<pre><code>************************************************************
+You are attempting to build with the incorrect version
+of java.
+
+Your version is: WRONG_VERSION.
+The correct version is: RIGHT_VERSION.
+
+Please follow the machine setup instructions at
+ https://source.android.com/source/download.html
+************************************************************
+</code></pre>
+<p>This may be caused by:</p>
<ul>
-
- <li>A Linux or Mac OS system. It is also possible
- to build Android in a virtual machine on unsupported systems such as Windows.
- If you are running Linux in a virtual machine, you need at
- least 16GB of RAM/swap and 50GB or more of disk space in order to
- build the Android tree. See disk size requirements below.
- </li>
-
- <li>A 64-bit environment is required for Gingerbread (2.3.x) and newer versions, including the master
- branch. You can compile older versions on 32-bit systems.
- </li>
-
- <li>At least 50GB of free disk space for a checkout, 100GB for a single
- build, and 150GB or more for multiple builds. If you employ ccache, you will
- need even more space.</p>
- </li>
-
- <li>
- Python 2.6 -- 2.7, which you can download from <a href="http://www.python.org/download/">python.org</a>.</p>
- </li>
-
- <li>
- GNU Make 3.81 -- 3.82, which you can download from <a href="http://ftp.gnu.org/gnu/make/">gnu.org</a>,</p>
- </li>
-
- <li>
- JDK 7 to build the master branch of Android in the <a
- href="https://android.googlesource.com/">Android Open Source Project
- (AOSP)</a>; JDK 6 to build Gingerbread through KitKat; JDK 5 for Cupcake through
- Froyo. See <a href="initializing.html">Initializing a Build Environment</a>
- for installation instructions by operating system.</p>
- </li>
-
- <li>
- Git 1.7 or newer. You can find it at <a href="http://git-scm.com/download">git-scm.com</a>.</p>
- </li>
-
+<li>
+<p>Failing to install the correct JDK as specified in <a href="initializing.html">Initializing the Build Environment</a>.</p>
+</li>
+<li>
+<p>Another JDK previously installed appearing in your path. Prepend the correct JDK to the beginning of your PATH or remove the problematic JDK.</p>
+</li>
</ul>
+<h3 id="python-version-3">Python Version 3</h3>
+<p>Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:</p>
+<pre><code>$ apt-get install python
+</code></pre>
+<h3 id="case-insensitive-filesystem">Case Insensitive Filesystem</h3>
+<p>If you are building on an HFS filesystem on Mac OS, you may encounter an error such as</p>
+<pre><code>************************************************************
+You are building on a case-insensitive filesystem.
+Please move your source tree to a case-sensitive filesystem.
+************************************************************
+</code></pre>
+<p>Please follow the instructions in <a href="initializing.html">Initializing the Build Environment</a> for creating a case-sensitive disk image.</p>
+<h3 id="no-usb-permission">No USB Permission</h3>
+<p>On most Linux systems, unprivileged users cannot access USB ports by default. If you see a permission denied error, follow the instructions
+<a href="initializing.html">Initializing the Build Environment</a> for configuring USB access. </p>
+<p>If adb was already running and cannot connect to the device after
+getting those rules set up, it can be killed with <code>adb kill-server</code>.
+That will cause adb to restart with the new configuration.</p>
diff --git a/src/source/cla-corporate.jd b/src/source/cla-corporate.jd
deleted file mode 100644
index efed92e..0000000
--- a/src/source/cla-corporate.jd
+++ /dev/null
@@ -1,81 +0,0 @@
-page.title=Corporate Contributor License Agreement
-@jd:body
-
-<!--
- Copyright 2013 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.
--->
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<p>In order to clarify the intellectual property license granted with Contributions from any person or entity, the Android Open Source Project (the "Project") must have a Contributor License Grant ("Grant") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Project and the Android Open Source Project Leads (the "Project Leads"); it does not change your rights to use your own Contributions for any other purpose.</p>
-<p>This version of the Grant allows an entity (the "Corporation") to submit Contributions to the Project Leads, to authorize Contributions submitted by its designated employees to the Project Leads, and to grant copyright and patent licenses thereto. If you have not already done so, please complete and send an original signed Grant to</p>
-<blockquote>
- Google Inc.<br/>
- Attn: Open Source Program Office<br/>
- 1600 Amphitheatre Pkwy<br/>
- Building 43<br/>
- Mountain View, CA 94043<br/>
- U.S.A.
-</blockquote>
-
-<p>Scanned agreements may also be emailed in PDF form to cla-submissions@google.com.</p>
-<p>If necessary, you may send it by facsimile to (650) 887-1625. Please read this document carefully before signing and keep a copy for your records.</p>
-<pre>Corporation name: ___________________________________________________<br><br><br><br>Corporation address: ________________________________________________<br><br><br><br>_____________________________________________________________________<br><br><br><br>_____________________________________________________________________<br><br><br><br>Point of Contact: ___________________________________________________<br><br><br><br>E-Mail: ____________________________________________________________<br><br><br><br>Telephone: _____________________<br><br><br><br>Fax: ___________________________<br><br></pre>
-
-<p>You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Project. Except for the license granted herein to the Project Leads and recipients of software distributed by the Project Leads, You reserve all right, title, and interest in and to Your Contributions.</p>
-<ol>
-<li>
-<p>Definitions.</p>
-<p>"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Grant to the Project Leads. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
-<p>"Contribution" shall mean the code, documentation or other original works of authorship expressly identified in Schedule B, as well as any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the Project Leads for inclusion in, or documentation of, any of the products managed or maintained by the Project Leads (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Project Leads or their representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project Leads for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."</p>
-</li>
-<li>
-<p>Grant of Copyright License. Subject to the terms and conditions of this Grant, You hereby grant to the Project Leads and to recipients of software distributed by the Project Leads a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.</p>
-</li>
-<li>
-<p>Grant of Patent License. Subject to the terms and conditions of this Grant, You hereby grant to the Project Leads and to recipients of software distributed by the Project Leads a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Grant for that Contribution or Work shall terminate as of the date such litigation is filed.</p>
-</li>
-<li>
-<p>You represent that You are legally entitled to grant the above license. You represent further that each employee of the Corporation designated on Schedule A below (or in a subsequent written modification to that Schedule) is authorized to submit Contributions on behalf of the Corporation.</p>
-</li>
-<li>
-<p>You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others).</p>
-</li>
-<li>
-<p>You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.</p>
-</li>
-<li>
-<p>Should You wish to submit work that is not Your original creation, You may submit it to the Project Leads separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".<br></p></p>
-</li>
-<li>
-<p>It is your responsibility to notify the Project Leads when any change is required to the list of designated employees authorized to submit Contributions on behalf of the Corporation, or to the Corporation's Point of Contact with the Project.</p>
-</li>
-</ol>
-<pre>
-<br><br>
-Please sign: __________________________________ Date: _______________<br><br>
-Title: _______________________________________________________________<br><br>
-Corporation: __________________________________________________________
-</pre>
-
-<h3 id="schedule-a">Schedule A</h3>
-<p>[Initial list of designated employees. NB: authorization is not tied to particular Contributions.]</p>
-<h3 id="schedule-b">Schedule B</h3>
-<p>[Identification of optional concurrent software grant. Would be left blank or omitted if there is no concurrent software grant.]</p>
diff --git a/src/source/cla-corporate.pdf b/src/source/cla-corporate.pdf
deleted file mode 100644
index 09dc022..0000000
--- a/src/source/cla-corporate.pdf
+++ /dev/null
Binary files differ
diff --git a/src/source/cla-individual.jd b/src/source/cla-individual.jd
deleted file mode 100644
index 27f32cf..0000000
--- a/src/source/cla-individual.jd
+++ /dev/null
@@ -1,63 +0,0 @@
-page.title=Contributor License Agreement for Individuals
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<p><em>Please visit the <a href="https://android-review.googlesource.com/#/settings/new-agreement">code review tool</a>
-to execute the grant online.This page provides the text of the Individual Contributor License Grant for your quick review.</em></p>
-<p>In order to clarify the intellectual property license granted with Contributions from any person or entity, the Android Open Source Project (the "Project") must have a Contributor License Grant ("Grant") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Project and the Android Open Source Project Leads (the "Project Leads"); it does not change your rights to use your own Contributions for any other purpose. If you have not already done so, please complete and send an original signed Grant to</p>
-<blockquote>
- Google Inc.<br/>
- Attn: Open Source Program Office<br/>
- 1600 Amphitheatre Pkwy<br/>
- Building 43<br/>
- Mountain View, CA 94043<br/>
- U.S.A.
-</blockquote>
-
-<p>Scanned agreements may also be emailed in PDF form to
-cla-submissions@google.com, sent by facsimile to (650) 887-1625, or
-<a href="https://android-review.googlesource.com/#/settings/new-agreement">signed electronically</a>.</p>
-<p>Please read this document carefully before signing and keep a copy for your records.</p>
-<pre>
-<br><br>
-Full name: ____________________________ E-Mail: ______________________<br><br>
-Mailing Address: ______________________ Telephone: ___________________<br><br>
-_______________________________________ Facsimile: ___________________<br><br>
-_______________________________________ Country: ___________________
-</pre>
-
-<p>You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Project. Except for the license granted herein to the Project Leads and recipients of software distributed by the Project Leads, You reserve all right, title, and interest in and to Your Contributions.</p>
-<ol>
-<li>
-<p>Definitions. </p>
-<p>"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Grant. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the Project Leads for inclusion in, or documentation of, any of the products managed or maintained by the Project Leads (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Project Leads or their representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project Leads for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."</p>
-</li>
-<li>
-<p>Grant of Copyright License. Subject to the terms and conditions of this Grant, You hereby grant to the Project Leads and to recipients of software distributed by the Project Leads a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.</p>
-</li>
-<li>
-<p>Grant of Patent License. Subject to the terms and conditions of this Grant, You hereby grant to the Project Leads and to recipients of software distributed by the Project Leads a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Grant for that Contribution or Work shall terminate as of the date such litigation is filed.</p>
-</li>
-<li>
-<p>You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Project Leads, or that your employer has executed a separate Corporate Contributor License Grant with the Project Leads.</p>
-</li>
-<li>
-<p>You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.</p>
-</li>
-<li>
-<p>You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.</p>
-</li>
-<li>
-<p>Should You wish to submit work that is not Your original creation, You may submit it to the Project Leads separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".<br></p></p>
-</li>
-<li>
-<p>You agree to notify the Project Leads of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.</p>
-</li>
-</ol>
diff --git a/src/source/code-lines.jd b/src/source/code-lines.jd
index 2e82e7b..3ec8798 100644
--- a/src/source/code-lines.jd
+++ b/src/source/code-lines.jd
@@ -89,7 +89,7 @@
</li>
<li>
<p>
- An <em>upstream</em> project is an open-source project from which the Android stack is
+ An <em>upstream</em> project is an open source project from which the Android stack is
pulling code. These include obvious projects such as the Linux kernel and WebKit.
Over time we are migrating some of the semi-autonomous Android projects (such as ART,
the Android SDK tools, Bionic, and so on) to work as "upstream" projects. Generally,
@@ -173,7 +173,7 @@
As a result, Google frequently has possession of confidential information from third parties.
And we must refrain from revealing sensitive features until we've secured the appropriate
protections. In addition, there are real risks to the platform arising from having too many
- platform versions extant at once. For these reasons, we have structured the open-source
+ platform versions extant at once. For these reasons, we have structured the open source
project -- including third-party contributions -- to focus on the currently-public stable
version of Android. "Deep development" on the next version of the platform will happen in
private until it's ready to become an official release.
diff --git a/src/source/code-style.jd b/src/source/code-style.jd
index ee65c27..dd52b5d 100644
--- a/src/source/code-style.jd
+++ b/src/source/code-style.jd
@@ -650,7 +650,7 @@
enough to be logged in a release build).</p>
</li>
<li>
-<p>A full filesystem on a filesystem that is acceessible to or on
+<p>A full filesystem on a filesystem that is accessible to or on
behalf of third-party applications should not be logged at a level higher than
INFORMATIVE.</p>
</li>
@@ -725,7 +725,7 @@
readers out of their rhythm when they go to read it. Try to avoid this.</p></p>
<h2 id="javatests-style-rules">Javatests Style Rules</h2>
<h3 id="follow-test-method-naming-conventions">Follow Test Method Naming Conventions</h3>
-<p>When naming test methods, you can use an underscore to seperate what is
+<p>When naming test methods, you can use an underscore to separate what is
being tested from the specific case being tested. This style makes it easier
to see exactly what cases are being tested.</p>
<p>For example:</p>
diff --git a/src/source/community/index.jd b/src/source/community.jd
similarity index 98%
rename from src/source/community/index.jd
rename to src/source/community.jd
index 8845469..ea92fb7 100644
--- a/src/source/community/index.jd
+++ b/src/source/community.jd
@@ -27,7 +27,7 @@
<ul>
<li>
<p><em>android-platform</em>:
-This list is for general discussion about the Android open-source project or
+This list is for general discussion about the Android Open Source Project or
the platform technologies.</p>
<ul>
<li>Subscribe using Google Groups:
@@ -258,4 +258,4 @@
<p><a href="irc://irc.freenode.net/android-root">#android-root</a> - for
discussion related to off-label uses of hardware</p>
</li>
-</ul>
\ No newline at end of file
+</ul>
diff --git a/src/source/community/groups-charter.jd b/src/source/community/groups-charter.jd
deleted file mode 100644
index d743041..0000000
--- a/src/source/community/groups-charter.jd
+++ /dev/null
@@ -1,43 +0,0 @@
-page.title=Android Discussion Groups Charter
-@jd:body
-
-<div id="qv-wrapper">
- <div id="qv">
- <h2>In this document</h2>
- <ol id="auto-toc">
- </ol>
- </div>
-</div>
-
-<h2 id="audience">Audience</h2>
-<p>
-These discussion groups are intended for developers working with the Android platform. Everyone is welcome to join in, provided you follow our community's policies described below. Our users help each other, and many experts post to these groups, including members of the Open Handset Alliance.
-</p>
-<p>
-No topic is off-limits, provided it relates to Android in some way. However, since these are very busy lists, search the archives before posting your question; you may find your question has already been answered.
-</p>
-
-<h2 id="mailing">Mailing list rules</h2>
-<p>We love simplicity and hate restrictions, so we keep our policies minimal. The rules
-below describe what's expected of subscribers to the Android mailing lists.</h2>
-
-<ul>
- <li><em>Please be friendly</em>: Showing courtesy and respect to others is a vital part of the Android culture, and we expect everyone participating in the Android community to join us in accepting nothing less. Being courteous does not mean we can't constructively disagree with each other, but it does mean that we must be polite when we do so. There's never a reason to be antagonistic or dismissive toward anyone; if you think there is, think again before you post. Mobile development is serious business, but it's also a lot of fun. Let's keep it that way. Let's strive to be one of the friendliest communities in all of open source.
- </li>
- <li><em>Allowed discussion topics<em>: Most of our groups are for technical discussions of Android or users helping each other. Generally we don't put hard restrictions on the topics discussed in the group: as long as the topic is relevant to Android in some way, it's welcome on our groups. We welcome announcements and discussion of products, libraries, publications, and other interesting Android-related news, but please do not cross-post. Post only to the most relevant group for your message. We even welcome (polite!) discussion of articles and ideas critical of Android--after all, we can't improve if we don't listen.
- </li>
- <li><em>Working Lists</em>: Some of our groups are considered "working lists", by which we mean that the list is intended to be used in support of the completion of specific tasks. On these groups, we don't welcome off-topic conversations, and will generally ask you to take general discussions to a different list. Since these are lists where people are trying to get work done, we will be pretty aggressive about keeping the noise level low. We ask that you respect our contributors' time and keep general discussions to appropriate lists.
- </li>
- <li><em>Spam</em>: We hate spam almost as passionately as we love courtesy and respect, so we reserve the right to limit discussions that amount to spam. Outright spam will result in the spammer being immediately and permanently banned from the list.
- </li>
-</ul>
-<p>
-The most important rule is friendliness. Remember: disrespect and rudeness are not welcome in our community under any circumstances. We don't have a formal policy on dealing with troublemakers, and we hope we never need one. That said, we do pledge to do our best to be fair, and we will always try to warn someone before banning him or her.
-</p>
-<h2 id="contacting">Contacting the moderators</h2>
-<p>
-If you see anyone being rude, call them out on it. This is your group too, and you don't have to accept someone else being disrespectful just because it wasn't directed at you. Just remember to be polite and courteous yourself! Don't add fuel to the fire.
-</p>
-<p>
-But if you see an outrageous violation, want to report spam, feel very strongly about something, or even if you just want to chat, then contact the mailing list's owners. It's what we're here for!
-</p>
\ No newline at end of file
diff --git a/src/source/contributing.jd b/src/source/contributing.jd
index 5f1b62f..c5b1bbd 100644
--- a/src/source/contributing.jd
+++ b/src/source/contributing.jd
@@ -46,4 +46,4 @@
and by learning about <code>git</code>, <code>repo</code>, and other tools using the links to the left.
You can also view the activity on all contributions on our
<a href="https://android-review.googlesource.com/">Gerrit server</a>.
-If you need help along the way, you can join our <a href="/source/index.html">discussion groups</a>.</p>
+If you need help along the way, you can join our <a href="/source/community.html">discussion groups</a>.</p>
diff --git a/src/source/developing.jd b/src/source/developing.jd
index 0bbafe2..7788f56 100644
--- a/src/source/developing.jd
+++ b/src/source/developing.jd
@@ -25,7 +25,7 @@
</div>
<p>To work with the Android code, you will need to use both Git and Repo. In most situations, you can use Git instead of Repo, or mix Repo and Git commands to form complex commands. Using Repo for basic across-network operations will make your work much simpler, however.</p>
-<p><strong>Git</strong> is an open-source version-control system designed to handle very large projects that are distributed over multiple repositories. In the context of Android, we use Git for local operations such as local branching, commits, diffs, and edits. One of the challenges in setting up the Android project was figuring out how to best support the outside community--from the hobbiest community to large OEMs building mass-market consumer devices. We wanted components to be replaceable, and we wanted interesting components to be able to grow a life of their own outside of Android. We first chose a distributed revision control system, then further narrowed it down to Git.</p>
+<p><strong>Git</strong> is an open source version-control system designed to handle very large projects that are distributed over multiple repositories. In the context of Android, we use Git for local operations such as local branching, commits, diffs, and edits. One of the challenges in setting up the Android project was figuring out how to best support the outside community--from the hobbiest community to large OEMs building mass-market consumer devices. We wanted components to be replaceable, and we wanted interesting components to be able to grow a life of their own outside of Android. We first chose a distributed revision control system, then further narrowed it down to Git.</p>
<p><strong>Repo</strong> is a repository management tool that we built on top of Git. Repo
unifies the many Git repositories when necessary, does the uploads to our
<a href="https://android-review.googlesource.com/">revision control system</a>, and
@@ -101,7 +101,8 @@
<pre><code>$ repo branches
</code></pre>
<p>The name of the current branch will be preceded by an asterisk.</p>
-<p><em>Note: A bug might be causing <code>repo sync</code> to reset the local topic branch. If <code>git branch</code> shows * (no branch) after you run <code>repo sync</code>, then run <code>git checkout</code> again.</em></p>
+<p class="note"><strong>Note:</strong> A bug might be causing <code>repo sync</code> to reset the local topic branch.
+If <code>git branch</code> shows * (no branch) after you run <code>repo sync</code>, then run <code>git checkout</code> again.</p>
<h2 id="staging-files">Staging files</h2>
<p>By default, Git notices but does not track the changes you make in a project. In order to tell git to preserve your changes, you must mark them for inclusion in a commit. This is also called "staging". </p>
<p>You can stage your changes by running</p>
diff --git a/src/source/downloading.jd b/src/source/downloading.jd
index ee65cbb..6ed0004 100644
--- a/src/source/downloading.jd
+++ b/src/source/downloading.jd
@@ -72,6 +72,9 @@
<p>
For version 1.21, the SHA-1 checksum for repo is b8bd1804f432ecf1bab730949c82b93b0fc5fede
</p>
+<p>
+ For version 1.22, the SHA-1 checksum for repo is da0514e484f74648a890c0467d61ca415379f791
+</p>
<h2 id="initializing-a-repo-client">
Initializing a Repo client
</h2>
diff --git a/src/source/faqs.jd b/src/source/faqs.jd
index 346ad98..6c01017 100644
--- a/src/source/faqs.jd
+++ b/src/source/faqs.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -44,11 +44,11 @@
their innovative ideas a reality. We also wanted to make sure there was no
central point of failure, so no single industry player could restrict or control
the innovations of any other. The single most important goal of the Android
-Open Source Project (AOSP) is to make sure that the open-source Android
+Open Source Project (AOSP) is to make sure that the open source Android
software is implemented as widely and compatibly as possible, to everyone's
benefit.</p>
-<h3 id="what-kind-of-open-source-project-is-android">What kind of open-source project is Android?</h3>
-<p>Google oversees the development of the core Android open-source platform
+<h3 id="what-kind-of-open-source-project-is-android">What kind of open source project is Android?</h3>
+<p>Google oversees the development of the core Android open source platform
and works to create robust developer and user communities. For the most part,
the Android source code is licensed under the permissive Apache Software
License 2.0, rather than a "copyleft" license. The main reason for this is
@@ -66,7 +66,7 @@
operation and strikes the business deals necessary to make sure great
devices running Android actually make it to market.</p>
<p>By making sure Android is a success with users, we help ensure the
-vitality of Android as a platform and as an open-source project. After all,
+vitality of Android as a platform and as an open source project. After all,
who wants the source code to an unsuccessful product?</p>
<p>Google's goal is to ensure a successful ecosystem around Android. Of course, no
one is required to participate. We opened the Android source code
@@ -84,7 +84,7 @@
according to the actual needs of real-world devices.</p>
<h3 id="how-is-the-android-software-developed">How is the Android software developed?</h3>
<p>Each platform version of Android (such as 1.5, 1.6, and so on) has a
-corresponding branch in the open-source tree. At any given moment, the most
+corresponding branch in the open source tree. At any given moment, the most
recent such branch will be considered the "current stable" branch version.
This current stable branch is the one that manufacturers port to their
devices. This branch is kept suitable for release at all times.</p>
@@ -148,7 +148,7 @@
around the same time the devices reach users.</p>
<h3 id="how-does-the-aosp-relate-to-the-android-compatibility-program">How does the AOSP relate to the Android Compatibility Program?</h3>
<p>The Android Open Source Project maintains the Android software, and
-develops new versions. Since it's open-source, this software can be used for
+develops new versions. Since it's open source, this software can be used for
any purpose, including to develop devices that are not compatible with other
devices based on the same source.</p>
<p>The function of the Android Compatibility Program is to define a baseline
@@ -172,7 +172,7 @@
in the ART runtime. Similarly, we won't accept contributions such as GPL
or LGPL libraries that are incompatible with our licensing goals.</p>
<p>We encourage those interested in contributing source code to contact us
-via the channels listed on the <a href="{@docRoot}source/community/index.html">
+via the channels listed on the <a href="{@docRoot}source/community.html">
Android Community</a> page prior to beginning any work. You can find more
information on this topic from the <a href="{@docRoot}source/contributing.html">
Contributing</a> page.</p>
@@ -187,7 +187,7 @@
Approvers are typically Google employees, but the same approvers are
responsible for all submissions, regardless of origin.</p>
<p>You can find more information on this topic at the <a href="submit-patches.html">Submitting Patches</a> page.</p>
-<a href="#top">Back to top</a>
+<a href="#top">Back to top</a>
<h2 id="compatibility">Compatibility</h2>
<h3 id="what-does-compatibility-mean">What does "compatibility" mean?</h3>
<p>We define an "Android-compatible device" as one that can run any
@@ -250,7 +250,7 @@
they must first demonstrate their devices are compatible.</p>
<h3 id="how-much-does-compatibility-certification-cost">How much does compatibility certification cost?</h3>
<p>There is no cost to obtain Android compatibility for a device. The
-Compatibility Test Suite is open-source and available to anyone for device testing.</p>
+Compatibility Test Suite is open source and available to anyone for device testing.</p>
<h3 id="how-long-does-compatibility-take">How long does compatibility take?</h3>
<p>The process is automated. The Compatibility Test Suite generates a report
that can be provided to Google to verify compatibility. Eventually we intend
@@ -261,7 +261,7 @@
for each release. We draft the CDD for a new Android version in consultation
with various OEMs who provide input on its contents.</p>
<h3 id="how-long-will-each-android-version-be-supported-for-new-devices">How long will each Android version be supported for new devices?</h3>
-<p>Since Android's code is open-source, we can't prevent someone from using an
+<p>Since Android's code is open source, we can't prevent someone from using an
old version to launch a device. Instead, Google chooses not to license the
Google Play client software for use on versions that are considered
obsolete. This allows anyone to continue to ship old versions of Android,
diff --git a/src/source/flashing.jd b/src/source/flashing.jd
deleted file mode 100644
index 06c8e2b..0000000
--- a/src/source/flashing.jd
+++ /dev/null
@@ -1,29 +0,0 @@
-page.title=Flashing
-@jd:body
-
-<!--
- Copyright 2013 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<p>To flash a device, you will need to use <code>fastboot</code>. Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with</p>
-<pre><code>$ adb reboot bootloader
-</code></pre>
-<p>Once the device is in fastboot mode, run </p>
-<pre><code>$ fastboot flashall -w
-</code></pre>
-<p>The <code>-w</code> option wipes the <code>/data</code> partition on the device; this is useful for your first time flashing a particular device, but is otherwise unnecessary.</p>
-<h1 id="emulating">Emulating</h1>
-<p>To run the emulator, type</p>
-<pre><code>$ emulator
-</code></pre>
diff --git a/src/source/getting-started.jd b/src/source/getting-started.jd
deleted file mode 100644
index 7c93494..0000000
--- a/src/source/getting-started.jd
+++ /dev/null
@@ -1,22 +0,0 @@
-page.title=Getting Started
-@jd:body
-
-<!--
- Copyright 2013 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<p>Thanks for your interest in Android! To begin working with the platform, whether
-you're creating a custom version of Android for existing devices or if you are
-building a hardware device from scratch, you'll need to set up your machine to download and build the
-source.
diff --git a/src/source/git-repo.html b/src/source/git-repo.html
deleted file mode 100644
index e85ebc2..0000000
--- a/src/source/git-repo.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=/source/developing.html" />
-</head>
-<body>
-</body>
-</html>
diff --git a/src/source/git-resources.jd b/src/source/git-resources.jd
index 5606b2d..0d15bac 100644
--- a/src/source/git-resources.jd
+++ b/src/source/git-resources.jd
@@ -1,4 +1,4 @@
-page.title=Git Resources
+page.title=Learning Git
@jd:body
<!--
diff --git a/src/source/index.jd b/src/source/index.jd
index 34531f0..1941ed6 100644
--- a/src/source/index.jd
+++ b/src/source/index.jd
@@ -17,7 +17,7 @@
limitations under the License.
-->
<p>
-Android is an open-source software stack created for a wide array of devices
+Android is an open source software stack created for a wide array of devices
with different form factors. The primary purposes of Android are to create an
open software platform available for carriers, OEMs, and developers to make
their innovative ideas a reality and to introduce a successful,
@@ -47,7 +47,7 @@
</p>
<p>The companies that have invested in Android have done so on its merits
because we believe an open platform is necessary. Android is
-intentionally and explicitly an open-source -- as opposed to a free software --
+intentionally and explicitly an open source -- as opposed to a free software --
effort; a group of organizations with shared needs has pooled
resources to collaborate on a single implementation of a shared product.
The Android philosophy is pragmatic, first and foremost. The objective is
diff --git a/src/source/initializing.jd b/src/source/initializing.jd
index f7863e6..736f9c4 100644
--- a/src/source/initializing.jd
+++ b/src/source/initializing.jd
@@ -1,4 +1,4 @@
-page.title=Initializing a Build Environment
+page.title=Establishing a Build Environment
@jd:body
<!--
@@ -47,9 +47,10 @@
<p>For Gingerbread (2.3.x) and newer versions, including the <code>master</code>
branch, a 64-bit environment is required. Older versions can be
compiled on 32-bit systems.</p>
-<p><strong>Note</strong>: See the <a href="building.html">Downloading and
-Building</a> page for the list of hardware and software requirements. Then
-follow the detailed instructions for Ubuntu and Mac OS below.</p>
+<p class="note"><strong>Note:</strong> See the <a
+href="requirements.html">Requirements</a> for the complete list of hardware and
+software requirements. Then follow the detailed instructions for Ubuntu and Mac
+OS below.</p>
<h3 id="installing-the-jdk">Installing the JDK</h3>
<p>The <code>master</code> branch of Android in the <a
@@ -66,7 +67,7 @@
</code></pre>
<p>If you encounter version errors for Java, set its
-path as described in the <a href="building-running.html#wrong-java-version">Wrong
+path as described in the <a href="building.html#wrong-java-version">Wrong
Java Version</a> section.</p>
<p>To develop older versions of Android, download and install the corresponding version of the <a
@@ -74,12 +75,12 @@
Java 6: for Gingerbread through KitKat<br/>
Java 5: for Cupcake through Froyo</p>
-<p><strong>Note</strong>: The <code>lunch</code> command in the build step will ensure that the Sun JDK is
+<p class="note"><strong>Note:</strong> The <code>lunch</code> command in the build step will ensure that the Sun JDK is
used instead of any previously installed JDK.</p>
<h3 id="installing-required-packages-ubuntu-1404">Installing required packages (Ubuntu 14.04)</h3>
<p>You will need a 64-bit version of Ubuntu. Ubuntu 14.04 is recommended.</p>
-<pre><code>$ sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip</code></pre>
+<pre><code>$ sudo apt-get install bison g++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip</code></pre>
<h3 id="installing-required-packages-ubuntu-1204">Installing required packages (Ubuntu 12.04)</h3>
<p>You may use Ubuntu 12.04 to build older versions of Android. Version 12.04 is not supported on master or recent releases.</p>
@@ -110,46 +111,15 @@
<p>Under GNU/Linux systems (and specifically under Ubuntu systems),
regular users can't directly access USB devices by default. The
system needs to be configured to allow such access.</p>
-<p>The recommended approach is to create a file
-<code>/etc/udev/rules.d/51-android.rules</code> (as the root user) and to copy
-the following lines in it. <code><username></code> must be replaced by the
-actual username of the user who is authorized to access the phones
-over USB.</p>
-<pre><code># adb protocol on passion (Nexus One)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
-# fastboot protocol on passion (Nexus One)
-SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
-# adb protocol on crespo/crespo4g (Nexus S)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
-# fastboot protocol on crespo/crespo4g (Nexus S)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
-# adb protocol on stingray/wingray (Xoom)
-SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
-# fastboot protocol on stingray/wingray (Xoom)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="<username>"
-# adb protocol on maguro/toro (Galaxy Nexus)
-SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="<username>"
-# fastboot protocol on maguro/toro (Galaxy Nexus)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="<username>"
-# adb protocol on panda (PandaBoard)
-SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="<username>"
-# adb protocol on panda (PandaBoard ES)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0600", OWNER="<username>"
-# fastboot protocol on panda (PandaBoard)
-SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="<username>"
-# usbboot protocol on panda (PandaBoard)
-SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0600", OWNER="<username>"
-# usbboot protocol on panda (PandaBoard ES)
-SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0600", OWNER="<username>"
-# adb protocol on grouper/tilapia (Nexus 7)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0600", OWNER="<username>"
-# fastboot protocol on grouper/tilapia (Nexus 7)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0600", OWNER="<username>"
-# adb protocol on manta (Nexus 10)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0600", OWNER="<username>"
-# fastboot protocol on manta (Nexus 10)
-SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee0", MODE="0600", OWNER="<username>"
-</code></pre>
+<p>The recommended approach is to create a file at
+<code>/etc/udev/rules.d/51-android.rules</code> (as the root user).</p>
+
+<p>To do this, run the following command to download the <a href="51-android.rules">51-android.rules</a> file attached to this site, modify it to include your username, and place it in the correct location:</p>
+
+<pre>
+<code>$ wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules</code>
+</pre>
+
<p>Those new rules take effect the next time a device is plugged in.
It might therefore be necessary to unplug the device and plug it
back into the computer.</p>
@@ -212,7 +182,7 @@
<pre><code># mount the android file image
function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }
</code></pre>
-<p><strong>Note</strong>: If your system created a <code>.dmg.sparseimage</code> file, replace <code>~/android.dmg</code> with <code>~/android.dmg.sparseimage</code>.</p>
+<p class="note"><strong>Note:</strong> If your system created a <code>.dmg.sparseimage</code> file, replace <code>~/android.dmg</code> with <code>~/android.dmg.sparseimage</code>.</p>
</li>
<li>
<p>To unmount it when you execute <code>umountAndroid</code>:</p>
@@ -266,13 +236,11 @@
</li>
<li>
<p>Install MacPorts from <a href="http://www.macports.org/install.php">macports.org</a>.</p>
-<p><em>Note: Make sure that <code>/opt/local/bin</code> appears in your path BEFORE <code>/usr/bin</code>. If not, add</em> </p>
-<pre><code>export PATH=/opt/local/bin:$PATH
-</code></pre>
-<p><em>to your <code>~/.bash_profile</code>.</em></p>
-
-<p><strong>Note</strong>: If you do not have a <code>.bash_profile</code> file in your home directory, create one.</p>
-
+<p class="note"><strong>Note:</strong> Make sure that <code>/opt/local/bin</code> appears in your path <strong>before</strong> <code>/usr/bin</code>. If not, please add the following to your <code>~/.bash_profile</code> file:</p>
+<pre>
+<code>export PATH=/opt/local/bin:$PATH</code>
+</pre>
+<p class="note"><strong>Note:</strong> If you do not have a <code>.bash_profile</code> file in your home directory, create one.</p>
</li>
<li>
<p>Get make, git, and GPG packages from MacPorts: </p>
diff --git a/src/source/known-issues.jd b/src/source/known-issues.jd
index 9a6d9fc..49657e5 100644
--- a/src/source/known-issues.jd
+++ b/src/source/known-issues.jd
@@ -96,7 +96,7 @@
actions could have swapped the default compiler.</p>
<h3 id="build-errors-caused-by-non-default-tool-settings">Build errors caused by non-default tool settings.</h3>
<p><strong>Symptom</strong>: The build fails with various symptoms, possibly
-complinaing about missing files or files that have the
+complaining about missing files or files that have the
wrong format. One such symptom is <code>member [...] in archive is not an object</code>.</p>
<p><strong>Cause</strong>: The Android build system tends to use many host tools
and to rely on their default behaviors. Some settings change
@@ -151,7 +151,7 @@
One such symptom is
<code>DownloadError: HTTP 500 (Internal Server Error: Server got itself in trouble)</code>.</p>
<p><strong>Cause</strong>: The default network behavior of VirtualBox is to use
-NAT (Network Addrss Translation) to connect the guest system to
+NAT (Network Address Translation) to connect the guest system to
the network. The heavy network activity of repo sync triggers some
corner cases in the NAT code.</p>
<p><strong>Fix</strong>: Configure VirtualBox to use bridged network instead of NAT.</p>
diff --git a/src/source/licenses.jd b/src/source/licenses.jd
index 5135bdb..0e4640d 100644
--- a/src/source/licenses.jd
+++ b/src/source/licenses.jd
@@ -36,28 +36,30 @@
license, there may be exceptions that will be handled on a case-by-case
basis. For example, the Linux kernel patches are under the GPLv2 license with
system exceptions, which can be found on <a href="http://www.kernel.org/pub/linux/kernel/COPYING">kernel.org</a>.</p>
-<h2 id="contributor-license-grants">Contributor License Grants</h2>
+<h2 id="contributor-license-grants">Contributor License Agreements</h2>
<p>All <em>individual</em> contributors (that is, contributors making contributions
only on their own behalf) of ideas, code, or documentation to the Android Open
-Source Project will be required to complete, sign, and submit an <a href="cla-individual.html">Individual
-Contributor License Grant</a>. The grant can be executed online through the
+Source Project will be required to complete, sign, and submit an <a
+href="https://cla.developers.google.com/clas/new?kind=KIND_INDIVIDUAL&domain=DOMAIN_ANDROID">Individual
+Contributor License Agreement</a>. The agreement can be executed online through the
<a href="https://android-review.googlesource.com/#/settings/agreements">code review tool</a>.
-The grant clearly defines the terms under which intellectual
+The agreement clearly defines the terms under which intellectual
property has been contributed to the Android Open Source Project. This license
is for your protection as a contributor as well as the protection of the
project; it does not change your rights to use your own contributions for any
other purpose.</p>
<p>For a <em>corporation</em> (or other entity) that has assigned employees to
-work on the Android Open Source Project, a <a href="cla-corporate.pdf">Corporate
-Contributor License Grant</a> is available.
-This version of the grant allows a
+work on the Android Open Source Project, a <a
+href="https://cla.developers.google.com/clas/new?kind=KIND_CORPORATE&domain=DOMAIN_ANDROID">Corporate
+Contributor License Agreement</a> is available.
+This version of the agreement allows a
corporation to authorize contributions submitted by its designated employees
and to grant copyright and patent licenses. Note that a Corporate Contributor
-License Grant does not remove the need for any developer to sign their own
-Individual Contributor License Grant as an individual. The individual grant is needed
-to cover any of their contributions that are <em>not</em> owned by the corporation signing the
-Corporate Contributor License Grant.</p>
-<p>Please note we based our grants on the ones the
+License Agreement does not remove the need for any developer to sign their own
+Individual Contributor License Agreement as an individual. The individual
+agreement is needed to cover any of their contributions that are <em>not</em>
+owned by the corporation signing the Corporate Contributor License Agreement.</p>
+<p>Please note we based our agreements on the ones the
<a href="http://www.apache.org">Apache Software Foundation</a> uses, which can
be found on the <a href="http://www.apache.org/licenses/">Apache web site</a>.</p>
<h2 id="why-apache-software-license">Why Apache Software License?</h2>
diff --git a/src/source/overview.html b/src/source/overview.html
deleted file mode 100644
index b8f56fc..0000000
--- a/src/source/overview.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=/source/index.html" />
-</head>
-<body>
-</body>
-</html>
diff --git a/src/source/requirements.jd b/src/source/requirements.jd
new file mode 100644
index 0000000..c063ca3
--- /dev/null
+++ b/src/source/requirements.jd
@@ -0,0 +1,64 @@
+page.title=Requirements
+@jd:body
+
+<!--
+ Copyright 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<p>The Android build is routinely tested in-house on recent versions of
+Ubuntu LTS (14.04), but most distributions should have the required
+build tools available.</p>
+
+<p>Before you download and build the Android source, ensure your system meets
+the following requirements:</p>
+
+<ul>
+
+ <li>A Linux or Mac OS system. It is also possible
+ to build Android in a virtual machine on unsupported systems such as Windows.
+ If you are running Linux in a virtual machine, you need at
+ least 16GB of RAM/swap and 100GB or more of disk space in order to
+ build the Android tree. See disk size requirements below.
+ </li>
+
+ <li>A 64-bit environment is required for Gingerbread (2.3.x) and newer versions, including the master
+ branch. You can compile older versions on 32-bit systems.
+ </li>
+
+ <li>At least 100GB of free disk space for a checkout, 150GB for a single
+ build, and 200GB or more for multiple builds. If you employ ccache, you will
+ need even more space.</p>
+ </li>
+
+ <li>
+ Python 2.6 -- 2.7, which you can download from <a href="http://www.python.org/download/">python.org</a>.</p>
+ </li>
+
+ <li>
+ GNU Make 3.81 -- 3.82, which you can download from <a href="http://ftp.gnu.org/gnu/make/">gnu.org</a>,</p>
+ </li>
+
+ <li>
+ JDK 7 to build the master branch of Android in the <a
+ href="https://android.googlesource.com/">Android Open Source Project
+ (AOSP)</a>; JDK 6 to build Gingerbread through KitKat; JDK 5 for Cupcake through
+ Froyo. See <a href="initializing.html">Initializing a Build Environment</a>
+ for installation instructions by operating system.</p>
+ </li>
+
+ <li>
+ Git 1.7 or newer. You can find it at <a href="http://git-scm.com/download">git-scm.com</a>.</p>
+ </li>
+
+</ul>
diff --git a/src/source/roles.jd b/src/source/roles.jd
index dccd402..34c9e46 100644
--- a/src/source/roles.jd
+++ b/src/source/roles.jd
@@ -51,8 +51,8 @@
<h2 id="verifier">Verifier</h2>
<p>"Verifiers" are responsible for testing change requests. After individuals
have submitted a significant amount of high-quality code to the project, the
-project leads might invite them to become verifiers. <em>Note: at this
-time, verifiers act similarly to approvers.</em></p>
+project leads might invite them to become verifiers.</p>
+<p class="note"><strong>Note:</strong> At this time, verifiers act similarly to approvers.</p>
<h2 id="approver">Approver</h2>
<p>"Approvers" are experienced members of the project who have demonstrated their
design skills and have made significant technical contributions to the
diff --git a/src/source/building-devices.jd b/src/source/running.jd
similarity index 84%
rename from src/source/building-devices.jd
rename to src/source/running.jd
index 06b4352..393bb16 100644
--- a/src/source/building-devices.jd
+++ b/src/source/running.jd
@@ -1,8 +1,8 @@
-page.title=Building for devices
+page.title=Running Builds
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -25,34 +25,27 @@
</div>
<p>This page complements the main page about
-<a href="building-running.html">Building and Running</a> with
+<a href="building.html">Building the System</a> with
information that is specific to individual devices.</p>
-<p>With the current release, it is possible to build for
-Nexus 4, Nexus 7, and for some variants of Galaxy Nexus.
-The exact level of functionality for each device depends on the availability
-of the relevant proprietary hardware-specific binaries.</p>
-<p>For Nexus 4 and Nexus 7, all configurations can be used,
-and all the hardware is functional.
-Due to hardware differences, do not use 4.1.1 on a Nexus 7 that
+<h2 class="nexus-devices">Nexus devices</h2>
+<p>
+It is possible to build for Nexus devices using the AOSP
+builds and the relevant hardware-specific binaries.
+For a list of available Android builds and the Nexus devices
+they can be installed on, see <a
+href="build-numbers.html#source-code-tags-and-builds">Source
+Code, Tags, and Builds</a>.
+</p>
+
+<p class="note">
+<b>Note:</b> Due to hardware differences, do not use 4.1.1 on a Nexus 7 that
was originally sold with 4.1.2 or newer.</p>
-<p>All configurations of Nexus 10 "manta" can be used with 4.2.2.
-On those devices, graphics, audio,
-Wi-Fi, Bluetooth, camera, NFC, GPS and orientation sensors are functional.</p>
-<p>The variants of Galaxy Nexus that can be used are the GSM/HSPA+ configuration
-"maguro" (only if it was originally sold with a "yakju" or "takju" operating
-system) and the VZW CDMA/LTE configuration "toro". On those devices, graphics
-and audio are functional, as well as Wi-Fi, Bluetooth, and access to the
-respective cellular networks. NFC and the orientation sensors are functional.</p>
-<p>The Sprint CDMA/LTE configuration "toroplus" of Galaxy Nexus is supported
-experimentally, in the jb-mr1-dev-plus-aosp branch. On that configuration,
-the cellular network is not functional,
-and the other peripherals work like they do on "toro".</p>
+
+<h2 class="other-devices">Other devices</h2>
<p>The Motorola Xoom can be used in the Wi-Fi configuration "wingray"
sold in the USA, with Android 4.1.2. Graphics and audio are functional
as well as Wi-Fi and Bluetooth and the orientation sensors.</p>
-<p>All configurations of Nexus S and Nexus S 4G can be used with Android 4.1.2.
-On those devices all the hardware is functional.</p>
<p>In addition, <a href="http://pandaboard.org">PandaBoard</a> a.k.a. "panda" can be used
in the jb-mr1-dev-plus-aosp branch, but is considered experimental.
The specific details to use a PandaBoard with the Android Open-Source Project
@@ -61,9 +54,11 @@
<h2 id="building-fastboot-and-adb">Building fastboot and adb</h2>
<p>If you don't already have those tools, fastboot and adb can be built with
the regular build system. Follow the instructions on the page about
-<a href="building-running.html">Building and Running</a>, and replace the main <code>make</code> command with</p>
+<a href="building.html">Building a System</a>, and replace the main
+<code>make</code> command with:</p>
<pre><code>$ make fastboot adb
</code></pre>
+
<h2 id="booting-into-fastboot-mode">Booting into fastboot mode</h2>
<p>During a cold boot, the following key combinations can be used to boot into fastboot mode,
which is a mode in the bootloader that can be used to flash the devices:</p>
@@ -181,7 +176,7 @@
branches can be downloaded from <a
href="https://developers.google.com/android/nexus/drivers">Google's Nexus
driver page</a>. These add access to additional hardware capabilities with
-non-open-source code. To instead build the AOSP master branch, use the <a
+non-open source code. To instead build the AOSP master branch, use the <a
href="https://developers.google.com/android/nexus/blobs-preview">Binaries
Preview for Nexus Devices</a>.</p>
<p>When building the master branch for a device, the binaries for the most
@@ -200,8 +195,6 @@
<pre><code>$ make clobber
</code></pre>
<h2 id="picking-and-building-the-configuration-that-matches-a-device">Picking and building the configuration that matches a device</h2>
-<p>The steps to configure and build the Android Open Source Project
-are described in the <a href="building.html">Building</a> page.</p>
<p>The recommended builds for the various devices are available through
the lunch menu, accessed when running the <code>lunch</code> command with no arguments. Factory images and binaries for Nexus devices can be downloaded from:</p>
<p><a href="https://developers.google.com/android/nexus/images">https://developers.google.com/android/nexus/images</a></p>
diff --git a/src/source/source_toc.cs b/src/source/source_toc.cs
index 7ec831c..d886a3c 100644
--- a/src/source/source_toc.cs
+++ b/src/source/source_toc.cs
@@ -1,5 +1,5 @@
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -33,18 +33,17 @@
<li class="nav-section">
<div class="nav-section-header">
- <a href="<?cs var:toroot ?>source/building.html">
+ <a href="<?cs var:toroot ?>source/requirements.html">
<span class="en">Downloading and Building</span>
</a>
</div>
<ul>
- <li><a href="<?cs var:toroot ?>source/initializing.html">Initializing the Build Environment</a></li>
+ <li><a href="<?cs var:toroot ?>source/initializing.html">Establishing a Build Environment</a></li>
<li><a href="<?cs var:toroot ?>source/downloading.html">Downloading the Source</a></li>
- <li><a href="<?cs var:toroot ?>source/configure-products.html">Configuring the Products</a></li>
- <li><a href="<?cs var:toroot ?>source/building-running.html">Building and Running</a></li>
- <li><a href="<?cs var:toroot ?>source/building-devices.html">Building for Devices</a></li>
+ <li><a href="<?cs var:toroot ?>source/building.html">Building the System</a></li>
+ <li><a href="<?cs var:toroot ?>source/jack.html">Compiling with Jack</a></li>
+ <li><a href="<?cs var:toroot ?>source/running.html">Running Builds</a></li>
<li><a href="<?cs var:toroot ?>source/building-kernels.html">Building Kernels</a></li>
- <li><a href="<?cs var:toroot ?>source/64-bit-builds.html">64-bit Build Instructions</a></li>
<li><a href="<?cs var:toroot ?>source/known-issues.html">Known Issues</a></li>
</ul>
</li>
@@ -57,7 +56,9 @@
<ul>
<li><a href="<?cs var:toroot ?>source/using-repo.html">Using Repo</a></li>
<li><a href="<?cs var:toroot ?>source/using-eclipse.html">Using Eclipse</a></li>
- <li><a href="<?cs var:toroot ?>source/git-resources.html">Git Resources</a></li>
+ <li><a href="<?cs var:toroot ?>source/git-resources.html">Learning Git</a></li>
+ <li><a href="<?cs var:toroot ?>source/add-device.html">Adding a New Device</a></li>
+ <li><a href="<?cs var:toroot ?>source/64-bit-builds.html">Understanding 64-bit Builds</a></li>
</ul>
</li>
@@ -79,7 +80,7 @@
<li class="nav-section">
<div class="nav-section-header empty">
- <a href="<?cs var:toroot ?>source/community/index.html">
+ <a href="<?cs var:toroot ?>source/community.html">
<span class="en">Community</span>
</a>
</div>
diff --git a/src/source/submit-patches.jd b/src/source/submit-patches.jd
index d78aabc..0298ea9 100644
--- a/src/source/submit-patches.jd
+++ b/src/source/submit-patches.jd
@@ -179,7 +179,7 @@
<p>To publish your comments so that others using Gerrit will be able to see them, click the Publish Comments button. Your comments will be emailed to all relevant parties for this change, including the change owner, the patch set uploader (if different from the owner), and all current reviewers.</p>
<p><a name="upstream-projects"></a></p>
<h1 id="upstream-projects">Upstream Projects</h1>
-<p>Android makes use of a number of other open-source projects, such as the Linux kernel and WebKit, as described in
+<p>Android makes use of a number of other open source projects, such as the Linux kernel and WebKit, as described in
<a href="{@docRoot}source/code-lines.html">Codelines, Branches, and Releases</a>. For most projects under <code>external/</code>, changes should be made upstream and then the Android maintainers informed of the new upstream release containing these changes. It may also be useful to upload patches that move us to track a new upstream release, though these can be difficult changes to make if the project is widely used within Android like most of the larger ones mentioned below, where we tend to upgrade with every release.</p>
<p>One interesting special case is bionic. Much of the code there is from BSD, so unless the change is to code that's new to bionic, we'd much rather see an upstream fix and then pull a whole new file from the appropriate BSD. (Sadly we have quite a mix of different BSDs at the moment, but we hope to address that in future, and get into a position where we track upstream much more closely.)</p>
<h2 id="icu4c">ICU4C</h2>
diff --git a/src/source/using-eclipse.jd b/src/source/using-eclipse.jd
index 4d78c42..33ef381 100644
--- a/src/source/using-eclipse.jd
+++ b/src/source/using-eclipse.jd
@@ -24,10 +24,10 @@
</div>
</div>
<p>This document will help you set up the Eclipse IDE for Android platform development.</p>
-<p><em>Note: if you are looking for information on how to use
+<p class="note"><strong>Note:</strong> If you are looking for information on how to use
Eclipse to develop applications that run on Android, this is not the right
page for you. You probably would find <a href="https://developer.android.com/sdk/eclipse-adt.html">the Eclipse page on
-developer.android.com</a> more useful.</em></p>
+developer.android.com</a> more useful.</p>
<h2 id="basic-setup">Basic setup</h2>
<p>First, it's important to make sure the regular Android development system is set up.</p>
<pre><code>cd /path/to/android/root
@@ -81,7 +81,7 @@
</li>
</ol>
<p>Once the project workspace is created, Eclipse should start building. In theory, it should build with no errors and you should be set to go. If necessary, uncheck and re-check Project Build Automatically to force a rebuild.</p>
-<p><em>Note:</em> Eclipse sometimes likes to add an <code>import android.R</code> statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.</p>
+<p class="note"><strong>Note:</strong> Eclipse sometimes adds an <code>import android.R</code> statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.</p>
<h3 id="when-you-sync">When You Sync</h3>
<p>Every time you repo sync, or otherwise change files outside of Eclipse (especially the .classpath), you need to refresh Eclipse's view of things:</p>
<ol>
@@ -230,5 +230,5 @@
</li>
</ul>
<p>If you're still having problems, please contact one of the <a
-href="{@docRoot}source/community/index.html">Android community mailing lists or
+href="{@docRoot}source/community.html">Android community mailing lists or
IRC channels</a>.</p>
diff --git a/src/source/using-repo.jd b/src/source/using-repo.jd
index 57a93c9..e1d1f0e 100644
--- a/src/source/using-repo.jd
+++ b/src/source/using-repo.jd
@@ -42,6 +42,13 @@
<pre><code>repo help <em><COMMAND></em>
</code></pre>
+<p>For example, the following command yields a description and list of options
+for the <code>init</code> argument of Repo, which initializes Repo in the
+current directory. (See <a href="#init">init</a> for more details.)</p>
+<pre><code>repo help init
+</code></pre>
+
+
<h2 id="init">init</h2>
<pre><code>$ repo init -u <em><URL></em> [<em><OPTIONS></em>]
</code></pre>
@@ -58,7 +65,7 @@
<p><code>-b</code>: specify a revision, i.e., a particular manifest-branch.</p>
</li>
</ul>
-<p><em>Note: For all remaining Repo commands, the current working directory must either be the parent directory of <code>.repo/</code> or a subdirectory of the parent directory.</em></p>
+<p class="note"><strong>Note:</strong> For all remaining Repo commands, the current working directory must either be the parent directory of <code>.repo/</code> or a subdirectory of the parent directory.</p>
<h2 id="sync">sync</h2>
<pre><code>repo sync [<em><PROJECT_LIST></em>]
</code></pre>
@@ -134,7 +141,7 @@
<pre><code>$ repo download platform/build 23823
</code></pre>
<p>A <code>repo sync</code> should effectively remove any commits retrieved via <code>repo download</code>. Or, you can check out the remote branch; e.g., <code>git checkout m/master</code>.</p>
-<p>*Note: There is a slight mirroring lag between when a change is visible on
+<p class="note"><strong>Note:</strong> There is a slight mirroring lag between when a change is visible on
the web in <a href="https://android-review.googlesource.com/">Gerrit</a> and when
<code>repo download</code> will be able to find it for all users, because of replication
delays to all servers worldwide.</p>
@@ -181,7 +188,7 @@
<p>Begins a new branch for development, starting from the revision specified in the manifest.</p>
<p>The <code><em><BRANCH_NAME></em></code> argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.</p>
<p>The <code><em><PROJECT_LIST></em></code> specifies which projects will participate in this topic branch. </p>
-<p><em>Note: "." is a useful shorthand for the project in the current working directory.</em></p>
+<p class="note"><strong>Note:</strong> "." is a useful shorthand for the project in the current working directory.</p>
<h2 id="status">status</h2>
<pre><code>repo status [<em><PROJECT_LIST></em>]
</code></pre>
diff --git a/src/source/version-control.html b/src/source/version-control.html
deleted file mode 100644
index e85ebc2..0000000
--- a/src/source/version-control.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
-<head>
-<meta http-equiv="refresh" content="0;url=/source/developing.html" />
-</head>
-<body>
-</body>
-</html>