OSDN Git Service

Merge "Describe how the accessory input stream drops data"
authorTreeHugger Robot <treehugger-gerrit@google.com>
Wed, 21 Feb 2018 23:37:28 +0000 (23:37 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Wed, 21 Feb 2018 23:37:28 +0000 (23:37 +0000)
1  2 
core/java/android/hardware/usb/UsbManager.java

@@@ -454,10 -449,13 +454,14 @@@ public class UsbManager 
      /**
       * Opens a file descriptor for reading and writing data to the USB accessory.
       *
+      * <p>If data is read from the {@link java.io.InputStream} created from this file descriptor all
+      * data of a USB transfer should be read at once. If only a partial request is read the rest of
+      * the transfer is dropped.
+      *
       * @param accessory the USB accessory to open
-      * @return file descriptor, or null if the accessor could not be opened.
+      * @return file descriptor, or null if the accessory could not be opened.
       */
 +    @RequiresFeature(PackageManager.FEATURE_USB_ACCESSORY)
      public ParcelFileDescriptor openAccessory(UsbAccessory accessory) {
          try {
              return mService.openAccessory(accessory);