diff options
Diffstat (limited to 'en/devices')
-rw-r--r-- | en/devices/accessories/aoa.html | 8 | ||||
-rw-r--r-- | en/devices/accessories/aoa2.html | 15 | ||||
-rw-r--r-- | en/devices/accessories/headset/usb-headset-spec.html | 5 | ||||
-rw-r--r-- | en/devices/accessories/stylus.html | 4 | ||||
-rw-r--r-- | en/devices/audio/implement-policy.html | 14 | ||||
-rw-r--r-- | en/devices/audio/implement-pre-processing.html | 4 | ||||
-rw-r--r-- | en/devices/audio/implement-shared-library.html | 17 | ||||
-rw-r--r-- | en/devices/audio/latency_design.html | 5 | ||||
-rw-r--r-- | en/devices/index.html | 7 | ||||
-rw-r--r-- | en/devices/tech/admin/multi-user.html | 2 | ||||
-rw-r--r-- | en/devices/tech/debug/asan.html | 2 |
11 files changed, 46 insertions, 37 deletions
diff --git a/en/devices/accessories/aoa.html b/en/devices/accessories/aoa.html index 6acdfc06..c57fef60 100644 --- a/en/devices/accessories/aoa.html +++ b/en/devices/accessories/aoa.html @@ -99,7 +99,7 @@ if the device supports that mode:</p> it returns a non-zero number that represents the supported protocol version. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_IN | USB_TYPE_VENDOR request: 51 value: 0 @@ -116,7 +116,7 @@ data: protocol version number (16 bits little endian sent from the request is on endpoint 0 (for each string ID) with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 52 value: 0 @@ -127,7 +127,7 @@ data zero terminated UTF8 string sent from accessory to device <p>The following string IDs are supported, with a maximum size of 256 bytes for each string (must be zero-terminated with <code>\0</code>).</p> -<pre> +<pre class="devsite-click-to-copy"> manufacturer name: 0 model name: 1 description: 2 @@ -140,7 +140,7 @@ serial number: 5 <li>Send a control request to ask the device to start in accessory mode. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 53 value: 0 diff --git a/en/devices/accessories/aoa2.html b/en/devices/accessories/aoa2.html index 1f965937..83e27929 100644 --- a/en/devices/accessories/aoa2.html +++ b/en/devices/accessories/aoa2.html @@ -53,7 +53,8 @@ devices.</p> (<code><adk-src>/adk1/board/AndroidAccessory/AndroidAccessory.cpp</code>) library demonstrates this protocol check:</p> -<pre><code>bool AndroidAccessory::switchDevice(byte addr) +<pre class="devsite-click-to-copy"> +bool AndroidAccessory::switchDevice(byte addr) { int protocol = getProtocol(addr); if (protocol >= 1) { @@ -74,7 +75,7 @@ library demonstrates this protocol check:</p> USB_SETUP_RECIPIENT_DEVICE, ACCESSORY_START, 0, 0, 0, 0, NULL); return true; } -</code></pre> +</pre> <p>AOAv2 includes new USB product IDs for each combination of USB interfaces available in accessory mode:</p> @@ -146,14 +147,15 @@ the future).</p> <p>To enable audio support, the accessory must send a new USB control request: </p> -<pre><code>**SET_AUDIO_MODE** +<pre class="devsite-click-to-copy"> +**SET_AUDIO_MODE** requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 58 value: 0 for no audio (default), 1 for 2 channel, 16-bit PCM at 44100 KHz index: 0 data none -</code></pre> +</pre> <p>This command must be sent <em>before</em> sending the <code>ACCESSORY_START</code> command for entering accessory mode.</p> @@ -201,7 +203,8 @@ accessory to the Android device.</li> <p>The code definitions for the new control requests are:</p> -<pre><code>/* Control request for registering a HID device. +<pre class="devsite-click-to-copy"> +/* Control request for registering a HID device. * Upon registering, a unique ID is sent by the accessory in the * value parameter. This ID will be used for future commands for * the device @@ -248,7 +251,7 @@ accessory to the Android device.</li> * data the HID report for the event */ #define ACCESSORY_SEND_HID_EVENT 57 -</code></pre> +</pre> <h2 id="interoperability-with-aoa-10-features">Interoperability with AOAv1</h2> diff --git a/en/devices/accessories/headset/usb-headset-spec.html b/en/devices/accessories/headset/usb-headset-spec.html index 8d067c61..9a7cbad1 100644 --- a/en/devices/accessories/headset/usb-headset-spec.html +++ b/en/devices/accessories/headset/usb-headset-spec.html @@ -170,6 +170,11 @@ mappings. </tr> </table> +<p class="note">Key mappings should be declared within a HID application +collection. For accessories without a microphone, use Headphone (Usage +Page: Consumer (0x0C), Usage: Headphone (0x05)). For accesories with a +microphone, use Headset (Usage Page: Telephony (0x0B), Usage: Headset (0x05)).</p> + <h2 id="mechanical">Mechanical</h2> <p> Accessory manufacturers must follow the requirements for USB connectors diff --git a/en/devices/accessories/stylus.html b/en/devices/accessories/stylus.html index d2c2b79f..da739f9a 100644 --- a/en/devices/accessories/stylus.html +++ b/en/devices/accessories/stylus.html @@ -52,7 +52,7 @@ Bluetooth Low Energy (BTLE), or USB.</p> <h3 id="hid-descriptor">HID descriptor</h3> -<p><pre> +<pre class="devsite-click-to-copy"> UsagePage(Digitizer) Usage(Pen) Collection(Application) @@ -110,7 +110,7 @@ unsigned char HID_DESC[] = { 0xC0, // End Collection 0xC0, // End Collection } -</pre></p> +</pre> <h2 id="guidelines-devs">Guidelines for stylus application developers</h2> <p>The Android 6.0 platform automatically handles pairing and event correlation, diff --git a/en/devices/audio/implement-policy.html b/en/devices/audio/implement-policy.html index 16cd0820..a6ccf0e9 100644 --- a/en/devices/audio/implement-policy.html +++ b/en/devices/audio/implement-policy.html @@ -75,10 +75,9 @@ shows many of these features in use.</p> <code>/system/etc</code>. To view a simple audio policy configuration in the new XML file format, view the example below.</p> -<p> <section class="expandable"> <h4 class="showalways">Show audio policy example</h4> -<pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <globalConfiguration speaker_drc_enabled="true"/> @@ -139,7 +138,6 @@ XML file format, view the example below.</p> <xi:include href="default_volume_tables.xml"/> </audioPolicyConfiguration> </pre></section> -</p> <p>The top level structure contains modules that correspond to each audio HAL hardware module, where each module has a list of mix ports, device ports, and @@ -160,7 +158,7 @@ overwritten.</p> <section class="expandable"> <h4 class="showalways">Show volume table example</h4> -<p><pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8"?> <volumes> <reference name="FULL_SCALE_VOLUME_CURVE"> @@ -178,11 +176,11 @@ overwritten.</p> <point>100,0</point> </reference> </volumes> -</pre></p></section> +</pre></section> <section class="expandable"> <h4 class="showalways">Show volumes example</h4> -<p><pre> +<pre class="devsite-click-to-copy"> <?xml version="1.0" encoding="UTF-8"?> <volumes> <volume stream="AUDIO_STREAM_VOICE_CALL" deviceCategory="DEVICE_CATEGORY_HEADSET" ref="DEFAULT_VOLUME_CURVE"/> @@ -255,7 +253,7 @@ overwritten.</p> <volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EARPIECE" ref="FULL_SCALE_VOLUME_CURVE"/> <volume stream="AUDIO_STREAM_PATCH" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA" ref="FULL_SCALE_VOLUME_CURVE"/> </volumes> -</pre></p></section> +</pre></section> <h2 id=file_inclusions>File inclusions</h2> <p>The XML Inclusions (XInclude) method can be used to include audio policy @@ -391,7 +389,7 @@ product. The following example from a Galaxy Nexus shows a <em>dynamic</em> channel mask, which means the audio policy manager queries the actual channel masks supported by the HDMI sink after connection.</p> -<pre> +<pre class="devsite-click-to-copy"> audio_hw_modules { primary { outputs { diff --git a/en/devices/audio/implement-pre-processing.html b/en/devices/audio/implement-pre-processing.html index e42dfc1c..adbf156f 100644 --- a/en/devices/audio/implement-pre-processing.html +++ b/en/devices/audio/implement-pre-processing.html @@ -83,7 +83,7 @@ audio HAL implementation's default behavior.</p> the <code>AudioSource</code> configuration in this manner, the framework will automatically request from the audio HAL the use of those effects.</p> -<p><pre> +<pre class="devsite-click-to-copy"> pre_processing { voice_communication { aec {} @@ -93,7 +93,7 @@ pre_processing { agc {} } } -</pre></p> +</pre> <h2 id=tuning>Source tuning</h2> diff --git a/en/devices/audio/implement-shared-library.html b/en/devices/audio/implement-shared-library.html index 0c999c81..9f687079 100644 --- a/en/devices/audio/implement-shared-library.html +++ b/en/devices/audio/implement-shared-library.html @@ -34,7 +34,7 @@ directory to contain your library's source files.</li> <li>Create an <code>Android.mk</code> file to build the shared library. Ensure the Makefile contains the following line: <br> -<pre> +<pre class="devsite-click-to-copy"> LOCAL_MODULE := audio.primary.<device> </pre> <br> @@ -46,7 +46,8 @@ hardware located on the device. The module names <code>audio.usb.<device></code> are also available for Bluetooth and USB audio interfaces. Here is an example of an <code>Android.mk</code> from the Galaxy Nexus audio hardware:</p> -<p><pre> + +<pre class="devsite-click-to-copy"> LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -62,29 +63,29 @@ LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils libdl LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) -</pre></p> +</pre> </li> <br> <li>If your product supports low latency audio as specified by the Android CDD, copy the corresponding XML feature file into your product. For example, in your product's <code>device/<company>/<device>/device.mk</code> Makefile: -<p><pre> +<pre class="devsite-click-to-copy"> PRODUCT_COPY_FILES := ... PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \ -</pre></p> +</pre> </li> <br> <li>Copy the audio policy configuration file you created earlier to the <code>system/etc/</code> directory in your product's <code>device/<company>/<device>/device.mk</code> Makefile. For example: -<p><pre> +<pre class="devsite-click-to-copy"> PRODUCT_COPY_FILES += \ device/samsung/tuna/audio/audio_policy.conf:system/etc/audio_policy.conf -</pre></p> +</pre> </li> <br> <li>Declare the shared modules of your audio HAL that are required by your @@ -92,7 +93,7 @@ product in the product's <code>device/<company>/<device>/device.mk</code> Makefile. For example, the Galaxy Nexus requires the primary and Bluetooth audio HAL modules: -<pre> +<pre class="devsite-click-to-copy"> PRODUCT_PACKAGES += \ audio.primary.tuna \ audio.a2dp.default diff --git a/en/devices/audio/latency_design.html b/en/devices/audio/latency_design.html index f777c8ab..59ab47e0 100644 --- a/en/devices/audio/latency_design.html +++ b/en/devices/audio/latency_design.html @@ -43,7 +43,10 @@ The client can optionally set bit <code>AUDIO_OUTPUT_FLAG_FAST</code> in the </p> <ul> -<li>Android native audio based on OpenSL ES</li> +<li>Android native audio based on <a +href="https://developer.android.com/ndk/guides/audio/opensl/index.html">OpenSL +ES</a> or <a +href="https://developer.android.com/ndk/guides/audio/aaudio/aaudio.html">AAudio</a></li> <li><a href="http://developer.android.com/reference/android/media/SoundPool.html">android.media.SoundPool</a></li> <li><a href="http://developer.android.com/reference/android/media/ToneGenerator.html">android.media.ToneGenerator</a></li> </ul> diff --git a/en/devices/index.html b/en/devices/index.html index a1c3e4ee..49bea636 100644 --- a/en/devices/index.html +++ b/en/devices/index.html @@ -127,7 +127,7 @@ by the contract defined in each hardware-specific HAL interface. contains a <code>hw_module_t</code> struct along with other camera-specific function pointers: </p> -<pre> +<pre class="devsite-click-to-copy"> typedef struct camera_module { hw_module_t common; int (*get_number_of_cameras)(void); @@ -137,7 +137,8 @@ typedef struct camera_module { <p>When you implement a HAL and create the module struct, you must name it <code>HAL_MODULE_INFO_SYM</code>. For instance, here is an example from the Nexus 9 audio HAL:</p> -<pre> + +<pre class="devsite-click-to-copy"> struct audio_module HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, @@ -159,7 +160,7 @@ struct audio_module HAL_MODULE_INFO_SYM = { <code>audio_hw_device_t</code> struct type contains function pointers to audio device operations: </p> -<pre> +<pre class="devsite-click-to-copy"> struct audio_hw_device { struct hw_device_t common; diff --git a/en/devices/tech/admin/multi-user.html b/en/devices/tech/admin/multi-user.html index 11a63df9..cc187660 100644 --- a/en/devices/tech/admin/multi-user.html +++ b/en/devices/tech/admin/multi-user.html @@ -91,7 +91,7 @@ for on-call duty.</p> shared by the primary user and the corp profile.</li> <li><em>Restricted</em>. Uses accounts based off the primary user, who can control what apps are available on the restricted profile. Available only on - tablets.</li> + tablets and television devices.</li> </ul> <h2 id=applying_the_overlay>Enabling multi-user</h2> diff --git a/en/devices/tech/debug/asan.html b/en/devices/tech/debug/asan.html index e510a05b..0ab286dc 100644 --- a/en/devices/tech/debug/asan.html +++ b/en/devices/tech/debug/asan.html @@ -23,8 +23,6 @@ -<h2 id=purpose>Purpose</h2> - <p>AddressSanitizer (ASan) is a fast compiler-based tool for detecting memory bugs in native code. It is comparable to Valgrind (Memcheck tool), but, unlike it, ASan:</p> |