Merge "Docs: Define user builds and isolated client mode, add SIM # and AAPT"
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/cts/run.jd b/src/compatibility/cts/run.jd
index ba44a3e..68f7da2 100644
--- a/src/compatibility/cts/run.jd
+++ b/src/compatibility/cts/run.jd
@@ -68,12 +68,16 @@
   <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>
+<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> </th>
+      <th>Description</th>
     </tr>
     <tr>
       <td><code>help</code></td>
@@ -89,11 +93,13 @@
     </tr>
     <tr>
       <th>Run</th>
-      <th> </th>
+      <th>Description</th>
     </tr>
     <tr>
       <td><code>run cts</code></td>
-      <td>Run the specified tests and displays progress information. One of --plan, --package, --class or --continue-session-id needs to be specified
+      <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>
@@ -111,7 +117,7 @@
       <td>Run the specified test class and/or method</td>
     </tr>
     <tr>
-      <td><code>--continue-session-id</code></td>
+      <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>
@@ -127,12 +133,12 @@
       <td>Run a specific test method</td>
     </tr>
     <tr>
-      <td><code>--abi 32|64</code></td>
+      <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> </th>
+      <th>Description</th>
     </tr>
     <tr>
       <td><code>list packages</code></td>
@@ -166,7 +172,7 @@
     </tr>
     <tr>
       <th>Add</th>
-      <th> </th>
+      <th>Description</th>
     </tr>
     <tr>
       <td><code>add derivedplan --plan &lt;plan_name&gt;<br>
diff --git a/src/compatibility/downloads.jd b/src/compatibility/downloads.jd
index 82a4b4a..c6973be 100644
--- a/src/compatibility/downloads.jd
+++ b/src/compatibility/downloads.jd
@@ -165,7 +165,7 @@
 </ul>
 <h2 id="compatibility-test-suite-manual">Compatibility Test Suite Manual</h2>
 <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/devices/audio/debugging.jd b/src/devices/audio/debugging.jd
index 503f35b..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
@@ -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/tech/config/kernel.jd b/src/devices/tech/config/kernel.jd
index fa7632f..9db593e 100644
--- a/src/devices/tech/config/kernel.jd
+++ b/src/devices/tech/config/kernel.jd
@@ -40,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>
@@ -180,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
@@ -300,7 +300,7 @@
 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
@@ -308,7 +308,7 @@
 # CONFIG_USB_AUDIO is for a peripheral mode (gadget) driver
 </pre>
 
-<h3>For USB host mode MIDI</h3>
+<h3 id="midi">For USB host mode MIDI</h3>
 
 <pre>
 CONFIG_SND_USB_MIDI=y
diff --git a/src/devices/tech/test_infra/tradefed/full_example.jd b/src/devices/tech/test_infra/tradefed/full_example.jd
index 34cd63a..4a29013 100644
--- a/src/devices/tech/test_infra/tradefed/full_example.jd
+++ b/src/devices/tech/test_infra/tradefed/full_example.jd
@@ -38,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>
@@ -47,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>
@@ -76,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>
@@ -93,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>
@@ -105,14 +105,13 @@
 </code></pre>
 
 <p>Configurations can be executed using the <code>run &lt;config&gt;</code> console command.  Try this:</p>
-<p>FIXME: redo this</p>
 <pre><code>tf&gt; 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>
@@ -133,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>
 
@@ -183,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
@@ -218,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
@@ -279,7 +278,7 @@
 results to multiple independent destinations. Just specify multiple
 <code>&lt;result_reporter&gt;</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>
@@ -337,7 +336,7 @@
 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
@@ -372,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&gt; run example/helloworld --my_option foo

@@ -405,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>&lt;option name="" value=""&gt;</code> element. Let's see how this looks in
 <code>helloworld.xml</code>:</p>
@@ -437,10 +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="{@docRoot}source/community.html">android-platform</a> Google Group, with "Trade Federation"
-in the message subject.</p>
\ No newline at end of file
+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 568cd35..f054d43 100644
--- a/src/devices/tech/test_infra/tradefed/fundamentals/options.jd
+++ b/src/devices/tech/test_infra/tradefed/fundamentals/options.jd
@@ -36,7 +36,7 @@
 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 -->
@@ -67,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
@@ -90,7 +90,7 @@
     &lt;/test&gt;
 &lt;/configuration&gt;</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 &lt;name&gt;</code> instruction (or <code>run &lt;name&gt;</code> for short).
@@ -104,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>
-