resolved conflicts for merge of 069b25ab to mnc-dev-plus-aosp
diff --git a/src/compatibility/5.1/CDD_README.txt b/src/compatibility/5.1/CDD_README.txt
new file mode 100644
index 0000000..f6901a2
--- /dev/null
+++ b/src/compatibility/5.1/CDD_README.txt
@@ -0,0 +1,93 @@
+WKTHMLTOPDF 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 Adobe Acrobat 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 Adobe Acrobat. 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, since you must use Adobe Acrobat Pro (not Reader) to insert the cover page, you must perform this step on a Mac or Windows box (none of the 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. 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 (from root, including the filename) 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:
+/usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html
+
+path-to-pdf
+The full path (from root, including the filename) 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.
+/usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-cover.pdf
+
+
+Example cover command:
+
+wkhtmltopdf -s letter -B 0in -T 0in -L 0in -R 0in cover /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-cover_5_1.html /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/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 (from root, including the filename) to the body html file. This is the main cdd.html, which will change with each release.
+Ex.
+/usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html
+
+path-to-footer
+The full path (from root, including the filename) 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 /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html
+
+
+path-to-pdf
+The full path (from root, including the filename) 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.
+/usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf
+
+
+Example body command:
+
+wkhtmltopdf -B 1in -T 1in -L .75in -R .75in page /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-5.1-cdd.html --footer-html /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-footer.html /usr/local/google/home/hvm/Projects/internal/lmp-mr1-dev/docs/source.android.com/src/compatibility/5.1/android-cdd-body.pdf
+
+4. CREATE CSS PDF
+==================
+A. Open the body.pdf in Adobe Acrobat Pro (you *cannot* use Acrobat Reader for this task).
+B. Select Tools > Replace, then open the cover.pdf file and 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.
+- all cdd html, css, and current pdf files are in docs/source.android.com/src/compatibility/release-number (currently 5.1).
+- all cdd images are in docs/source.android.com/src/compatibility/images.
+- all files currently in the lmp-dev-mr1 branch.
\ No newline at end of file
diff --git a/src/compatibility/5.1/android-5.1-cdd.html b/src/compatibility/5.1/android-5.1-cdd.html
index 9b9ff55..efe2adc 100644
--- a/src/compatibility/5.1/android-5.1-cdd.html
+++ b/src/compatibility/5.1/android-5.1-cdd.html
@@ -163,7 +163,6 @@
 
 <div style="clear: both; page-break-after:always; height:1px"></div>
 
-
 <div id="toc_left_2">
 
 <p class="toc_h3"><a href="#7_1_2_display_metrics">7.1.2. Display Metrics</a></p>
@@ -1793,6 +1792,7 @@
 
 <h3 id="5_1_3_video_codecs">5.1.3. Video Codecs</h3>
 
+<div class="div">
 <p>Video codecs are optional for Android Watch device implementations.</p>
 
 <table>
@@ -4252,7 +4252,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>
@@ -4263,7 +4263,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,
@@ -4376,6 +4375,10 @@
     <th>Summary of change</th>
  </tr>
  <tr>
+    <td>1. Introduction</td>
+    <td>Updated requirements to refer to SDK documentation as source of truth.</td>
+ </tr>
+ <tr>
     <td>2. Device Types</td>
     <td>Added definition for Android automotive implementation.</td>
  </tr>
@@ -4408,7 +4411,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>
@@ -4419,6 +4422,8 @@
     <td>3.9. Device Administration</td>
     <td>Clarified condition when the full range of device administration policies
         has to be supported.</td>
+
+
  </tr>
  <tr>
     <td>3.10. Accessibility</td>
@@ -4445,6 +4450,12 @@
     <td>Added Android automotive requirements.</td>
  </tr>
  <tr>
+    <td>7.1.6. Screen Technology</td>
+    <td>Updated pixel aspect ratio (PAR) to be between 0.9 and 1.15. (~15% tolerance)</td>
+ </tr>
+ <tr>
+    <td>7.1.7. External Displays</td>
+    <td>Moved part of section to section 5.8. Secure Media.</td>
     <td>7.2 Input Devices</td>
     <td>Added general introduction statement.</td>
  </tr>
@@ -4452,6 +4463,7 @@
     <td>7.2.1. Keyboard</td>
     <td>Added Android Automotive requirements.</td>
  </tr>
+
  <tr>
     <td>7.2.3. Navigation Keys</td>
     <td>Added Android Automotive requirements.</td>
diff --git a/src/compatibility/5.1/android-5.1-cdd.pdf b/src/compatibility/5.1/android-5.1-cdd.pdf
index 78a9857..483f25a 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..37402d3 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..f1e2169 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..8ffdd31 100644
--- a/src/compatibility/5.1/android-cdd-cover_5_1.html
+++ b/src/compatibility/5.1/android-cdd-cover_5_1.html
@@ -39,4 +39,4 @@
 </table>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/src/compatibility/5.1/android-cdd-footer.html b/src/compatibility/5.1/android-cdd-footer.html
new file mode 100644
index 0000000..fce6481
--- /dev/null
+++ b/src/compatibility/5.1/android-cdd-footer.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Android 5.1 Compatibility Definition Footer</title>
+<link rel="stylesheet" type="text/css" href="android-cdd.css"/>
+
+<script>
+  function subst() {
+    var vars={};
+    var x=window.location.search.substring(1).split('&');
+    for (var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+    var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+    for (var i in x) {
+      var y = document.getElementsByClassName(x[i]);
+      for (var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+    }
+  }
+</script>
+
+</head>
+
+<body style="border:0; margin: 0;" onload="subst()">
+<div class="footer">
+
+<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" style="text-align:right">
+        Page <span class="page"></span> of <span class="topage"></span>
+      </td>
+    </tr>
+</table>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/src/compatibility/5.1/android-cdd.css b/src/compatibility/5.1/android-cdd.css
new file mode 100644
index 0000000..83c46bc
--- /dev/null
+++ b/src/compatibility/5.1/android-cdd.css
@@ -0,0 +1,372 @@
+/**
+* Link Styles
+*/
+
+
+a:link {
+    color: #09C;
+    text-decoration: underline;
+}
+
+a:visited {
+    color: #639;
+}
+
+a:hover,
+a:focus,
+a:active {
+    color: #09C;
+}
+
+/**
+* Cover Styles
+*/
+
+
+#cover {
+    width: 10.5in;
+    height: 13.25in;
+    background-color: orange;
+}
+
+#cover-top {
+    background-color: black;
+    width: 100%;
+    height: 3in;
+    padding-top: 70px;
+    margin-bottom: 10px;
+}
+
+#cover-image {
+    background-color: black;
+    width: 100%;
+    height: 5in;
+    padding: 0px;
+    margin: 20px 0px 8px 0px;
+}
+
+#cover-bottom {
+    background-color: black;
+    width: 100%;
+    height: 3.7in;
+    padding: 40px 0px 40px 0px;
+    margin-top: 8px;
+}
+
+#cover a:link,
+#cover a:visited,
+#cover a:hover {
+ text-decoration: none;
+}
+
+#main {
+    width: 950px;
+    overflow: visible;
+    page-break-before: always;
+}
+
+#footer {
+    width: 8.5in;
+    height: .75in;
+    margin-top: .25in;
+    color: #333;
+    font: 10pt/14pt Roboto, Arial, Helvetica, sans-serif;
+}
+
+
+.title {
+    color: white;
+    font: 84px/90px Roboto, Arial, Helvetica, sans-serif;
+    padding: 40pt 20pt 15pt 50pt;
+    text-align: left;
+}
+
+.subtitle {
+    color: white;
+    font: 60px/70px Roboto, Arial, Helvetica, sans-serif;
+    padding: 40pt 5pt 40pt 60pt;
+    text-align: left;
+}
+
+.right {
+    text-align: right;
+}
+
+.white {
+    color: white;
+}
+
+.padding {
+    padding: 20pt 20pt 0pt 60pt;
+}
+
+.cover-text {
+    font: 20px/25px Roboto, Arial, Helvetica, sans-serif;
+    color: white;
+    padding: 5pt 5pt 5pt 60pt;
+    text-align: left;
+}
+
+.small {
+    font-size: 65%;
+    font-weight: 700;
+}
+
+/**
+* Heading Styles
+*/
+
+h1 {
+    color: #333;
+    font: 22pt/24pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10pt 0pt 0pt 0pt;
+    text-align: left;
+}
+
+h2 {
+    color: #693;
+    font: 20pt/22pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 8pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+h3 {
+    color: #333;
+    font: bold 18pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 4pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+h4 {
+    color: #607D8B;
+    font: bold 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 4pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+
+h5 {
+    color: #333;
+    font: italic 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 0pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+
+/**
+* Use h6 ONLY for table of contents
+*/
+
+h6 {
+    color: #333;
+    font: bold 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-before: always;
+}
+
+/**
+* Body Styles
+*/
+
+body {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 5pt 5pt 10pt;
+}
+
+p {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 0pt 1pt 0pt;
+}
+
+li {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 2pt 50pt 2pt 0pt;
+}
+
+sup {
+    font-weight: 800;
+    font-size: 10pt;
+}
+
+/**
+* Table Styles
+*/
+
+
+table {
+    border: 1px solid gray;
+    border-collapse: collapse;
+    margin: 10px 0px 10px 0px;
+    width: 100%;
+    overflow: visible;
+}
+
+td {
+    border: 1px solid gray;
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 5pt;
+    overflow: visible;
+}
+
+th {
+    background-color: #CCC;
+    border: 1px solid gray;
+    color: #333;
+    font: bold 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 5pt;
+    overflow: visible;
+}
+
+p.table_footnote {
+    color: #333;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 5pt 5pt 5pt;
+}
+
+li.table_list {
+    color: #333;
+    font: 16pt/20t Roboto, Arial, Helvetica, sans-serif;
+    margin-left: -10pt;
+    padding: 2pt 0pt 2pt 0pt;
+}
+
+
+/**
+* Used in the footer
+*/
+
+table.noborder {
+    border: 0px;
+    margin: 10px 0px 10px 0px;
+    width: 100%;
+}
+
+td.noborder {
+    border: 0px;
+    color: #333;
+    font: 10pt/12pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10px 0px 5px 0px;
+}
+
+
+
+/**
+* TOC Styles
+*/
+
+#toc a:link,
+#toc a:visited,
+#toc a:hover {
+ color: black;
+ text-decoration: none;
+}
+
+#toc p.toc_h1 a:link,
+#toc p.toc_h1 a:visited,
+#toc p.toc_h1 a:hover {
+ color: #99CC00;
+}
+
+#toc {
+    width: 950px;
+}
+
+#toc_left,
+#toc_left_2 {
+    float: left;
+    padding-top:15px;
+    padding-bottom:15px;
+    width: 470px;
+}
+
+#toc_right,
+#toc_right_2 {
+    float: right;
+    padding-top:15px;
+    padding-bottom:15px;
+    width: 470px;
+}
+
+p.toc_h1 {
+    color: #99CC00;
+    font: 20pt/22pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 15px 0px 0px 0px;
+}
+
+p.toc_h2 {
+    color: black;
+    font: 18pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 20px;
+    padding: 15px 0px 0px 0px;
+}
+
+p.toc_h3 {
+    color: black;
+    font: 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 45px;
+    padding: 10px 0px 0px 0px;
+}
+
+p.toc_h4 {
+    color: black;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 85px;
+    padding: 10px 0px 0px 0px;
+}
+
+p.toc_h5 {
+    color: black;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 105px;
+}
+
+/**
+* Note Styles
+*/
+
+
+div.note 
+    {
+        border-left: 20px solid #0099cc;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+div.tip 
+    {
+        border-left: 4px solid #93c47d;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+div.warning 
+    {
+        border-left: 4px solid red;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+/**
+* Media Styles
+*/
+
+@media print {
+
+    @page {
+        margin: 1in;
+    }
+
+ }
\ No newline at end of file
diff --git a/src/compatibility/images/android-logo.png b/src/compatibility/images/android-logo.png
new file mode 100644
index 0000000..4ad113c
--- /dev/null
+++ b/src/compatibility/images/android-logo.png
Binary files differ
diff --git a/src/compatibility/images/android-lollipop.jpg b/src/compatibility/images/android-lollipop.jpg
new file mode 100644
index 0000000..7e2dcdc
--- /dev/null
+++ b/src/compatibility/images/android-lollipop.jpg
Binary files differ
diff --git a/src/devices/audio/implement.jd b/src/devices/audio/implement.jd
index 28f06b7..82cb111 100644
--- a/src/devices/audio/implement.jd
+++ b/src/devices/audio/implement.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.
@@ -47,9 +47,15 @@
 <code>device/&lt;company_name&gt;/&lt;device_name&gt;/audio/audio_policy.conf</code> file that
 declares the audio devices present on your product. For an example, see the file for the Galaxy
 Nexus audio hardware in <code>device/samsung/tuna/audio/audio_policy.conf</code>. Also, see the
-<code>system/core/include/system/audio.h</code> and
-<code>system/core/include/system/audio_policy.h</code> header files for a reference of the
-properties that you can define.</p>
+audio header files for a reference of the properties that you can define.</p>
+
+<p>In the Android M release and later, the paths are:<br>
+<code>system/media/audio/include/system/audio.h</code><br>
+<code>system/media/audio/include/system/audio_policy.h</code></p>
+
+<p>In Android 5.1 and earlier, the paths are:<br>
+<code>system/core/include/system/audio.h</code><br>
+<code>system/core/include/system/audio_policy.h</code></p>
 
 <h3 id="multichannel">Multi-channel support</h3>
 
diff --git a/src/devices/audio/tv.jd b/src/devices/audio/tv.jd
index bf60884..372c27d 100644
--- a/src/devices/audio/tv.jd
+++ b/src/devices/audio/tv.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.
@@ -74,7 +74,10 @@
 
 <p>Android supports the following audio devices for TV audio input/output.</p>
 
-<h4>system/core/include/system/audio.h</h4>
+<h4>system/media/audio/include/system/audio.h</h4>
+
+<p class="note"><strong>Note:</strong> In Android 5.1 and earlier, the path to
+this file is: <code>system/core/include/system/audio.h</code></p>
 
 <pre>
 /* output devices */
@@ -99,7 +102,10 @@
 
 <p>The Audio HAL extension for the audio routing API is defined by following:</p>
 
-<h4>system/core/include/system/audio.h</h4>
+<h4>system/media/audio/include/system/audio.h</h4>
+
+<p class="note"><strong>Note:</strong> In Android 5.1 and earlier, the path to
+this file is: <code>system/core/include/system/audio.h</code></p>
 
 <pre>
 /* audio port configuration structure used to specify a particular configuration of an audio port */
diff --git a/src/devices/tech/filesystem-config.jd b/src/devices/tech/filesystem-config.jd
new file mode 100644
index 0000000..46a2ffc
--- /dev/null
+++ b/src/devices/tech/filesystem-config.jd
@@ -0,0 +1,164 @@
+page.title=Configuring the Filesystem
+@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=abstract>Abstract</h2>
+
+<p>This document describes impending changes to the manner in which the Android
+file system is configured.</p>
+
+<p>The Android file system configuration file (<code>system/core/include/private/android_filesystem_config.h</code>) is not extensible in that device manufacturers have no means to add their own
+named binaries to the list to specify Discretionary Access Controls (DAC) of
+ownership, access mode, or executable capabilities. This limitation is shown
+with the introduction of support for Linux kernels 3.14 and higher where the
+wake lock is enabled via a capability <code>CAP_SUSPEND_BLOCK</code>; partner-supplied GPS daemons will need to hold this wake lock and thus have
+this capability set in the file system.</p>
+
+<p>Therefore, the Android M release is planned to move both the <code>fs_config</code> inline and the structure definitions in <code>system/core/include/private/android_filesystem_config.h</code> that it feeds on into <code>system/core/libcutils/fs_config.c</code> to be updated or overridden by binary files installed in <code>/system/etc/fs_config_dirs </code>and<code> /system/etc/fs_config_files</code>.</p>
+
+<h2 id=implementation>Implementation</h2>
+
+<p>Separate matching and parsing rules exist for directories and files. Files get
+the advantage of utilizing additional glob expressions. Files and Directories
+are handled separately by two different tables.</p>
+
+<p>The Android M release will remove the <code>fs_config</code> inline and the structure definitions that it feeds on, and place the code and
+default definitions into <code>system/core/libcutils/fs_config.c</code>. The <code>fs_config.c</code> file is modified beyond the basic definition to allow runtime reading of <code>/system/etc/fs_config_dirs</code> and <code>/system/etc/fs_config_files</code> to garner override that the device manufacturer would wish to extend. The same
+files accessed during build time to construct filesystem images as <code>${OUT}/system/etc/fs_config_dirs</code> and <code>${OUT}/system/etc/fs_config_files</code> may be used on the host.</p>
+
+<p><strong>Caution</strong>: This change is disruptive, as it removes some includes, structures and inline
+definitions; it also adds a need to refer to <code>libcutils</code> instead of running directly from <code>system/core/include/private/android_filesystem_config.h</code>. It also requires all device manufacturers to be informed that the location
+for adjustments for file system configuration has changed.</p>
+
+<p>There is also a tool to generate the aligned binary files <code>/system/etc/fs_config_dirs</code> and <code>/system/etc/fs_config_files</code> content that is delivered on the target.</p>
+
+<p>A new function in <code>libcutils</code> - <code>fs_config_generate()</code> - is used to manage the DAC requirements into a buffer. <code>build/tools/fs_config</code> in turn houses the new tool <code>fs_config_generate</code> that uses this library function and defines rules for an include file to
+institutionalize the DAC rules. It expects an include file in <code>device/<vendor>/<device>/android_filesystem_config.h</code> to act as the override in <code>structure fs_path_config</code> format as defined in <code>system/core/include/private/android_filesystem_config.h</code>, except defining the structure initialization for the symbols struct
+fs_path_config android<strong>_device</strong>_dirs[] and struct fs_path_config android<strong>_device</strong>_files[] for directories and files, respectively. See the example below.</p>
+
+<p>The override file may also be specified using <code>TARGET_ANDROID_FILESYSTEM_CONFIG_H </code>in the board configuration, with an enforced basename of <code>android_filesystem_config.h</code>. Finally, <code>PRODUCT_PACKAGES</code> must include <code>fs_config_dirs</code> and/or <code>fs_config_files</code> in order to install them to <code>/system/etc/fs_config_dirs</code> and <code>/system/etc/fs_config_files</code>, respectively.</p>
+
+<h3 id=instructions>Instructions</h3>
+
+<p>Follow these steps to configure the Android file system in the M release and
+later.</p>
+
+<ol>
+  <li> Create the <code>$(TARGET_DEVICE_DIR)/android_filesystem_config.h</code> file
+  <li> Add the <code>fs_config_dirs</code> and/or <code>fs_config_files</code> to <code>PRODUCT_PACKAGES </code>in the board configuration file (eg: <code>$(TARGET_DEVICE_DIR)/device.mk</code>)
+</ol>
+
+<h3 id=example>Example</h3>
+
+<p>In order to activate an override for the<code> system/bin/glgps</code> daemon to add wake lock support, one would do something like this within the <code>device/<vendor>/<device></code> directory (in patch format, relevant actions are highlighted for clarity):</p>
+
+<pre>
+diff --git a/android_filesystem_config.h b/android_filesystem_config.h
+new file mode 100644
+index 0000000..874195f
+--- /dev/null
++++ b/android_filesystem_config.h
+@@ -0,0 +1,36 @@
++/*
++ * Copyright (C) 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.
++ */
++
++/* This file is used to define the properties of the filesystem
++** images generated by build tools (eg: mkbootfs) and
++** by the device side of adb.
++*/
++
++#define NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS
++/* static const struct fs_path_config android_device_dirs[] = { }; */
++
++/* Rules for files.
++** These rules are applied based on "first match", so they
++** should start with the most specific path and work their
++** way up to the root. Prefixes ending in * denotes wildcard
++** and will allow partial matches.
++*/
++static const struct fs_path_config android_device_files[] = {
++  { 00755, AID_ROOT, AID_SHELL, (1ULL &lt;&lt; CAP_BLOCK_SUSPEND),
+"system/bin/glgps" },
++#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS
++  { 00000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_dirs" },
++#endif
++};
+
+
+diff --git a/device.mk b/device.mk
+index 0c71d21..235c1a7 100644
+--- a/device.mk
++++ b/device.mk
+@@ -18,7 +18,8 @@ PRODUCT_PACKAGES := \
+     libwpa_client \
+     hostapd \
+     wpa_supplicant \
+-    wpa_supplicant.conf
++    wpa_supplicant.conf \
++    fs_config_files
+ 
+ ifeq ($(TARGET_PREBUILT_KERNEL),)
+ ifeq ($(USE_SVELTE_KERNEL), true)
+</pre>
+
+<h3 id=checklist>Checklist</h3>
+
+<ol>
+  <li> <code>NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS</code> and <code>NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_FILES</code> are available to be defined when android_device_dirs[] and
+android_device_files[] is not being filled out.
+
+  <li> Each structure entry is the mode, uid, gid, capabilities and the name. <code>system/core/include/private/android_filesystem_config.h</code> has been included already automatically to provide the manifest defines (<code>AID_ROOT</code>, <code>AID_SHELL</code>, <code>CAP_BLOCK_SUSPEND</code> in the above).
+
+  <li> The action above in the example android_device_files[] to suppress access to <code>system/etc/fs_config_dirs</code> when we have not specified it will act as an additional DAC protection for our
+lack of any content for the directory overrides. It is considered pedantic weak
+protection since if someone has control over<code> /system</code>, they can typically do anything they want.
+
+  <li> The build system searches for the custom <code>android_filesystem_config.h</code> in <code>$(TARGET_DEVICE_DIR)</code>, in which the BoardConfig.mk exists. You can also set board config variable <code>TARGET_ANDROID_FILESYSTEM_CONFIG_H</code> to point to the file, if it exists elsewhere.
+
+  <li> On the target system, we reserve the right to apply SELinux Mandatory Access
+Controls (MAC) to these configuration files. Please check if you have custom
+target executables that utilize fs_config() to make sure you permit access if
+not provided otherwise.
+</ol>
+
+<h3 id=architectural_concerns>Architectural Concerns</h3>
+
+<ul>
+  <li> Device manufacturer private branch copies of the <code>system/core/include/private/android_filesystem_config.h</code> with extra content on existing targets will have to move over to: <code>device/<vendor>/<device>/android_filesystem_config.h</code>
+  <li> Device manufacturer private executables that depend on <code>system/code/include/private_filesystem_config.h</code> for the file or directory structures or <code>fs_config</code> will have to add <code>libcutils</code> library dependencies.
diff --git a/src/devices/tech/security/selinux/implement.jd b/src/devices/tech/security/selinux/implement.jd
index aa89303..0655e1d 100644
--- a/src/devices/tech/security/selinux/implement.jd
+++ b/src/devices/tech/security/selinux/implement.jd
@@ -140,6 +140,11 @@
         sepolicy.te
 </pre>
 
+<p class="note"><strong>Note:</strong> As of the M release,
+BOARD_SEPOLICY_UNION is no longer required as all policy files found within any
+directory included in the BOARD_SEPOLICY_DIRS variable are joined with the
+base policy automatically.</p>
+
 <p>After rebuilding your device, it is enabled with SELinux. You can now either
 customize your SELinux policies to accommodate your own additions to the
 Android operating system as described in <a
diff --git a/src/source/initializing.jd b/src/source/initializing.jd
index 7d9e000..1358081 100644
--- a/src/source/initializing.jd
+++ b/src/source/initializing.jd
@@ -201,7 +201,7 @@
 <p>You can also create it from a shell with the following command:</p>
 <pre><code># hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
 </code></pre>
-<p>This will create a <code>.dmg</code> (or possibly a <code>.dmg.sparsefile</code>) file which, once mounted, acts as a drive with the required formatting for Android development. 
+<p>This will create a <code>.dmg</code> (or possibly a <code>.dmg.sparseimage</code>) file which, once mounted, acts as a drive with the required formatting for Android development.
 <p>If you need a larger volume later, you can also resize the sparse image with the following command:</p>
 <pre><code># hdiutil resize -size &lt;new-size-you-want&gt;g ~/android.dmg.sparseimage
 </code></pre>
@@ -212,7 +212,7 @@
 <pre><code># mount the android file image
 function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }
 </code></pre>
-<p class="note"><strong>Note:</strong> If your system created a <code>.dmg.sparsefile</code> file, replace <code>~/android.dmg</code> with <code>~/android.dmg.sparsefile</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>