summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-02-15 09:50:22 -0500
committerMike Lockwood <lockwood@android.com>2011-02-16 08:25:16 -0500
commit9182d3c4eb1f9065cb33df5a3594969dd0d42acc (patch)
tree3fa11b1752bef1a6bfc9d27c6455aa4b3854f03b /api
parent2fa160840c81c32aa9703d08ced24a2427863bf4 (diff)
downloadframeworks_base-9182d3c4eb1f9065cb33df5a3594969dd0d42acc.zip
frameworks_base-9182d3c4eb1f9065cb33df5a3594969dd0d42acc.tar.gz
frameworks_base-9182d3c4eb1f9065cb33df5a3594969dd0d42acc.tar.bz2
UsbManager: New APIs for USB accessories
USB accessories are peripherals that connect to android devices as a USB host. When connected, the accessory will first identify itself to the android device by sending manufacturer, product, accessory type and version strings to the device, and then request the device to enter USB accessory mode. The device will then enable the USB accessory kernel driver and disable all other USB functionality except possibly adb (adb can be used while the android device is connected to the PC and the PC is running software that emulates a USB accessory) The class android.hardware.UsbAccessory is used to describe the currently attached USB accessory. UsbAccessory contains the manufacturer, product, accessory type and version strings to identify the accessory. The accessory can be opened as a ParcelFileDescriptor, which can be used to communicate with the accessory over two bulk endpoints. The Intents UsbManager.USB_ACCESSORY_ATTACHED and UsbManager.USB_ACCESSORY_DETACHED are broadcast when accessories are connected and disconnected to the device. The USB_ACCESSORY_ATTACHED contains a UsbAccessory object for the attached accessory as an extra. The Intent also contains string extras for the manufacturer, product, accessory type and version strings to allow filtering on these strings. Change-Id: Ie77cbf51814a4aa44a6b1e62673bfe4c6aa81755 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'api')
-rw-r--r--api/current.xml209
1 files changed, 206 insertions, 3 deletions
diff --git a/api/current.xml b/api/current.xml
index 7806c24..cb86aad 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -94147,6 +94147,97 @@
>
</field>
</class>
+<class name="UsbAccessory"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<implements name="android.os.Parcelable">
+</implements>
+<method name="describeContents"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getManufacturer"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getModel"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getType"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getVersion"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="writeToParcel"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="parcel" type="android.os.Parcel">
+</parameter>
+<parameter name="flags" type="int">
+</parameter>
+</method>
+<field name="CREATOR"
+ type="android.os.Parcelable.Creator"
+ transient="false"
+ volatile="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
<class name="UsbConstants"
extends="java.lang.Object"
abstract="false"
@@ -95097,6 +95188,17 @@
deprecated="not deprecated"
visibility="public"
>
+<method name="getAccessoryList"
+ return="android.hardware.UsbAccessory[]"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="getDeviceList"
return="java.util.HashMap&lt;java.lang.String, android.hardware.UsbDevice&gt;"
abstract="false"
@@ -95134,6 +95236,19 @@
<parameter name="function" type="java.lang.String">
</parameter>
</method>
+<method name="openAccessory"
+ return="android.os.ParcelFileDescriptor"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="accessory" type="android.hardware.UsbAccessory">
+</parameter>
+</method>
<method name="openDevice"
return="boolean"
abstract="false"
@@ -95147,6 +95262,28 @@
<parameter name="device" type="android.hardware.UsbDevice">
</parameter>
</method>
+<field name="ACTION_USB_ACCESSORY_ATTACHED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.hardware.action.USB_ACCESSORY_ATTACHED&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ACTION_USB_ACCESSORY_DETACHED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.hardware.action.USB_ACCESSORY_DETACHED&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="ACTION_USB_DEVICE_ATTACHED"
type="java.lang.String"
transient="false"
@@ -95180,6 +95317,61 @@
visibility="public"
>
</field>
+<field name="EXTRA_ACCESSORY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="EXTRA_ACCESSORY_MANUFACTURER"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory-manufacturer&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="EXTRA_ACCESSORY_PRODUCT"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory-product&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="EXTRA_ACCESSORY_TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory-type&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="EXTRA_ACCESSORY_VERSION"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory-version&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="EXTRA_DEVICE"
type="java.lang.String"
transient="false"
@@ -95279,6 +95471,17 @@
visibility="public"
>
</field>
+<field name="USB_FUNCTION_ACCESSORY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;accessory&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="USB_FUNCTION_ADB"
type="java.lang.String"
transient="false"
@@ -237424,7 +237627,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="s" type="java.lang.String">
+<parameter name="key" type="java.lang.String">
</parameter>
</method>
<method name="describeContents"
@@ -237459,7 +237662,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="s" type="java.lang.String">
+<parameter name="key" type="java.lang.String">
</parameter>
</method>
<method name="getIconResId"
@@ -265635,7 +265838,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="arg0" type="T">
+<parameter name="t" type="T">
</parameter>
</method>
</interface>