docs: Fixing broken links and bad paths.
Bug: 9192223

Change-Id: Iee1dadd0a2b38a48ac0ebcbc78f87d6087e01bb1
diff --git a/src/compatibility/contact-us.jd b/src/compatibility/contact-us.jd
index 72999e6..b9e969f 100644
--- a/src/compatibility/contact-us.jd
+++ b/src/compatibility/contact-us.jd
@@ -21,11 +21,11 @@
 <p>If you have questions about Android compatibility that aren't covered in
 this site, you can reach us in one of a few different ways. To get the most
 out of any of these options, please first read "Getting the Most from Our
-Lists" on the <a href="{/community/index.html">Community page</a></p>
+Lists" on the <a href="{@docRoot}community/index.html">Community page</a></p>
 <h2 id="for-android-compatibility-definition-and-compatibility-test-suite-technical-questions">For Android Compatibility Definition and Compatibility Test Suite Technical Questions</h2>
 <p>If you have questions about Android compatibility that aren't covered in this site, you can reach
 us in one of a few different ways. To get the most out of any of these options, please first read "Getting the Most from Our
-Lists" on the <a href="/community/index.html">Community page</a>. If you have specific issues with the Compatibility Test Suite or the Compatibility Definition
+Lists" on the <a href="{@docRoot}community/index.html">Community page</a>. If you have specific issues with the Compatibility Test Suite or the Compatibility Definition
 <a href="https://groups.google.com/forum/?fromgroups#!forum/android-compatibility">android-compatibility list.</a> is the discussion forum for you.</p>
 <ul>
 <li>Subscribe using Google Groups: <a href="https://groups.google.com/forum/?fromgroups#!forum/android-compatibility">android-compatibility</a></li>
@@ -37,4 +37,4 @@
 <p>Finally, business inquiries about the compatibility program, including
 requests to use branding elements and so on, can be sent to the address <a href="mailto:android-partnerships@google.com">android-partnerships@google.com</a>. Like
 the CTS address, this address is for specific, private inquiries; general
-questions will be directed back to the android-compatibility list.</p>
\ No newline at end of file
+questions will be directed back to the android-compatibility list.</p>
diff --git a/src/compatibility/cts-development.jd b/src/compatibility/cts-development.jd
index bacbd9c..a7c5491 100644
--- a/src/compatibility/cts-development.jd
+++ b/src/compatibility/cts-development.jd
@@ -18,12 +18,12 @@
 -->
 
 <h2 id="initializing-your-repo-client">Initializing Your Repo Client</h2>
-<p>Follow the <a href="/source/downloading.html">instructions</a>
+<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.2_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="/source/using-eclipse.html">instructions</a>
+<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>
@@ -104,6 +104,6 @@
 <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="/source/submit-patches.html">Android Contributors' Workflow</a>
+<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
index 3db4b36..83f9f5f 100644
--- a/src/compatibility/cts-intro.jd
+++ b/src/compatibility/cts-intro.jd
@@ -19,7 +19,7 @@
 
 <h2 id="how-does-the-cts-work">How does the CTS work?</h2>
 <div style="float: right">
-    <img src="/images/cts-0.png">
+    <img src="{@docRoot}images/cts-0.png">
 </div>
 
 <p>The CTS is an automated testing harness that includes two major software components:</p>
diff --git a/src/compatibility/index.jd b/src/compatibility/index.jd
index d081d3c..13ee12e 100644
--- a/src/compatibility/index.jd
+++ b/src/compatibility/index.jd
@@ -49,7 +49,7 @@
 <ol>
 <li>
 <p><em>Obtain the Android software source code</em>.
-    This is <a href="/source/index.html">the source code for the Android platform</a>, that you port to your hardware.</p>
+    This is <a href="{@docRoot}source/index.html">the source code for the Android platform</a>, that you port to your hardware.</p>
 </li>
 <li>
 <p><em>Comply with Android Compatibility Definition Document (CDD)</em>.
@@ -66,4 +66,4 @@
 Play to provide your users access to the third-party app ecosystem.
 Unfortunately, for a variety of legal and business reasons, we aren't able to
 automatically license Google Play to all compatible devices. To inquire
-about access about Google Play, you can <a href="contact-us.html">contact us</a>.</p>
\ No newline at end of file
+about access about Google Play, you can <a href="contact-us.html">contact us</a>.</p>
diff --git a/src/devices/tech/dalvik/dalvik-bytecode.jd b/src/devices/tech/dalvik/dalvik-bytecode.jd
index 7883850..959cfbd 100644
--- a/src/devices/tech/dalvik/dalvik-bytecode.jd
+++ b/src/devices/tech/dalvik/dalvik-bytecode.jd
@@ -989,7 +989,7 @@
 </tbody>
 </table>
 
-<h2><code>packed-switch-payload</code> Format</h2>
+<h2>packed-switch-payload Format</h2>
 
 <table class="supplement">
 <thead>
@@ -1028,7 +1028,7 @@
 <p><b>Note:</b> The total number of code units for an instance of this
 table is <code>(size * 2) + 4</code>.</p>
 
-<h2><code>sparse-switch-payload</code> Format</h2>
+<h2>sparse-switch-payload Format</h2>
 
 <table class="supplement">
 <thead>
@@ -1068,7 +1068,7 @@
 <p><b>Note:</b> The total number of code units for an instance of this
 table is <code>(size * 4) + 2</code>.</p>
 
-<h2><code>fill-array-data-payload</code> Format</h2>
+<h2>fill-array-data-payload Format</h2>
 
 <table class="supplement">
 <thead>
@@ -1551,4 +1551,4 @@
   </td>
 </tr>
 </tbody>
-</table>
\ No newline at end of file
+</table>
diff --git a/src/license.jd b/src/license.jd
new file mode 100644
index 0000000..eb278a0
--- /dev/null
+++ b/src/license.jd
@@ -0,0 +1,145 @@
+page.title=Content License
+fullpage=1
+@jd:body
+
+<div class="wrap" style="width:940px;">
+  <h1>Content License</h1>
+<p>For the purposes of licensing, the content of this web site is divided
+into two categories:</p>
+<ul>
+  <li>Documentation content, including both static documentation and content extracted from source
+  code modules, as well as sample code, and </li>
+<li>All other site content</li>
+</ul>
+
+<p>The documentation content on this site is made available to
+you as part of the <a href="http://source.android.com">Android Open
+Source Project</a>. This documentation, including any code shown in it,
+is licensed under the <a
+href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0
+license</a>, the preferred license for all parts of the of the Android
+Open Source Project.</p>
+
+<p>Apache 2.0 is a commercial and open-source-friendly software
+license. The majority of the Android platform and documentation is
+licensed under the Apache 2.0 license. While the project strives to
+adhere to the preferred license, there may be exceptions, such as for
+documentation (code comments) extracted from a source code module that
+is licensed under GPLv2 or other license. In those cases, the license
+covering the source code module will apply to the documentation
+extracted from it. </p>
+
+<p>Third-party components of this site such as JavaScript libraries are included in the Android
+Open Source Project under the licenses specified by their authors. For information about these
+licenses, refer to the source files in the Android Open Source Project.</p>
+
+<p>All other content on this site, except the license documents themselves
+and as otherwise noted, is licensed under the <a
+href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
+Attribution 2.5</a> license. </p>
+
+<p>You may use the content of this site in any way that is consistent
+with the specific license that applies to the content, as described
+above. For content licensed under Creative Commons Attribution 2.5, we
+ask that you give proper <a href="#attribution">attribution</a>. </p>
+
+
+<h2 id="terms">Terms of Use</h2>
+
+<p>We are pleased to license the Android documentation and sample code under
+terms that encourage you to take, modify, reuse, re-purpose, and remix the
+content as you see fit. Except as noted in the <a href="#restrictions">Restrictions</a> section
+below, you
+are free to use the documentation content in your own creations. For example,
+you could quote the text in a book, cut-and-paste sections to your blog, record
+it as an audiobook for the visually impaired, or even translate it. </p>
+
+
+<h2 id="restrictions">Restrictions</h2>
+
+<ul>
+<li>While the documentation itself is available to you under the Apache 2.0
+license, note that proprietary trademarks and brand features are not
+included in that license.</li>
+
+<li>Google's trademarks and other brand features (including the
+<img src="http://developer.android.com/images/android-logo.png" alt="Android"
+style="margin:0;padding:0 2px;vertical-align:baseline" /> stylized typeface logo) are not included
+in the license.
+Please see <a
+href="http://developer.android.com/distribute/googleplay/promote/brand.html">Brand Guidelines</a> for
+information about this usage. </li>
+
+<li>In some cases, a page may include content, such as an image, that is not
+covered by the license. In that case, we will label the content that is not licensed. </li>
+
+<li>In addition, content linked from a page on this site is not covered
+by the license unless specifically noted. For example, pages may link to videos or
+slide decks that are not covered.</li>
+
+<li>The use of sample source code provided in the SDK or shown in this
+documentation is subject to the conditions detailed in the <a
+href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 license</a>.</li>
+</ul>
+
+<h2 id="attribution">Attribution</h2>
+<p>
+Proper attribution is required when you reuse or create modified
+versions of content that appears on a page made available under the
+terms of the Creative Commons Attribution license. On this site, the
+requirement for attribution applies only to the non-documentation
+content, as described earlier in this document. The complete
+requirements for attribution can be found in section 4b of the
+<a href="http://creativecommons.org/licenses/by/2.5/legalcode">
+Creative Commons legal code</a>.
+</p>
+<p>
+ In practice we ask that you provide attribution to the Android Open
+ Source project to the best of the ability of the medium in which you
+ are producing the work. There are several typical ways in which this
+ might apply:
+</p>
+<h3>Exact Reproductions</h3>
+<p>
+ If your online work <em>exactly reproduces</em> text or images from this
+ site, in whole or in part, please include a paragraph at the bottom
+ of your page that reads:
+</p>
+<p style="margin-left:20px;font-style:italic">
+ Portions of this page are reproduced from work created and <a
+ href="http://code.google.com/policies.html">shared by the Android Open Source Project</a>
+ and used according to terms described in the <a
+ href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
+ 2.5 Attribution License</a>.
+
+</p>
+<p>
+ Also, please link back to the original source page so that readers can
+ refer there for more information.
+</p>
+<h3>Modified Versions</h3>
+<p>
+ If your online work shows <em>modified</em> text or images based on
+ the content from this site, please include a paragraph at the bottom of
+ your page that reads:
+</p>
+<p style="margin-left:20px;font-style:italic">
+ Portions of this page are modifications based on work created and <a
+ href="http://code.google.com/policies.html">shared by the Android Open
+ Source Project</a> and used according to terms described in the <a
+ href="http://creativecommons.org/licenses/by/2.5/">Creative Commons
+ 2.5 Attribution License</a>.
+</p>
+<p>
+ Again, please link back to the original source page so that readers can
+ refer there for more information. This is even more important when
+ the content has been modified.
+</p>
+<h3>Other Media</h3>
+<p>
+ If you produce non-hypertext works, such as books, audio, or
+ video, we ask that you make a best effort to include a spoken or
+ written attribution in the spirit of the messages above.
+</p>
+
+</div>
diff --git a/src/source/community/index.jd b/src/source/community/index.jd
index 0af20a6..22aa73c 100644
--- a/src/source/community/index.jd
+++ b/src/source/community/index.jd
@@ -92,7 +92,7 @@
 </li>
 <li>
 <p><em>Give plenty of details in your post.</em> Code or log snippets, pointers to screenshots, and similar details will get better results and make for better discussions. For a great guide to phrasing your questions, read <a href="http://www.catb.org/%7Eesr/faqs/smart-questions.html">How to Ask Questions the Smart Way</a>.
-<img src="/images/external-link.png"></p>
+<img src="{@docRoot}images/external-link.png"></p>
 </li>
 </ul>
 
diff --git a/src/source/contributing.jd b/src/source/contributing.jd
index 377c449..dd1ded9 100644
--- a/src/source/contributing.jd
+++ b/src/source/contributing.jd
@@ -18,7 +18,7 @@
 -->
 <p>Thanks for your interest in Android! Here are some ways you can get involved
 and help us improve Android. For background on the Android project and our
-goals, check out the <a href="/source/index.html">Overview</a> page.</p>
+goals, check out the <a href="{@docRoot}source/index.html">Overview</a> page.</p>
 <h2 id="report-bugs">Report Bugs</h2>
 
 <p>One of the easiest and most effective ways you can help improve Android is
@@ -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>
\ No newline at end of file
+If you need help along the way, you can join our <a href="/source/index.html">discussion groups</a>.</p>
diff --git a/src/source/developing.jd b/src/source/developing.jd
index d8bfb05..6fe7b73 100644
--- a/src/source/developing.jd
+++ b/src/source/developing.jd
@@ -73,7 +73,7 @@
 </code></pre>
 <h2 id="creating-topic-branches">Creating topic branches</h2>
 <p>Start a topic branch in your local work environment whenever you begin a change, for example when you begin work on a bug or new feature. A topic branch is not a copy of the original files; it is a pointer to a particular commit. This makes creating local branches and switching among them a light-weight operation. By using branches, you can isolate one aspect of your work from the others. For an interesting article about using topic branches, see <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/separating-topic-branches.txt">Separating topic branches</a>.
-<img src="/images/external-link.png" alt=""></p>
+<img src="{@docRoot}images/external-link.png" alt=""></p>
 <p>To start a topic branch using Repo: </p>
 <pre><code>$ repo start BRANCH_NAME
 </code></pre>
@@ -156,4 +156,4 @@
 </code></pre>
 <p>Deleting a client will <em>permanently delete</em> any changes you have not yet uploaded for review.</p>
 <h2 id="git-and-repo-cheatsheet">Git and Repo cheatsheet</h2>
-<p><img src="/images/git-repo-1.png" alt="list of basic git and repo commands"></p>
+<p><img src="{@docRoot}images/git-repo-1.png" alt="list of basic git and repo commands"></p>
diff --git a/src/source/faqs.jd b/src/source/faqs.jd
index e56669c..7c1e5d4 100644
--- a/src/source/faqs.jd
+++ b/src/source/faqs.jd
@@ -93,7 +93,7 @@
 <p>Finally, Google works on the next version of the Android platform in tandem
 with developing a flagship device. This branch pulls in changes from the
 experimental and stable branches as appropriate.</p>
-<p>You can find more information on this topic at our <a href="source/code-lines.html">Branches and Releases</a>.</p>
+<p>You can find more information on this topic at our <a href="{@docRoot}source/code-lines.html">Branches and Releases</a>.</p>
 <h3 id="why-are-parts-of-android-developed-in-private">Why are parts of Android developed in private?</h3>
 <p>It typically takes over a year to bring a device to market, but of course
 device manufacturers want to ship the latest software they can. Developers,
diff --git a/src/source/life-of-a-patch.jd b/src/source/life-of-a-patch.jd
index a6fee4b..5e316a0 100644
--- a/src/source/life-of-a-patch.jd
+++ b/src/source/life-of-a-patch.jd
@@ -23,4 +23,4 @@
 the steps below are performed in the web application.</p>
 <p>For full instructions on how to get set up to use gerrit and git, please
 see the <a href="submit-patches.html">Submitting Patches</a> page.</p>
-<p><img src="/images/workflow-0.png" alt="workflow diagram"/></p>
\ No newline at end of file
+<p><img src="{@docRoot}images/workflow-0.png" alt="workflow diagram"/></p>
diff --git a/src/source/roles.jd b/src/source/roles.jd
index 9c93efc..7f2258b 100644
--- a/src/source/roles.jd
+++ b/src/source/roles.jd
@@ -31,7 +31,7 @@
 <p>Anyone who is interested in exploring and contributing to Android can use the
 Android Open Source Project resources. Anyone can join the mailing lists, ask
 questions, contribute patches, report bugs, look at submitted patches, and use
-the tools. To get started with the Android code, see <a href="/source/contributing.html">Contributing</a>.</p>
+the tools. To get started with the Android code, see <a href="{@docRoot}source/contributing.html">Contributing</a>.</p>
 <h2 id="contributor">Contributor</h2>
 <p>A "Contributor" is anyone making contributions to the AOSP source code,
 including both employees of Google or other companies, as well as external