History log of /frameworks/base/core/java/android/hardware/usb/UsbRequest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8f9ae8ec8ea01c080d37e2249b4116f7466987ba 07-Apr-2017 Philip P. Moltmann <moltmann@google.com> Merge "Change requestWait API according to request" into oc-dev am: ca687ac39a
am: a89137545b

Change-Id: I918d16f7dd81ec641b023f3a19a0c3aeab984e1d
9b6dd2b2c15113bf9c30a1915f3354c52cb60c33 07-Apr-2017 Philip P. Moltmann <moltmann@google.com> Change requestWait API according to request

Test: USB Device CTSVerifier test
Change-Id: Ib55bed248d7b37c6f5f4a7be7ec2d90a7ac396c7
Fixes: 36555805
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
1163568d7c5f0cdbfd9e0a9b93ed5209bc2614bd 04-Apr-2017 Narayan Kamath <narayan@google.com> Merge "Properly guard access to CloseGuard in finalizers."
91ed33b03292eb65f88175813875b12ba9a7eb51 03-Apr-2017 Philip P. Moltmann <moltmann@google.com> Rename UsbRequest.enqueue to UsbRequest.queue

Fixes: 36850572
Test: CtsVerifier USB device tests on angler
Change-Id: If2a376a8615bf2aa24a6d3a30c7d0a29365f52ea
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
492e9e851cadca62df84eaff1a3c1ba788492fba 22-Mar-2017 Narayan Kamath <narayan@google.com> Properly guard access to CloseGuard in finalizers.

CloseGuard instances are allocated in constructors and usually
assigned to final fields. This implies they're non-null in finalizers
except in the case where the constructor throws. We add a null check
to make sure we can continue cleaning up other state in the finalizer
(if applicable).

Also, this change decouples closeguard warnings in constructors
from other state based logic. This because the logic there is usually
duplicated with the call to close().

NOTE: This change is not a "complete" fix. Many of these finalizers
are broken in the case where <init> throws. The only objective of
this change is to make such errors more obvious.

Note that some of these classes don't have CTS tests.

Test: make, CtsMediaTestCases.
Bug: 35609098

Change-Id: I24d9e0215f80e44914dba8ab99b6312fd6ed1fc0
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
08b678c0299153e4843e637ed29d5404dae54b4f 19-Oct-2016 Philip P. Moltmann <moltmann@google.com> Correctly use ByteBuffer in UsbRequest

Meaning: Read/Write to correct area in buffer, set position correectly.

- Create a new method UsbRequest#enqueue that has correct behavior, deprecate
UsbRequest#queue.
- Move all description of the weird (legacy) UsbRequest#queue behavior to
this method.

Change-Id: Ibeed400b4ad2aa9d005ace345c7895a3dc4ba1ad
Fixes: 31050148
Test: Submitted alongside
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
5dd4e6cf74aef41147eb8eb239f1c9c0df1baf73 24-Sep-2016 Philip P. Moltmann <moltmann@google.com> Clarify the behavior of UsbRequest

This is obviously just about describing a bad behavior. In the next step
these methods should be deprecated and replaced with versions that deal
with ByteBuffers appropriately.

Bug: 31050148
Test: Test that enshrines the documented behavior is submitted alongside
this change
Change-Id: If250a8bbd636784355e839a1638d52f3bbe9b83d
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
4346f3c5ec7bc9a5d6cced81c0d7584d69d7397a 15-Sep-2016 Philip P. Moltmann <moltmann@google.com> Set buffer before UsbRequest is queued

Otherwise a second thread might dequeue() it in between
native_queue_direct and mBuffer = buffer. If that happens the dequeue
operation does mBuffer.isDirect which triggers a NPE.

Fixes: 30914003
Change-Id: I3ca3b72db8f53a14be1c5f0e37f8924eba44b9bc
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
674e8c3825032833e5169439a97356e2ad450712 29-Aug-2016 Philip P. Moltmann <moltmann@google.com> Do not leak usb device connection FD

The native code uses mNativeContext=0 to indicate that is was already
closed and checks this properly. Hence let's leave the checking in the
native code.

We need to keep a reference in UsbRequest as otherwise the
UsbDeviceConnection might get finalized while a UsbRequest is in
progress. The UsbRequest itself makes sure that it is not garbage
collected while the I/O is in progress.

Also I added CloseGuards to make sure the classes are used properly and
fixed an error string in the native code.

Fixes: 31124312
Bug: 31021315
Change-Id: I96deb73957eba0e14e6b656988a2ae9b409bf55f
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
4838e338129e09a37b8c8ad5e44f85ec5cd3aea1 03-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Use long for pointers in hardware classes

For storing pointers, long is used in hardware classes,
as native pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use
of jint instead of int in JNI function prototypes)

Change-Id: Icdeb67f9273fb2d8f6d88ca68d7f7d0950796fc1
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
a3665ba95d806fcb6780d29d49bd0f1032e8bc86 10-Aug-2012 mike wakerly <mikey@google.com> UsbRequest: set ByteBuffer.position() upon success.

Also clears allocated buffer before copying.

Closes http://b.android.com/28023

Bug: 5385026
Bug: 6766413
Change-Id: Icf2c1d45db4fb2a9bd1fcfdb29aa7308034faaf0
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
11dd5ae97b1cd5889bb66862fd12718da62a9c75 01-Apr-2011 Mike Lockwood <lockwood@android.com> Improve Javadoc for USB Manager and MTP/PTP support.

Bug: 4091519

Change-Id: Ida79593d5a984f7ffd0934ae7bded23b8faf9eef
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
acc29cc91be634070c92a807df412ced97b9b375 11-Mar-2011 Mike Lockwood <lockwood@android.com> UsbDevice: Move IO related methods to new UsbDeviceConnection class

UsbDevice is now just an immutable parcelable object like UsbInterface and
UsbEndpoint.
All IO related functionality is now contained in UsbDeviceConnection
and UsbRequest.

Bug: 4067029

Change-Id: Ia84da0b512a697acc940eee0c3566711c62e1a68
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java
c4308f01c965571dc2354107c3574df113e397ee 01-Mar-2011 Mike Lockwood <lockwood@android.com> Move USB framework support from android.hardware to android.hardware.usb package

Change-Id: I00fd4f0caaa4aebe48f71c576bb211b5f38bf88d
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/hardware/usb/UsbRequest.java