blob: 3c43041cafcee4de4be5cc60a0d34ad283fbcae7 [file] [log] [blame]
Robert Ly35f2fda2013-01-29 16:27:05 -08001page.title=Overview
2@jd:body
3
4<!--
5 Copyright 2010 The Android Open Source Project
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18-->
19<div id="qv-wrapper">
20 <div id="qv">
21 <h2>In this document</h2>
22 <ol id="auto-toc">
23 </ol>
24 </div>
25</div>
26
27
28<p>Welcome to the Android Platform Development Kit (PDK) Guide! The Android PDK allows partners to port
29 their drivers as well as develop, optimize, and test against an upcoming Android platform release.
30 The Android PDK includes a set of interfaces for the Android hardware abstraction layer (HAL),
31 platform sources for integration, a binary system image, and HAL and integration documentation.
32 In addition, the PDK also ships with the Android Compatibility Test Suite (CTS).
33</p>
34
35<h2 id="arch">Android Low-Level System Architecture</h2>
36<p>Before you begin porting Android to your hardware, it is important to have an
37understanding of how Android works at a high level. Because your drivers and HAL code interact
38with many layers of Android code, this understanding can help you find
39your way through the many layers of code that are available to you through the AOSP
40(Android Open Source Project) source tree as well as the PDK.
41The following diagram shows a system level view of how Android works:
42</p>
43
44<img src="images/system-architecture.png">
45
46<p class="img-caption"><strong>Figure 1.</strong> Android System Architecture</p>
47
48 <h4>Application framework</h4>
49 <p>This is the level that most application developers concern themselves with. You should be
50 aware of the APIs available to developers as many of them map 1:1 to the underlying HAL
51 interfaces and can provide information as to how to implement your driver.
52 </p>
53
54 <h4>Binder IPC</h4>
55 <p>
56 The Binder Inter-Process Communication mechanism allows the application framework to
57 cross process boundaries and call into the Android system services code. This basically allows
58 high level framework APIs to interact with Android's system services. At the application framework level, all
59 of this communication is hidden from the developer and things appear to "just work."
60 </p>
61
62 <h4>System services</h4>
63 <p>Most of the functionality exposed through the application framework APIs must
64 communicate with some sort of system service to access the underlying hardware. Services
65 are divided into modular components with focused functionality
66 such as the Window Manager, Search Service, or Notification Manager. System services are grouped
67 into two buckets: system and media. The system services include things such as the Window or
68 Notification Manager. The media services include all the services involved in playing and
69 recording media.
70 </p>
71
72<h4>Hardware abstraction layer (HAL)</h4>
73<p>The HAL serves as a standard interface that allows the Android system to call into the device
74 driver layer while being agnostic about the lower-level implementations of your drivers and hardware.
75 You must implement the corresponding HAL (and driver) for the particular piece of hardware that your product
76 provides. Android does not mandate a standard interaction between your HAL implementation and your device drivers, so
77 you have free reign to do what is best for your situation. However, you must abide by the contract
78 defined in each hardware-specific HAL interface for the Android system to be able
79 to correctly interact with your hardware. HAL implementations are typically built into
80 shared library modules (<code>.so</code> files).
81</p>
82<h4>Linux Kernel</h4>
83<p>For the most part, developing your device drivers is the same as developing a typical Linux device driver.
84 Android uses a specialized version of the Linux kernel with a few special additions such as
85 wakelocks, a memory management system that is more agressive in preserving memory,
86 the Binder IPC driver, and other features that are important for a mobile embedded platform like Android.
87 These additions have less to do with driver development than with the system's functionality. The PDK
88 does not provide kernel sources, so you must provide your own. You can use any version of the kernel that
89 you want as long as it supports the required features, such as the binder driver. However, we recommend
90 using the latest version of the Android kernel. For the latest Android kernel, see
91 <a href="http://source.android.com/source/building-kernels.html" >Building Kernels</a>.
92</p>
93
94
95<h2 id="pdk">PDK Components</h2>
96<p>Now that you have a high-level overview of the Android system, we'll go over the PDK and what it provides
97 to port Android to your product. The PDK provides source files needed to implement
98 your product and a platform binary that lets you build a runnable system image. You can then install
99 this barebones image to test your product with the latest builds of Android. The most important source files
100 included in the PDK are located in the:</p>
101
102 <ul>
103 <li><code>frameworks/native</code> directory</li>
104 <li><code>frameworks/av</code> directory for media, camera, DRM, and the audio framework stack</code></li>
105 <li><code>hardware/libhardware/include/hardware</code> directory for the HAL interfaces </li>
106 <li><code>vendor/pdk/data/cts</code> directory for the CTS binaries</li>
107 </ul>
108</p>
109<p>In addition, the Android PDK includes the following source directories:</p>
110<ul>
111 <li>abi</li>
112 <li>bionic</li>
113 <li>bootable</li>
114 <li>build</li>
115 <li>device</li>
116 <li>external (Chromium and Webkit are not included)</li>
117 <li>hardware</li>
118 <li>libnativehelper</li>
119 <li>pdk</li>
120 <li>prebuilt</li>
121 <li>prebuilts</li>
122 <li>system</li>
123</ul>
124
125 <p>The PDK also contains documentation that is split into three different sections:</p>
126 <ul>
127 <li><a href="{@docRoot}guide/getting_started.html">Getting Started</a> - Explains how to download the PDK source, how the Android build system works, and how to configure a build for your specific product.</li>
128 <li><a href="{@docRoot}guide/hal.html">The Hardware Abstraction Layer</a> - Explains the various HALs provided by Android and the interfaces (C header files) that define them. </li>
129 <li><a href="{@docRoot}guide/reference/files.html">HAL reference</a> - A quick reference for the various HAL interfaces.</li>
130 </ul>
131
132<h3 id="cts">Compatibility Test Suite</h3>
133<p>CTS binaries for ARM, MIPS, and x86 are provided in the corresponding directories in <code>vendor/pdk/data/cts</code>. Only the ARM
134 variant is Google-verified as there is no Nexus device running on any other architecture. Not all of the CTS tests since the
135 complete Android platform is not present. The following CTS tests should work:</p>
136
137<ul>
138 <li>android.bluetooth</li>
139 <li>android.graphics</li>
140 <li>android.graphics2</li>
141 <li>android.hardware</li>
142 <li>android.location</li>
143 <li>android.opengl</li>
144 <li>android.openglperf</li>
145 <li>android.media</li>
146 <li>android.mediastress</li>
147 <li>android.nativemedia.sl</li>
148 <li>android.nativemedia.xa</li>
149 <li>android.net</li>
150 <li>android.renderscript</li>
151 </ul>
152 <p>You can run individual packages such as <code>android.media</code> with:</p>
153 <pre>cts-tradefed run singleCommand cts --skip-device-info --package android.media</pre>
154</ul>
155
156 <p>Because the PDK is missing many components compared to a full Android source tree,
157 there is a PDK test plan that is provided with CTS that limits the tests that are ran when using the PDK. You can run
158 this special test plan with the following command:</p>
159
160 <pre>run cts --plan PDK</pre>
161
162<p>CTS is always actively under development, so we expect some tests to fail. CTS results
163 for the Galaxy Nexus are provided for you in the
164 the <code>vendor/pdk/data/cts/</code> directory and will show which tests fail on that
165 device. You can safely ignore the failed tests for your devices as well.</p>
166
167 <p>See the <a href="http://source.android.com/compatibility/cts-intro.html">CTS manual</a> for more information on CTS.</p>
168
169<h2 id="inc-ex">PDK Inclusions and Exclusions</h2>
170<p>The PDK is a subset of the complete Android source tree and might be missing things that you might need. Here is a list of what the PDK supports
171 and does not support:</p>
172<ul>
173 <li>Supports building Android apps using the publicly available, standard SDK. Builds with non-public platform APIs are not supported. The JNI build is supported.</li>
174 <li>Supports only <code>en_US</code> locale.</li>
175 <li>Supports only phone layouts. Tablet layouts are not included.</li>
176 <li>Enables support for software navigation buttons by default, which you can disable by setting <code>qemu.jw.mainkeys=1</code>.</li>
177 <li>Builds all binaries with SMP (symmetric multiprocessing) features enabled. This might have a small performance impact on non-SMP CPUs.</li>
178 <li>Includes a minimal amount of Java libraries. Obtain any additional Java libraries from the publicly released Android source tree.</li>
179 <li>Contains a minimum number of applications. Build and install necessary applications as needed.</li>
180 <li>Does not support media streaming.</li>
181 <li>Does not include non-Latin fonts. (set by <code>MINIMAL_FONT_FOOTPRINT</code> variable in <code>BoardConfig.mk</code>).
182 An app might crash if it requires such fonts. </li>
183 <li>Does not support replacing framework resources by using the overlay mechanism.
184 This means all configurations controlled by framework resources are fixed.</li>
185 <li>Does not support NFC</li>
186 <li>Does not support DRM</li>
187</ul>
188
189<h2 id="knownissues">Support and Known Issues</h2>
190<p>
191For questions or to report issues related with the PDK, send a message to the <a href="https://groups.google.com/a/google.com/forum/?fromgroups#!forum/android-pdk-feedback">android-pdk@google.com</a> mailing list.</p>
192
193<p>The following list describes the known issues with the PDK:</p>
194<ul>
195 <li>After running the CTS (Compatibility Test Suite), <code>android.process.acore</code> crashes. This is caused by
196some missing components in PDK and does not affect the operation of CTS tests.</li>
197</p>