From 5c40a48e4b0dee143515e5ac3562efdfd7f24903 Mon Sep 17 00:00:00 2001
From: David Warren AudioHardwareInterface serves as the glue between proprietary audio drivers and the Android AudioFlinger service, the core audio service that handles all audio-related requests from applications. To implement an audio driver, create a shared library that implements the interface defined in The following stub Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 + EDR host stack. BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points: The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the For example, for MSM7201A, this is The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0. To compile Android with Bluetooth support enabled, add the following line to Debugging To debug your bluetooth implementation, start by reading the logs ( hciconfig -a and hcitool If you compile your own system.img for Android, and BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including: This section provides a change history of Bluetooth features added in each Android release and provides some rough guidance as to future features. The Android Build Cookbook offers code snippets to help you quickly implement some common build tasks. For additional instruction, please see the other build documents in this section. These are the variables that you'll commonly see in Android.mk files, listed
alphabetically. First, a note on the variable naming: The directions below describe how to configure make files for new mobile devices and products. You should find new build binaries located in The file tree below illustrates what your own system should look like after completing the steps above.
@@ -127,7 +134,7 @@ pdk.version=1.0
Product-specific variables are defined in product definition files. A product definition file can inherit from other product definition files, thus reducing the need to copy and simplifying maintenance. Variables maintained in a product definition files include:
When building for a particular product, it's often useful to have minor
diff --git a/pdk/docs/guide/build_system.jd b/pdk/docs/guide/build_system.jd
index 36936aa54..64216d8cb 100755
--- a/pdk/docs/guide/build_system.jd
+++ b/pdk/docs/guide/build_system.jd
@@ -3,34 +3,26 @@ pdk.version=1.0
@jd:body
+ Android uses a custom build system to generate tools, binaries, and documentation. This document provides an overview of Android's build system and instructions for doing a simple build. Android's build system is make based and requires a recent version of GNU Make (note that Android uses advanced features of GNU Make that may not yet appear on the GNU Make web site). Before continuing, check your version of make by running A makefile defines how to build a particular application. Makefiles typically include all of the following elements: The snippet above includes artificial line breaks to maintain a print-friendly document. The build hierarchy includes the abstraction layers described in the table below. This section describes how to build the default version of Android. Once you are comfortable with a generic build, then you can begin to modify Android for your own target device. To do a generic build of android, source Execute The binaries of each combo are stored as distinct sub-directories of However, performing a clean rebuild is necessary if the build system doesn't catch changes to environment variables or makefiles. If this happens often, you should define the The following error is likely caused by running an outdated version of Java. If you do have Java 1.5 or later and your receive this error, verify that you have properly updated your This section describes how to build Android's default kernel. Once you are comfortable with a generic build, then you can begin to modify Android drivers for your own target device. Then switch to the kernel directory The default branch is always To simplify code management, give your local branch the same name as the remote branch it is tracking (as illustrated in the snippet above). Switch between branches by executing Find out which branches exist (both locally and remotely) and which one is active (marked with an asterisk) by executing the following: To only see local branches, omit the To build the kernel, execute: Android's camera subsystem connects the camera application to the application framework and user space libraries, which in turn communicate with the camera hardware layer that operates the physical camera. The diagram below illustrates the structure of the camera subsystem. To implement a camera driver, create a shared library that implements the interface defined in The following stub The following diagram illustrates the sequence of function calls and actions necessary for your camera to preview. The following diagram illustrates the sequence of function calls and actions necessary for your camera to take a picture.
The Dalvik virtual machine is intended to run on a variety of platforms.
The baseline system is expected to be a variant of UNIX (Linux, BSD, Mac
@@ -23,7 +26,7 @@ operating system. This document covers the former.
The native code in the core libraries (chiefly
Most of the Dalvik VM runtime is written in portable C. The one
@@ -82,7 +85,7 @@ method signature for things like the return value, total argument size,
or inter-argument 64-bit alignment restrictions.
The Dalvik runtime includes two interpreters, labeled "portable" and "fast".
diff --git a/pdk/docs/guide/debugging_gdb.jd b/pdk/docs/guide/debugging_gdb.jd
index fe633071f..9717cf384 100755
--- a/pdk/docs/guide/debugging_gdb.jd
+++ b/pdk/docs/guide/debugging_gdb.jd
@@ -2,21 +2,23 @@ page.title=Debugging with GDB
pdk.version=1.0
@jd:body
+ The current version of The current version of Android runs To capture log output:
In this scenario, the GTalk app crashed but did not actually exit or seems stuck. Check the debug logs to see if there is anything unusual: If it crashes, connect with This section describes how the display driver functions and offers a functional template designed to help you build your own device-specific driver. Android relies on the standard frame buffer device ( In Android, every window gets implemented with an underlying Surface object, an object that gets placed on the framebuffer by SurfaceFlinger, the system-wide screen composer. Each Surface is double-buffered. The back buffer is where drawing takes place and the front buffer is used for composition. When To maintain adequate performance, framebuffer memory should be cacheable. If you use write-back, flush the cache before the frame buffer is written from DMA to the LCD. If that isn't possible, you may use write-through. As a last resort, you can also use uncached memory with the write-bugger enabled, but performance will suffer. The following sample driver offers a functional example to help you build your own display driver. Modify Both of the following problems have a similar cause: Android defines a user space C abstraction interface for GPS hardware. The interface header is defined in To implement a GPS driver, create a shared library that implements the interface defined in Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here. This document describes how to use the Instrumentation Framework to write test cases. Instrumentation testing allows you to verify a particular feature or behavior with an automated JUnit TestCase. You can launch activities and providers within an application, send key events, and make assertions about various UI elements. You should have a working knowledge of the following: Each Android application runs in its own process. Instrumentation kills the application process and restarts the process with Instrumentation. Instrumentation gives a handle to the application context used to poke around the application to validate test assertions, allowing you to write test cases to test applications at a much lower level than UI screen shot tests. Note that Instrumentation cannot catch UI bugs. The following classes help glue together The am command is a command-line interface to the ActivityManager (see http://code.google.com/android/reference/android/app/ActivityManager.html for details). This section provides an overview for various unit and functional test cases that can be executed through the instrumentation framework. Framework test cases test the Android application framework or specific Android application functionality that requires an Android runtime context. These tests can be found in Core library test cases test the Android library functionality that does not require an Android runtime context. These tests are split into Android library (android.* package space) tests at Each instrumentation test case is similar to an Android application with the distinction that it starts another application. For example, have a look in the If no class or package is passed in to run, InstrumentationTestRunner will automatically find and run all tests under the package of the test application (as defined by the If you have many tests under one package, use the If you prefer to explicitly state which tests comprise all of your tests, you can define a test suite and run that directly. By convention, all test packages in your system should have at least one suite called In order to debug your test code, instruct the controller to stop and wait for the debugger by adding When writing tests, refer to the ApiDemos tests as models (located at Test packages should use the following structure and include Files are located within a The contents of the makefile are similar to a normal application with the addition of a Use the following example to create an Create a class that derives from this class. You must override two abstract methods; one that returns the class loader of the target package, and another that defines all of the tests within the package. For example, the snippet below displays the test runner for the framework tests. To create a new test case, write a class that extends The test case described in this section adds and tests a new Contact. Note that you can send intents, register intent receivers, etc. Once you are bootstrapped with your test application, you can start writing tests. There are three of types of tests you may wish to write:In this document
-Introduction

Building an Audio Library
+Building an Audio Library
AudioHardwareInterface.h. You must name your shared library libaudio.so so that it will get loaded from /system/lib at runtime. Place libaudio sources and Android.mk in partner/acme/chipset_or_board/libaudio/.Android.mk file ensures that libaudio compiles and links to the appropriate libraries:Interface
+Interface
diff --git a/pdk/docs/guide/bluetooth.jd b/pdk/docs/guide/bluetooth.jd
index 5d5e8064c..e514ef0eb 100755
--- a/pdk/docs/guide/bluetooth.jd
+++ b/pdk/docs/guide/bluetooth.jd
@@ -2,20 +2,19 @@ page.title=Bluetooth
pdk.version=1.0
@jd:body
+Introduction
Porting
+Porting
@@ -41,13 +40,13 @@ Solid elements represent Android blocks and dashed elements represent partner-sp
-
-CompilingUART Driver
+UART Driver
hciattach daemon.drivers/serial/msm_serial.c. You may also need to edit command line options to hciattach via init.rc.Bluetooth Power On / Off
+Bluetooth Power On / Off
Compiling
+Compiling
BoardConfig.mk.
BOARD_HAVE_BLUETOOTH := true
-Troubleshooting
+Troubleshooting
adb logcat) and look for ERRROR and WARNING messages regarding Bluetooth.
Andoird uses Bluez, which comes with some useful debugging tools. The snippet below provides examples in a suggested order:hciconfig -a works but hcitool scan doesn't, try installing the firmware for the Bluetooth chipset. This firmware isn't yet available in the open source codebase, but you can adb pull and then adb pushit from a stock T-Mobile G1 (located in /etc/firmware/brf6300.bin).
Tools
+Tools
@@ -96,7 +95,7 @@ sdptool records ADDRESS # request the SDP records of another BT device.
-
Feature Support
+Feature Support
Android 1.0 release
Platform features
diff --git a/pdk/docs/guide/build_cookbook.jd b/pdk/docs/guide/build_cookbook.jd
index b9d9f7cf8..fc34132c0 100755
--- a/pdk/docs/guide/build_cookbook.jd
+++ b/pdk/docs/guide/build_cookbook.jd
@@ -1,19 +1,26 @@
-page.title=Building a simple APK
+Building a simple APK
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -27,7 +34,7 @@ pdk.version=
-Building a APK that depends on a static .jar file
+Building a APK that depends on a static .jar file
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -44,7 +51,7 @@ pdk.version=
-Building a APK that should be signed with the platform key
+Building a APK that should be signed with the platform key
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -60,7 +67,7 @@ pdk.version=
-Building a APK that should be signed with a specific vendor key
+Building a APK that should be signed with a specific vendor key
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -76,7 +83,7 @@ pdk.version=
-Adding a prebuilt APK
+Adding a prebuilt APK
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -89,7 +96,7 @@ pdk.version=
-Adding a Static Java Library
+Adding a Static Java Library
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
@@ -106,7 +113,7 @@ pdk.version=
-Android.mk Variables
+Android.mk Variables
Detailed Instructions
+
+Detailed Instructions
@@ -104,7 +111,7 @@ pdk.version=1.0
/out/target/product/<board_name>.
-New Product File Tree
+New Product File Tree
Product Definition Files
+Product Definition Files
Build Variants
+Build Variants
% make -v. If you don't have version 3.80 or greater, you need to upgrade your version of make. Understanding Android's Build System
-Understanding the makefile
+
+Understanding the makefile
@@ -58,7 +50,7 @@ include $(BUILD_EXECUTABLE)
Layers
+Layers
Building the Android Platform
+Building the Android Platform
Device Code
+Device Code
build/envsetup.sh, which contains necessary variable and function definitions, as described below.
@@ -117,12 +109,12 @@ include $(BUILD_EXECUTABLE)
-Cleaning Up
+Cleaning Up
% m clean to clean up the binaries you just created. You can also execute % m clobber to get rid of the binaries of all combos. % m clobber is equivalent to removing the //out/ directory where all generated files are stored.Speeding Up Rebuilds
+Speeding Up Rebuilds
//out/, making it possible to quickly switch between combos without having to recompile all sources each time. USE_CCACHE environment variable as shown below: ccache binaries are provided in //prebuilt/... and don't need to get installed on your system.Troubleshooting
+Troubleshooting
@@ -155,7 +147,7 @@ Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
PATH variable.Building the Android Kernel
+Building the Android Kernel
/home/joe/android/kernel.
-Checking Out a Branch
+Checking Out a Branch
android. To check out a different branch, execute the following:% git checkout <branchname>.Verifying Location
+Verifying Location
@@ -197,7 +189,7 @@ Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
--a flag.Building the Kernel
+Building the Kernel
diff --git a/pdk/docs/guide/camera.jd b/pdk/docs/guide/camera.jd
index 204c0702b..f4c9c8503 100755
--- a/pdk/docs/guide/camera.jd
+++ b/pdk/docs/guide/camera.jd
@@ -2,24 +2,24 @@ page.title=Camera
pdk.version=1.0
@jd:body
+
+
-
Building a Camera Library
+Building a Camera Library
CameraHardwareInterface.h. You must name your shared library libcamera.so so that it will get loaded from /system/lib at runtime. Place libcamera sources and Android.mk in partner/acme/chipset_or_board/libcamera/.Android.mk file ensures that libcamera compiles and links to the appropriate libraries:Sequence Diagrams
+Sequence Diagrams
-Preview
+Preview
-Taking a Picture
+Taking a Picture
-Interface
+Interface
diff --git a/pdk/docs/guide/customization.jd b/pdk/docs/guide/customization.jd
index a405113c4..9c39cd735 100755
--- a/pdk/docs/guide/customization.jd
+++ b/pdk/docs/guide/customization.jd
@@ -2,21 +2,22 @@ page.title=Customization
pdk.version=1.0
@jd:body
-
-
-Network Customization Platform
-Customizing pre-loaded applications
-Customizing browser bookmarks
-Email Provider Customization
-Platform ThemesBoot Screen Customization
diff --git a/pdk/docs/guide/dalvik.jd b/pdk/docs/guide/dalvik.jd
index 30c92ef5d..948496a98 100755
--- a/pdk/docs/guide/dalvik.jd
+++ b/pdk/docs/guide/dalvik.jd
@@ -1,16 +1,19 @@
page.title=Dalvik
pdk.version=1.0
@jd:body
-
-
-
-
-Introduction
-
+
+Core Libraries
+Core Libraries
dalvik/libcore,
@@ -37,7 +40,7 @@ can be used.
JNI Call Bridge
+JNI Call Bridge
Interpreter
+Interpreter
In this document
-
-
-Introduction
-envsetup.sh has a gdbclient command that handles much of the setup. For example, to attach to the
+envsetup.sh has a gdbclient command that handles much of the setup. For example, to attach the
already-running globaltime application, execute the following, making sure that: 1) you do this from the same window used to build the software on the device you are debugging and 2) verify that the symbols in the object files in the build tree match up with what is installed on the device or emulator.
gdbclient app_process :5039 globaltime
+Debugging
Short Instructions
gdbserver on the device and an ARM aware gdb, named arm-eabi-gdb, on the desktop machine.Capturing logs
+Capturing logs
@@ -24,7 +24,7 @@ pdk.version=1.0
-Debug Scenarios
+Debug Scenarios
# command to device shell (via adb)
% command to host pc shell
@@ -32,7 +32,7 @@ pdk.version=1.0
-Crash but no exit...stuck
+Crash but no exit...stuck
Crash in C / C++ code
+Crash in C / C++ code
aproto and run logcat on the device. You should see output like this:
diff --git a/pdk/docs/guide/display_drivers.jd b/pdk/docs/guide/display_drivers.jd
index 94d5467fc..ac41c55ce 100755
--- a/pdk/docs/guide/display_drivers.jd
+++ b/pdk/docs/guide/display_drivers.jd
@@ -4,20 +4,23 @@ pdk.version=1.0
+
+
/dev/fb0 or /dev/graphics/fb0) and driver as described in the linux/fb.h kernel header file. For more information regarding the standard Linux frame buffer, please see The Frame Buffer Device at http://kernel.org.
-Functionality
+Functionality
unlockCanvas() is called, the back buffer is posted, which
@@ -32,7 +35,7 @@ pdk.version=1.0
Implementing Your Own Driver (Driver Template)
+Implementing Your Own Driver (Driver Template)
PGUIDE_FB... macros as desired to match the requirements of your own device hardware.
@@ -330,7 +333,7 @@ MODULE_LICENSE("GPL");
-Troubleshooting
+Troubleshooting
diff --git a/pdk/docs/guide/gps.jd b/pdk/docs/guide/gps.jd
index da57bef33..3af7d7d16 100755
--- a/pdk/docs/guide/gps.jd
+++ b/pdk/docs/guide/gps.jd
@@ -2,18 +2,21 @@ page.title=GPS
pdk.version=1.0
@jd:body
+
+
include/hardware/gps.h. In order to integate GPS with Android, you need to build a shared library that implements this interface. Building a GPS Library
+Building a GPS Library
gps.h. You must name your shared library libgps.so so that it will get loaded from /system/lib at runtime. Place GPS sources and Android.mk in partner/acme/chipset_or_board/gps/ (where "acme" is your product name and "chipset_or_board" is your hardware target).Interface
+Interface
-In this document
-
-Instrumentation Framework
-Platform Test Suites
-Running Tests
-Running all Tests Under Single Package
-Running a Single Test Suite
-A Single Test Case
-A Single Test
-Attaching a debugger to your test
-Contents of makefile
-Content of Manifest
-New Instrumentation TestRunner
-New InstrumentationTestCase
-Exploring a Test Case
-Deciding Kinds of Tests to WriteIntroduction
+
+Instrumentation Framework
+Instrumentation Framework
-Classes
+Classes
Instrumentation with JUnit testing.
@@ -95,7 +77,7 @@ pdk.version=1.0
-Understanding the am Command
+Understanding the am Command
am is used to start and instrument activities using the adb shell command, as shown in the snippet below:
@@ -112,22 +94,22 @@ For example, to start the Contacts application you can use
-Platform Test Suites
+Platform Test Suites
Framework Tests
+Framework Tests
//device/tests and //device/apps/AndroidTests.Core Library
+Core Library
//device/java/tests and Java library (java.*, javax.*, etc. packages) tests at //device/dalvik/libcore/.../tests.Running Tests
+Running Tests
tests/Contacts directory.
@@ -165,7 +147,7 @@ $
-
All Tests with Default TestRunner behavior
+All Tests with Default TestRunner behavior
android:targetPackage attribute of the instrumentation defined in its manifest file).
Running all Tests Under Single Package
+Running all Tests Under Single Package
-e package <packagename> option to run all tests under that package without having to manually create a test suite.
@@ -197,7 +179,7 @@ OK (8 tests)
-Running a Single Test Suite
+Running a Single Test Suite
AllTests (see AllTests.java). To run all of the tests using the AllTests suite for the api demos test app:A Single Test Case
+A Single Test Case
$ adb shell am instrument -w \
@@ -233,7 +215,7 @@ INSTRUMENTATION_CODE: -1
-A Single Test
+A Single Test
$ adb shell am instrument -w \
@@ -250,7 +232,7 @@ INSTRUMENTATION_CODE: -1
-Attaching a debugger to your test
+Attaching a debugger to your test
-e debug true to your
command line. This causes the test runner to stop and wait for the debugger just before calling your setUp() method. For example,Writing Tests
+Writing Tests
//device/samples/ApiDemos). This section provides an overview of the test structure with ApiDemos.Location of Files
+Location of Files
Android.mk, AndroidManifest.xml, AllTests.java, and a src directory that mirrors the src directory of the tested application.tests directory found in the root directory:Contents of makefile
+Contents of makefile
LOCAL_INSTRUMENTATION_FOR declaration.
@@ -317,7 +299,7 @@ include $(BUILD_PACKAGE)
-Content of Manifest
+Content of Manifest
AndroidManifest.xml file that declares the instrumentation. Specify that the framework supplied Instrumentation TestRunner targest the package of your application, allowing the tests that are run with the instrumentation to get access to all of the classes of your application without having to build the source into the test app. The name of the test application is typically the same as your target application with .tests appended.
@@ -346,7 +328,7 @@ $ adb shell am instrument -w \
-New Instrumentation TestRunner
+New Instrumentation TestRunner
@@ -378,7 +360,7 @@ public class FrameworkInstrumentationTestRunner extends InstrumentationTestRunne
-New InstrumentationTestCase
+New InstrumentationTestCase
InstrumentationTestCase in the same application as your test runner. The following snippet illustrates an example ActivityTestCase that tests an activity named MyActivity.
@@ -409,7 +391,7 @@ public class ButtonPressTest extends ActivityTestCase<MyActivity> {
-Exploring a Test Case
+Exploring a Test Case
Instrumentation.java has helper functions that send key events and strings, for example: Deciding Kinds of Tests to Write
+Deciding Kinds of Tests to Write
@@ -498,7 +480,7 @@ private void addNewContact(String name, int star, int phoneType, String number,
If you run your test cases and nothing appears to happen, have a look at adb logcat. The following is a common problem:
diff --git a/pdk/docs/guide/keymaps_keyboard_input.jd b/pdk/docs/guide/keymaps_keyboard_input.jd index a71b5e9ed..e53149a6d 100755 --- a/pdk/docs/guide/keymaps_keyboard_input.jd +++ b/pdk/docs/guide/keymaps_keyboard_input.jd @@ -3,25 +3,19 @@ pdk.version=1.0 @jd:body ++++- -In this document
-Introduction
+ +This document describes how keyboard input gets translated into Android actions and how you can customize key layout and key character maps to match the needs of your own device.
Android uses the standard Linux input event device (
@@ -29,7 +23,7 @@ pdk.version=1.0 -/dev/event0) and driver as described in thelinux/input.hkernel header file. For more information regarding standard Linux input drivers, please see Linux Input drivers at http://kernel.org.Functionality
+Functionality
Android's input event device is structured around an interrupt or polling routine that captures the device-specific scancode and converts it to a standard form acceptable to Linux (as defined in
input.h) before passing it to the kernel withinput_event().The keymap driver's other primary function is to establish a probe function that sets up the interrupt or polling function, handles hardware initialization, and attaches the driver to the input subsystem with
@@ -60,17 +54,17 @@ pdk.version=1.0 -input_register_device().Key Layout Map
+Key Layout Map
-Selection of a Key Layout Map
+Selection of a Key Layout Map
Key layout maps are installed in
/system/usr/keylayoutand/data/usr/keylayout.For each keyboard device xxx, set the
-android.keylayout.xxxsystem property (see Building New Device for help setting system properties). If you don't specify a keylayout file, Android will default to/system/usr/keylayout/qwerty.kl.File Format
+File Format
Key layout maps are stored on the device as UTF-8 text files and have the following characteristics:
The following code comes from android/src/device/product/generic/tuttle2.kl and is an example of a complete key layout file:
@@ -171,17 +165,17 @@ key 399 GRAVE-
Key character maps are installed in /system/usr/keychars and /data/usr/keychars.
For each keyboard device xxx, set the android.keychar.xxx system property to the full path of the desired keychar file. If you don't specify a keychar file, Android will default to /system/usr/keychar/qwerty.kl.
-
Key character maps are stored on the device as binary resources in order to reduce loading time. Key character maps have the following characteristics:
The following code comes from android/src/device/product/generic/tuttle2.kcm and represents a complete key character file:
The type line indicates what kind of keyboard your device implements. Possible types include:
@@ -299,7 +293,7 @@ PLUS '+' '+' '+' '+' '+' '+' -The file snippet above gets converted to the following by the makekcharmap tool as part of the build process. You can mmap this file in and share the approximately 4k of memory that it uses between processes to minimize load time.
The following file, pguide_events.c, illustrates how to implement an Android keymap driver.
@@ -485,7 +479,7 @@ MODULE_LICENSE("GPL");
-Assume the following for the setup of a new keypad device:
diff --git a/pdk/docs/guide/lights.jd b/pdk/docs/guide/lights.jd index 5437e631a..4f19c5d3c 100755 --- a/pdk/docs/guide/lights.jd +++ b/pdk/docs/guide/lights.jd @@ -1,15 +1,18 @@ page.title=Lights pdk.version=1.0 @jd:body - - - - -Introduction
- + ++ ++Android defines a user space C abstraction interface for LED hardware. The interface header is defined in
-hardware/libhardware/include/hardware/lights.h. In order to integrate LEDs with Android you need to build a shared library that implements this interface. @@ -25,17 +28,17 @@ The types of logical lights currently supported by Android include:Building a Lights Library
+Building a Lights Library
To implement a Lights driver, create a shared library that implements the interface defined in
lights.h. You must name your shared libraryliblights.soso that it will get loaded from/system/libat runtime.Interface
+Interface
-Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.
diff --git a/pdk/docs/guide/pdk_toc.cs b/pdk/docs/guide/pdk_toc.cs index 3b79cef32..f98f19489 100644 --- a/pdk/docs/guide/pdk_toc.cs +++ b/pdk/docs/guide/pdk_toc.cs @@ -34,7 +34,7 @@ function nothing() {}
Android defines a user space C abstraction interface for sensor hardware. The interface header is defined in
hardware/libhardware/include/hardware/sensors.h.
In order to integrate sensors with Android you need to build a shared library that implements this interface.
@@ -26,17 +29,17 @@ The types of sensors currently supported by Android include:
To implement a Sensors driver, create a shared library that implements the interface defined in sensors.h. You must name your shared library
libsensors.so so that it will get loaded from /system/lib at runtime.
Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.
diff --git a/pdk/docs/guide/stk.jd b/pdk/docs/guide/stk.jd index 32f165cae..0ce0b4a04 100755 --- a/pdk/docs/guide/stk.jd +++ b/pdk/docs/guide/stk.jd @@ -2,26 +2,20 @@ page.title=Sim Toolkit Application (STK) pdk.version=1.0 @jd:body - -This document offers a high-level overview of the SIM Toolkit Application for Android 1.0 and is primarily of interest for implementors of the Radio Interface Layer (RIL). The STK is R96 compatible (3GPP TS 11.14 v5.9.0) and complies partially with R99 (3GPP TS 101.267 v8.17.0). See the STK Feature List for the complete feature list.
The Android STK implementation includes three layers:
See the Android Platform Development Kit for details.
-Communication to the upper layers is done using the RIL_UNSOL_xxx family of commands defined in /hardware/ril/include/ril.h. The payload for each command is encoded using BER-TLV. As stated above, it is not necessary to remove extraneous fields. This allows the SIM to pass a complete command to the upper layers and simplifies STK RIL code. Below is the mapping from RIL_UNSOL_xxx commands to the SIM commands.
Sent by SIM to signal end of session. No content and no response.
-Communication from the upper layers to the RIL uses the commands below (defined in ril.h):
This should cause the terminal response to be sent to the SIM.
-STK Telephony is a protocol translation layer used to convert messages from BERL-TLV format to Application messages and back.
On the STK RIL side, STK Telphony receives raw buffer messages from RIL I/F and decodes them into a command parameters container before passing them on to the application. On the Application side, this layer receives application responses for commands and encodes them into raw buffer messages, which then get sent over the RIL I/F back to the SIM card.
-The functions listed in the table below are call-back functions used by the Vendor RIL to invoke unsolicited commands on the Android platform. See ril.h for details.
diff --git a/pdk/docs/guide/wakelock.jd b/pdk/docs/guide/wakelock.jd index 1d8b425c6..ee590539c 100755 --- a/pdk/docs/guide/wakelock.jd +++ b/pdk/docs/guide/wakelock.jd @@ -3,14 +3,17 @@ pdk.version=1.0 @jd:body +
A locked wakelock, depending on its type, prevents the system from entering suspend or other low-power states. This document describes how to employ wakelocks.
There are two settings for a wakelock:
A driver can use the wakelock API by adding a wakelock variable to its state and calling wake_lock_init, as illustrated in the snippet below:
+struct state { struct wakelock wakelock; } @@ -60,18 +63,18 @@ pdk.version=1.0 }When the driver determines that it needs to run (usually in an interrupt handler), it calls
-wake_lock:+wake_lock(&state->wakelock);When it no longer needs to run, it calls
-wake_unlock:+wake_unlock(&state->wakelock);It can also call
-wake_lock_timeoutto release the wakelock after a delay:+wake_lock_timeout(&state->wakelock, HZ);This works whether or not the wakelock is already held. It is useful if the driver woke up other parts of the system that do not use wakelocks but still need to run. Avoid this when possible, since it will waste power if the timeout is long or may fail to finish needed work if the timeout is short.
-User-space API
+User-space API
Write
locknameorlockname timeoutto/sys/power/wake_locklock and, if needed, create a wakelock. The timeout here is specified in nanoseconds. Writelocknameto/sys/power/wake_unlockto unlock a user wakelock.Do not use randomly generated wakelock names as there is no API to free a user-space wakelock.
\ No newline at end of file diff --git a/pdk/docs/guide/wifi.jd b/pdk/docs/guide/wifi.jd index aaf0acecc..5341954cb 100755 --- a/pdk/docs/guide/wifi.jd +++ b/pdk/docs/guide/wifi.jd @@ -2,18 +2,21 @@ page.title=Wi-Fi pdk.version=1.0 @jd:body +Android uses wpa_supplicant as the platform interface to the Wi-Fi device. Your Wi-Fi driver must be compatible with the standard wpa_supplicant in addition to extensions added to the supplicant (specifically, the "DRIVER" commands described in
-wifi.h/wifi_command()).Building a Wi-Fi Library
+Building a Wi-Fi Library
To create a Wi-Fi driver for Android: