diff options
author | Mike Lockwood <lockwood@android.com> | 2011-03-01 08:04:54 -0800 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-03-01 08:07:20 -0800 |
commit | c4308f01c965571dc2354107c3574df113e397ee (patch) | |
tree | fa0c8c934147ab99f2ff6aec87edfb7266ba7890 /core/java | |
parent | 43cdf9b4191e18b5a4d646d23b06438c0e10b8dd (diff) | |
download | frameworks_base-c4308f01c965571dc2354107c3574df113e397ee.zip frameworks_base-c4308f01c965571dc2354107c3574df113e397ee.tar.gz frameworks_base-c4308f01c965571dc2354107c3574df113e397ee.tar.bz2 |
Move USB framework support from android.hardware to android.hardware.usb package
Change-Id: I00fd4f0caaa4aebe48f71c576bb211b5f38bf88d
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/ContextImpl.java | 4 | ||||
-rw-r--r-- | core/java/android/content/Context.java | 4 | ||||
-rw-r--r-- | core/java/android/hardware/usb/IUsbManager.aidl (renamed from core/java/android/hardware/IUsbManager.aidl) | 6 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbAccessory.aidl (renamed from core/java/android/hardware/UsbAccessory.aidl) | 2 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbAccessory.java (renamed from core/java/android/hardware/UsbAccessory.java) | 16 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbConstants.java (renamed from core/java/android/hardware/UsbConstants.java) | 2 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbDevice.aidl (renamed from core/java/android/hardware/UsbDevice.aidl) | 2 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbDevice.java (renamed from core/java/android/hardware/UsbDevice.java) | 25 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbEndpoint.aidl (renamed from core/java/android/hardware/UsbEndpoint.aidl) | 2 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbEndpoint.java (renamed from core/java/android/hardware/UsbEndpoint.java) | 20 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbInterface.aidl (renamed from core/java/android/hardware/UsbInterface.aidl) | 2 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbInterface.java (renamed from core/java/android/hardware/UsbInterface.java) | 14 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbManager.java (renamed from core/java/android/hardware/UsbManager.java) | 22 | ||||
-rw-r--r-- | core/java/android/hardware/usb/UsbRequest.java (renamed from core/java/android/hardware/UsbRequest.java) | 12 |
14 files changed, 65 insertions, 68 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 8737e93..539e946 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -41,9 +41,9 @@ import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; -import android.hardware.IUsbManager; import android.hardware.SensorManager; -import android.hardware.UsbManager; +import android.hardware.usb.IUsbManager; +import android.hardware.usb.UsbManager; import android.location.CountryDetector; import android.location.ICountryDetector; import android.location.ILocationManager; diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 051ae9e..4c7d87f 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -1664,11 +1664,11 @@ public abstract class Context { /** * Use with {@link #getSystemService} to retrieve a {@link - * android.hardware.UsbManager} for access to USB devices (as a USB host) + * android.hardware.usb.UsbManager} for access to USB devices (as a USB host) * and for controlling this device's behavior as a USB device. * * @see #getSystemService - * @see android.harware.UsbManager + * @see android.harware.usb.UsbManager */ public static final String USB_SERVICE = "usb"; diff --git a/core/java/android/hardware/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl index 8086f37..be65bdb 100644 --- a/core/java/android/hardware/IUsbManager.aidl +++ b/core/java/android/hardware/usb/IUsbManager.aidl @@ -14,10 +14,10 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; -import android.hardware.UsbAccessory; -import android.hardware.UsbDevice; +import android.hardware.usb.UsbAccessory; +import android.hardware.usb.UsbDevice; import android.os.Bundle; import android.os.ParcelFileDescriptor; diff --git a/core/java/android/hardware/UsbAccessory.aidl b/core/java/android/hardware/usb/UsbAccessory.aidl index 97a777b..1c15f1c 100644 --- a/core/java/android/hardware/UsbAccessory.aidl +++ b/core/java/android/hardware/usb/UsbAccessory.aidl @@ -14,6 +14,6 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; parcelable UsbAccessory; diff --git a/core/java/android/hardware/UsbAccessory.java b/core/java/android/hardware/usb/UsbAccessory.java index 15dff3e..6cd9178 100644 --- a/core/java/android/hardware/UsbAccessory.java +++ b/core/java/android/hardware/usb/UsbAccessory.java @@ -14,28 +14,24 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.os.ParcelFileDescriptor; import android.util.Log; /** * A class representing a USB accessory. */ -public final class UsbAccessory implements Parcelable { +public class UsbAccessory implements Parcelable { private static final String TAG = "UsbAccessory"; - private String mManufacturer; - private String mModel; - private String mType; - private String mVersion; - - private UsbAccessory() { - } + private final String mManufacturer; + private final String mModel; + private final String mType; + private final String mVersion; /** * UsbAccessory should only be instantiated by UsbService implementation diff --git a/core/java/android/hardware/UsbConstants.java b/core/java/android/hardware/usb/UsbConstants.java index 4c8c4d4..6626c9f 100644 --- a/core/java/android/hardware/UsbConstants.java +++ b/core/java/android/hardware/usb/UsbConstants.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; /** * Contains constants for the USB protocol. diff --git a/core/java/android/hardware/UsbDevice.aidl b/core/java/android/hardware/usb/UsbDevice.aidl index 6dfd43f..6030ad1 100644 --- a/core/java/android/hardware/UsbDevice.aidl +++ b/core/java/android/hardware/usb/UsbDevice.aidl @@ -14,6 +14,6 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; parcelable UsbDevice; diff --git a/core/java/android/hardware/UsbDevice.java b/core/java/android/hardware/usb/UsbDevice.java index ca7dae3..37bd82b 100644 --- a/core/java/android/hardware/UsbDevice.java +++ b/core/java/android/hardware/usb/UsbDevice.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; import android.os.Bundle; import android.os.Parcel; @@ -106,7 +106,7 @@ public final class UsbDevice implements Parcelable { /** * Returns the devices's class field. * Some useful constants for USB device classes can be found in - * {@link android.hardware.UsbConstants} + * {@link android.hardware.usb.UsbConstants} * * @return the devices's class */ @@ -133,7 +133,7 @@ public final class UsbDevice implements Parcelable { } /** - * Returns the number of {@link android.hardware.UsbInterface}s this device contains. + * Returns the number of {@link android.hardware.usb.UsbInterface}s this device contains. * * @return the number of interfaces */ @@ -142,7 +142,7 @@ public final class UsbDevice implements Parcelable { } /** - * Returns the {@link android.hardware.UsbInterface} at the given index. + * Returns the {@link android.hardware.usb.UsbInterface} at the given index. * * @return the interface */ @@ -171,9 +171,9 @@ public final class UsbDevice implements Parcelable { } /** - * Claims exclusive access to a {@link android.hardware.UsbInterface}. + * Claims exclusive access to a {@link android.hardware.usb.UsbInterface}. * This must be done before sending or receiving data on any - * {@link android.hardware.UsbEndpoint}s belonging to the interface + * {@link android.hardware.usb.UsbEndpoint}s belonging to the interface * @param intf the interface to claim * @param force true to disconnect kernel driver if necessary * @return true if the interface was successfully claimed @@ -183,7 +183,7 @@ public final class UsbDevice implements Parcelable { } /** - * Releases exclusive access to a {@link android.hardware.UsbInterface}. + * Releases exclusive access to a {@link android.hardware.usb.UsbInterface}. * * @return true if the interface was successfully released */ @@ -231,11 +231,12 @@ public final class UsbDevice implements Parcelable { } /** - * Waits for the result of a {@link android.hardware.UsbRequest#queue} operation - * Note that this may return requests queued on multiple {@link android.hardware.UsbEndpoint}s. - * When multiple endpoints are in use, {@link android.hardware.UsbRequest#getEndpoint} and - * {@link android.hardware.UsbRequest#getClientData} can be useful in determining how to process - * the result of this function. + * Waits for the result of a {@link android.hardware.usb.UsbRequest#queue} operation + * Note that this may return requests queued on multiple + * {@link android.hardware.usb.UsbEndpoint}s. + * When multiple endpoints are in use, {@link android.hardware.usb.UsbRequest#getEndpoint} and + * {@link android.hardware.usb.UsbRequest#getClientData} can be useful in determining + * how to process the result of this function. * * @return a completed USB request, or null if an error occurred */ diff --git a/core/java/android/hardware/UsbEndpoint.aidl b/core/java/android/hardware/usb/UsbEndpoint.aidl index 51fc67b..a75cd7e 100644 --- a/core/java/android/hardware/UsbEndpoint.aidl +++ b/core/java/android/hardware/usb/UsbEndpoint.aidl @@ -14,6 +14,6 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; parcelable UsbEndpoint; diff --git a/core/java/android/hardware/UsbEndpoint.java b/core/java/android/hardware/usb/UsbEndpoint.java index 8d4099d..a48d88f 100644 --- a/core/java/android/hardware/UsbEndpoint.java +++ b/core/java/android/hardware/usb/UsbEndpoint.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; /** - * A class representing an endpoint on a {@link android.hardware.UsbInterface}. + * A class representing an endpoint on a {@link android.hardware.usb.UsbInterface}. */ public final class UsbEndpoint implements Parcelable { @@ -65,9 +65,9 @@ public final class UsbEndpoint implements Parcelable { /** * Returns the endpoint's direction. - * Returns {@link android.hardware.UsbConstants#USB_DIR_OUT} + * Returns {@link android.hardware.usb.UsbConstants#USB_DIR_OUT} * if the direction is host to device, and - * {@link android.hardware.UsbConstants#USB_DIR_IN} if the + * {@link android.hardware.usb.UsbConstants#USB_DIR_IN} if the * direction is device to host. * * @return the endpoint's direction @@ -89,10 +89,10 @@ public final class UsbEndpoint implements Parcelable { * Returns the endpoint's type. * Possible results are: * <ul> - * <li>{@link android.hardware.UsbConstants#USB_ENDPOINT_XFER_CONTROL} (endpoint zero) - * <li>{@link android.hardware.UsbConstants#USB_ENDPOINT_XFER_ISOC} (isochronous endpoint) - * <li>{@link android.hardware.UsbConstants#USB_ENDPOINT_XFER_BULK} (bulk endpoint) - * <li>{@link android.hardware.UsbConstants#USB_ENDPOINT_XFER_INT} (interrupt endpoint) + * <li>{@link android.hardware.usb.UsbConstants#USB_ENDPOINT_XFER_CONTROL} (endpoint zero) + * <li>{@link android.hardware.usb.UsbConstants#USB_ENDPOINT_XFER_ISOC} (isochronous endpoint) + * <li>{@link android.hardware.usb.UsbConstants#USB_ENDPOINT_XFER_BULK} (bulk endpoint) + * <li>{@link android.hardware.usb.UsbConstants#USB_ENDPOINT_XFER_INT} (interrupt endpoint) * </ul> * * @return the endpoint's type @@ -120,7 +120,7 @@ public final class UsbEndpoint implements Parcelable { } /** - * Returns the {@link android.hardware.UsbInterface} this endpoint belongs to. + * Returns the {@link android.hardware.usb.UsbInterface} this endpoint belongs to. * * @return the endpoint's interface */ @@ -129,7 +129,7 @@ public final class UsbEndpoint implements Parcelable { } /** - * Returns the {@link android.hardware.UsbDevice} this endpoint belongs to. + * Returns the {@link android.hardware.usb.UsbDevice} this endpoint belongs to. * * @return the endpoint's device */ diff --git a/core/java/android/hardware/UsbInterface.aidl b/core/java/android/hardware/usb/UsbInterface.aidl index a715ccd..32b8c64 100644 --- a/core/java/android/hardware/UsbInterface.aidl +++ b/core/java/android/hardware/usb/UsbInterface.aidl @@ -14,6 +14,6 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; parcelable UsbInterface; diff --git a/core/java/android/hardware/UsbInterface.java b/core/java/android/hardware/usb/UsbInterface.java index deef81f..b3b0e81 100644 --- a/core/java/android/hardware/UsbInterface.java +++ b/core/java/android/hardware/usb/UsbInterface.java @@ -14,16 +14,16 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; /** - * A class representing an interface on a {@link android.hardware.UsbDevice}. + * A class representing an interface on a {@link android.hardware.usb.UsbDevice}. */ -public final class UsbInterface implements Parcelable { +public class UsbInterface implements Parcelable { private int mId; private int mClass; @@ -60,7 +60,7 @@ public final class UsbInterface implements Parcelable { /** * Returns the interface's class field. * Some useful constants for USB classes can be found in - * {@link android.hardware.UsbConstants} + * {@link android.hardware.usb.UsbConstants} * * @return the interface's class */ @@ -87,7 +87,7 @@ public final class UsbInterface implements Parcelable { } /** - * Returns the number of {@link android.hardware.UsbEndpoint}s this interface contains. + * Returns the number of {@link android.hardware.usb.UsbEndpoint}s this interface contains. * * @return the number of endpoints */ @@ -96,7 +96,7 @@ public final class UsbInterface implements Parcelable { } /** - * Returns the {@link android.hardware.UsbEndpoint} at the given index. + * Returns the {@link android.hardware.usb.UsbEndpoint} at the given index. * * @return the endpoint */ @@ -105,7 +105,7 @@ public final class UsbInterface implements Parcelable { } /** - * Returns the {@link android.hardware.UsbDevice} this interface belongs to. + * Returns the {@link android.hardware.usb.UsbDevice} this interface belongs to. * * @return the interface's device */ diff --git a/core/java/android/hardware/UsbManager.java b/core/java/android/hardware/usb/UsbManager.java index e9a34ea..6683179 100644 --- a/core/java/android/hardware/UsbManager.java +++ b/core/java/android/hardware/usb/UsbManager.java @@ -15,7 +15,7 @@ */ -package android.hardware; +package android.hardware.usb; import android.os.Bundle; import android.os.ParcelFileDescriptor; @@ -55,55 +55,55 @@ public class UsbManager { * </ul> */ public static final String ACTION_USB_STATE = - "android.hardware.action.USB_STATE"; + "android.hardware.usb.action.USB_STATE"; /** * Broadcast Action: A broadcast for USB device attached event. * * This intent is sent when a USB device is attached to the USB bus when in host mode. * <ul> - * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} + * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.usb.UsbDevice} * for the attached device * </ul> */ public static final String ACTION_USB_DEVICE_ATTACHED = - "android.hardware.action.USB_DEVICE_ATTACHED"; + "android.hardware.usb.action.USB_DEVICE_ATTACHED"; /** * Broadcast Action: A broadcast for USB device detached event. * * This intent is sent when a USB device is detached from the USB bus when in host mode. * <ul> - * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.UsbDevice} + * <li> {@link #EXTRA_DEVICE} containing the {@link android.hardware.usb.UsbDevice} * for the detached device * </ul> */ public static final String ACTION_USB_DEVICE_DETACHED = - "android.hardware.action.USB_DEVICE_DETACHED"; + "android.hardware.usb.action.USB_DEVICE_DETACHED"; /** * Broadcast Action: A broadcast for USB accessory attached event. * * This intent is sent when a USB accessory is attached. * <ul> - * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.UsbAccessory} + * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.usb.UsbAccessory} * for the attached accessory * </ul> */ public static final String ACTION_USB_ACCESSORY_ATTACHED = - "android.hardware.action.USB_ACCESSORY_ATTACHED"; + "android.hardware.usb.action.USB_ACCESSORY_ATTACHED"; /** * Broadcast Action: A broadcast for USB accessory detached event. * * This intent is sent when a USB accessory is detached. * <ul> - * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.UsbAccessory} + * <li> {@link #EXTRA_ACCESSORY} containing the {@link android.hardware.usb.UsbAccessory} * for the attached accessory that was detached * </ul> */ public static final String ACTION_USB_ACCESSORY_DETACHED = - "android.hardware.action.USB_ACCESSORY_DETACHED"; + "android.hardware.usb.action.USB_ACCESSORY_DETACHED"; /** * Boolean extra indicating whether USB is connected or disconnected. @@ -210,7 +210,7 @@ public class UsbManager { /** * Opens the device so it can be used to send and receive - * data using {@link android.hardware.UsbRequest}. + * data using {@link android.hardware.usb.UsbRequest}. * * @param device the device to open * @return true if we successfully opened the device diff --git a/core/java/android/hardware/UsbRequest.java b/core/java/android/hardware/usb/UsbRequest.java index ae3a289..80085c1 100644 --- a/core/java/android/hardware/UsbRequest.java +++ b/core/java/android/hardware/usb/UsbRequest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package android.hardware; +package android.hardware.usb; import android.util.Log; @@ -23,9 +23,9 @@ import java.nio.ByteBuffer; /** * A class representing USB request packet. * This can be used for both reading and writing data to or from a - * {@link android.hardware.UsbDevice}. + * {@link android.hardware.usb.UsbDevice}. * UsbRequests are sent asynchronously via {@link #queue} and the results - * are read by {@link android.hardware.UsbDevice#requestWait}. + * are read by {@link android.hardware.usb.UsbDevice#requestWait}. */ public class UsbRequest { @@ -94,7 +94,7 @@ public class UsbRequest { * This can be used in conjunction with {@link #setClientData} * to associate another object with this request, which can be useful for * maintaining state between calls to {@link #queue} and - * {@link android.hardware.UsbDevice#requestWait} + * {@link android.hardware.usb.UsbDevice#requestWait} * * @return the client data for the request */ @@ -107,7 +107,7 @@ public class UsbRequest { * This can be used in conjunction with {@link #getClientData} * to associate another object with this request, which can be useful for * maintaining state between calls to {@link #queue} and - * {@link android.hardware.UsbDevice#requestWait} + * {@link android.hardware.usb.UsbDevice#requestWait} * * @param data the client data for the request */ @@ -121,7 +121,7 @@ public class UsbRequest { * For IN endpoints, the endpoint will attempt to read the given number of bytes * into the specified buffer. * If the queueing operation is successful, we return true and the result will be - * returned via {@link android.hardware.UsbDevice#requestWait} + * returned via {@link android.hardware.usb.UsbDevice#requestWait} * * @param buffer the buffer containing the bytes to write, or location to store * the results of a read |