If 'No data transfer' mode is chosen after any other mode nothing happens,
because in case of sending 'MSG_SET_SCREEN_UNLOCKED_FUNCTIONS' message
no actions are taken to usbData.
Signed-off-by: a.lukianenko <a.lukianenko@globallogic.com>
Change-Id: I7c17a0a4275692022119a48b6d6c1550553fdceb
Created a high-importance developer notification channel for developer
messages that should notify the user with high importance. Assigned the
"USB debugging" permission to this channel.
Test: None
Fixes: 132904226
Change-Id: I9bc5361d806830d1820b8d998b4e0866462cdb37
As checking the permissions might call UsbDevice/UsbAccessory.getSerial
again, we have to make sure that in this code paths we run with the
system's identity so that we can always resolve the serial number.
Test: CtsVerifier UsbAccessory/UsbDevice test
Fixes: 117606509
Change-Id: I777be10b806ab02046f99805806ae1a16ebb0203
This reverts commit b83cf0c7f1.
Reason for revert: This changes breaks connection to ALL USB Audio interface. Camera audio should be investigat
Bug: 124374863
Bug: 133501871
Change-Id: I19fed05c0b5f4227f88df3ac17ddd5ebe4246f3d
Specifically for the Sony PS4 controller.
Bug: 129697606
Test: Build, install, plug in PS4 contoller, note audio continues to route to device speaker.
Change-Id: I20f5cafb616b4a673772f8e4614e1efa8ae0edb4
Contaminant detection is re-enabled when the disconnected port's
portStatus has contaminant detection disabled. During port removal,
there is no reason why contamiant detection has to re-enabled since
the port is anyways being teared down.
Bug: 129696344
Test: dumpsys usb add-port "matrix" ufp;
dumpsys usb remove-port "matrix" ufp
Change-Id: Ie146db82d93414e90ee99b4d17ec0ba5ada2ce83
Every USB device that has CS_INTERFACE descriptor was incorrectly
assumed to be an UAC device, without checking the device class.
This led to incorrect parsing of UVC devices, which also have
CS_INTERFACE type descriptors. For some devices the parsing worked
by coincidence, for others it lead to incorrect device data (wrong
vid, pid, etc).
This change parses every CS_INTERFACE descriptor that does not belong
to an UAC device as type 'Unknown'.
Test: Connect a UVC camera, observe logcat. Before this change, there
were lots of parsing errors in logcat, now the device is added cleanly.
Bug: 124374863
Change-Id: Ic076438625a733cffa9ae51ba803e353fd064ceb
Signed-off-by: Kamen Kirov <knk@pupil-labs.com>
While checking for possible role combinations, the SINK/HOST combination
seems to be mistakenly checked twice intead of SINK/DEVICE.
This CL fixes this. The code now checks for:
1. source & host
2. sink & host
3. source & device
4. sink & device
Bug: 119142682
Change-Id: I5e652fbf9313bd2c122fe728d58e577085632253
Merged-In: I5e652fbf9313bd2c122fe728d58e577085632253
While checking for possible role combinations, the SINK/HOST combination
seems to be mistakenly checked twice intead of SINK/DEVICE.
This CL fixes this. The code now checks for:
1. source & host
2. sink & host
3. source & device
4. sink & device
Cherrypicked from aosp:
https://android-review.googlesource.com/c/platform/frameworks/base/+/933377
Bug: 119142682
Test: Build success
Change-Id: I5e652fbf9313bd2c122fe728d58e577085632253
SystemUI disables contaminant detection when user wants to continue
using the port. Re-enable contaminant detection when the accessory
is unplugged.
Bug: 128534822
Test: Tested with the mock circuit.
Change-Id: I22a3c839264876409c68c6a3145c9fcc6278f381
Do not show "Safe to use USB port" when contaminant detection is
disabled by the user.
Bug: 128534822
Test: Tested with the mock circuit.
Change-Id: Iebd12f04a6d8bfd7be5d673cf5a6742cf3d6f281
For any change in port status, the following needs to be done:
1. Send port changed Broadcast
2. Log to statsd
3. Update contaminant notification.
Bug: 128534822
Test: Tested with the mock circuit.
Change-Id: I2c279a2ea0255a69c0a74a98ebf5bf680cae1fe1
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.
Bug: 117924132
Test: m -j
Change-Id: I654c0e1f234d097a66f79ba8c019b8bebc794816
Merged-In: I654c0e1f234d097a66f79ba8c019b8bebc794816
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.
Bug: 117924132
Test: m -j
Change-Id: I654c0e1f234d097a66f79ba8c019b8bebc794816
Merged-In: I654c0e1f234d097a66f79ba8c019b8bebc794816
Store IUsb as V1.0 instance by default and downcast when
calling V1.2 methods.
Bug: 123498520
Test: Checked dumpsys usb to reflect port status for
V1.0, V1.2, V1.3 implementations.
Change-Id: Id55d930252bff39b3b86283f3b6ab33a5e935b24
Bug: 119642987
Bug: 117330206
Bug: 77606903
Test: Ran the following sequence:
1. Add simulated port: dumpsys usb add-port "matrix" ufp
2. Set contaminant present to true:
dumpsys usb set-contaminant-status "matrix" true
Contaminant present notifcation shows up and dialog pops up upon
clicking the notification.
3. Set contaminant present to false:
dumpsys usb set-contaminant-status "matrix" false
Contaminant present notification is dismissed and the safe to use
notification shows up.
Change-Id: I33d22caafbedb2a21a0f61f663ebddf5c9e3f84b
This CL simulates contaminant presence through simulated port.
1. Add a port: dumpsys usb add-port "matrix" ufp
2. Set contaminant presence to true: dumpsys usb set-contaminant-status "matrix" true
3. Set contaminant presence to false: dumpsys usb set-contaminant-status "matrix" false
Bug: 119642987
Bug: 117330206
Bug: 77606903
Test: Made sure that dumpsys usb reflected the correct contaminant
status.
Change-Id: Iadb0ea92db65afdb25dbd32c02d9fb778bd4ec8c
Bug: 119642987
Bug: 117330206
Bug: 77606903
Test: Manually tested for contaminant notification to show up
Change-Id: If22215df1e6127aa67190f72328fbc32b9477bc2
There is a situation that getCurrentUsbFunctions callback function will
be invoked before mCurrentUsbFunctionsRequested flag updated, thus, gadget
will be reset during boot completed. Make sure mCurrentUsbFunctionsRequested
flag be updated before getCurrentUsbFunctions callback function invoked.
Bug: 119688133
Test: Verified that gadget reset does not happen
Change-Id: Id8b58d9ccd3f62c976d1292575a06554bef622a4
Merged-In: Id8b58d9ccd3f62c976d1292575a06554bef622a4
Signed-off-by: Howard Yen <howardyen@google.com>
There is a situation that getCurrentUsbFunctions callback function will
be invoked before mCurrentUsbFunctionsRequested flag updated, thus, gadget
will be reset during boot completed. Make sure mCurrentUsbFunctionsRequested
flag be updated before getCurrentUsbFunctions callback function invoked.
Bug: 119688133
Test: Verified that gadget reset does not happen
Change-Id: Id8b58d9ccd3f62c976d1292575a06554bef622a4
Signed-off-by: Howard Yen <howardyen@google.com>
This is needed by making the setup wizard use only system-api.
Test: Built, switched USB port state
Change-Id: I8e56859a5b36e7de91691522a34f7d6f62dcbb20
Fixes: 115301401
UsbDeviceAttached is logged when the device has an audio interface.
Info such as VID, PID, whether the device has hid or mass storage
interface and the duration for which the usb device was connected
would be logged as well.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(77\)
Change-Id: I57bbfd22ef377553daa113968fe53c4fe0f8e4d2
This reverts commit 2473b08b07.
Reason for revert: Fixed build breakage
sysprop_cpp and sysprop_java directly have been linking against
libprotobuf-cpp-full and do not set proto.type field, which could
cause ASAN error due to linking against both libproto version of full
and lite.
Change-Id: I96eb47444d7b6f6b5fef092efc1514fcdd6f33b6
Merged-In: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.
Bug: 117924132
Test: m -j
Change-Id: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
Merged-In: I8e04f643197b6c8a60cc38c6979e41c5de3469f5
last_connect_duration_millis will be set to 0 for a connect event.
last_connect_duration_millis will be set to the amount of time the port
was left connected for a disconnect event.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(70\)
Change-Id: Ifd1df55fb6317e789a2b04236ce0a6e4665e3664
The following would the logged:
1. Status of the connection - connected/disconnected.
2. Port id as a device could have multiple ports.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(70\)
Change-Id: Ideea36c7745293f5b6ec9cc35fd5f709f5175d5a
onRegistration callback gets triggered as soon has the
serviceNotification object is registered with registerForNotifications.
The preexisting flag in the callback is set if the gadget hal service dies
and restarts. Use this to differentiate between the onRegistration call
for the registerForNotifications vs actual gadget hal service restart.
Do not reset usb gadget if the onRegistration callback is called as a
result of registerForNotifications. This will overcome the occasional
reset of the usb gadget hence the connection during phone bootup.
Bug: 118678530
Test: Verified that gadget reset does not happen
Change-Id: I3b94e55289bb3a53eb9e083177fd4d54bec5f4da
Also remove the "Usb" from the AIDL function since it's not really
related to USB.
Test: make
Bug: 63820489
Change-Id: Ibf23964665a115a5bc835820dcff98aaf7ba610f
This makes the AdbService the source of truth for whether ADB is enabled
on the system or not. All UsbManager checks will now query the
AdbService.
Test: make
Bug: 63820489
Change-Id: I2965a15b5fa9f747fe0ae4dc791b5e357e78253f
This doesn't do anything yet, but is needed to migrate functionality
from the USB service to the ADB service.
Bug: 63820489
Test: make
Change-Id: I402bb234a055cf0b199e0922bf92736aa659d46a
This service should not be in the USB module anymore. Move it to the
core services.
Bug: 63820489
Test: make
Change-Id: I6e07b8e3aa29fbd9d30d130ef0c882a84a12d30c
Rename the UsbDebuggingManager to AdbDebuggingManager. It doesn't
technically depend on the USB stack, so rename to make the lack of
association more clear.
Bug: 63820489
Test: make
Change-Id: Ife83d3ec9701882781f5a9562ccc5435d51d246b
First step in separating the USB and ADB stacks. The ADB functionality
does not logically need USB, so move it to its own package initially to
make further detangling more clear.
Bug: 63820489
Test: make
Change-Id: I6cf57c4ebc6ec8956cdd7ce817bdc4bcf7ff27a9