One can select USB function in Settings->System->
Developer options->Default USB configuration without
a cable connected, and the selected function will be
the default function after re-connecting. However, this
function might be restored to NONE due to ENUMERATION_TIMEOUT
if one selected the function without a cable connected.
When the device is not connected to a host, we should not
queue the ENUMERATION_TIMEOUT while switching function.
Fix it by checking connected status and also make it switch
to corresponding function if an user has selected one in the
Default USB configuration.
Bug: 150422683
Test: Switch functions from Default USB configuration for the
both cases cable connecting and disconnecting. And also try it
while there is the secure lock.
Signed-off-by: Puma Hsu <pumahsu@google.com>
Change-Id: I1933c098e47496b8d6813a5a4e295bcf12027401
There's some weird state where if persist.sys.usb.config=none,adb, then
adbd won't get started. Give back adbd start permissions to
UsbDeviceManager to see if that fixes the issue.
Bug: 150130503
Test: adb shell su 0 setprop persist.sys.usb.config none,adb; adb reboot
adb should be online after.
Change-Id: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d
Merged-In: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d
Exempt-From-Owner-Approval: Fix adbd offline failure
There's some weird state where if persist.sys.usb.config=none,adb, then
adbd won't get started. Give back adbd start permissions to
UsbDeviceManager to see if that fixes the issue.
Bug: 150130503
Bug: 150116813
Test: adb shell su 0 setprop persist.sys.usb.config none,adb; adb reboot
adb should be online after.
Change-Id: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d
Exempt-From-Owner-Approval: Fix adbd offline failure
(cherry picked from commit 7a3800993df55f87ce6493bf304730b9ffd91ad5)
This CL has a couple of notable changes:
- Add communication layer between adbd, system server, and Settings UI
- Add system notification (Wireless debugging connected) when at least
one device is connected.
- Add trusted networks (BSSID) to the keystore.
- Changed the keystore format to:
<keyStore version="1">
<adbKey ... />
<wifiAP ... />
</keyStore>
- Currently, trusted networks don't have a expiration time. Also, only
way to clear it is by blowing up the keystore (revoke permissions).
- Add pairing mechanism:
- Using libadbwifi_pairing_connection C++ library to pair a device
using SPAKE2 protocol over TLS.
- Register MDNS service for client discovery.
- Removed ability to ctl.start/stop adbd from UsbDeviceManager
- AdbService now controls when to do this
Bug: 111434128, 119490154, 119492574
Test: Manual. From developer options:
1) USB debugging off, WiFi Debugging off
- Ensure both transports are disabled by trying to connect via WiFi and
USB.
2) USB debugging on, WiFi Debugging off
- Connections via USB are available, WiFi is disabled
3) USB debugging off, WiFi Debugging on
- Connections via WiFi are available (IP + port), USB is not available
4) USB debugging on, WiFi Debugging on
- Check both transports work
Change-Id: I9f87679d195da99a55b6faf7131da1f1af65fe01
Exempt-From-Owner-Approval: approved in aosp master
(cherry picked from commit a5969b5a1d9fe08783c32ea23bead56252a74383)
This CL has a couple of notable changes:
- Add communication layer between adbd, system server, and Settings UI
- Add system notification (Wireless debugging connected) when at least
one device is connected.
- Add trusted networks (BSSID) to the keystore.
- Changed the keystore format to:
<keyStore version="1">
<adbKey ... />
<wifiAP ... />
</keyStore>
- Currently, trusted networks don't have a expiration time. Also, only
way to clear it is by blowing up the keystore (revoke permissions).
- Add pairing mechanism:
- Using libadbwifi_pairing_connection C++ library to pair a device
using SPAKE2 protocol over TLS.
- Register MDNS service for client discovery.
- Removed ability to ctl.start/stop adbd from UsbDeviceManager
- AdbService now controls when to do this
Bug: 111434128, 119490154, 119492574
Test: Manual. From developer options:
1) USB debugging off, WiFi Debugging off
- Ensure both transports are disabled by trying to connect via WiFi and
USB.
2) USB debugging on, WiFi Debugging off
- Connections via USB are available, WiFi is disabled
3) USB debugging off, WiFi Debugging on
- Connections via WiFi are available (IP + port), USB is not available
4) USB debugging on, WiFi Debugging on
- Check both transports work
Change-Id: I9f87679d195da99a55b6faf7131da1f1af65fe01
Merged-In: I9f87679d195da99a55b6faf7131da1f1af65fe01
Exempt-From-Owner-Approval: already approved
Since wireless debugging can be enabled without usb debugging enabled,
we'll need to differentiate between which transport is enabled.
Also added the internal AdbManager stubs for wireless debugging. Adding
implementation in separate CL to get around merge conflict with a SysUI
CL in the stack.
BUG: b/111434128
Test: make
Exempt-From-Owner-Approval: already approved
Change-Id: I4e1ae6398f291f321e61e7eb119564ebd5e54c2e
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by
*StatsLog.java
that is autogenerated for each module.
This CL replaces some usages of StatsLog with
FrameworkStatsLog.
Bug: 145952197
Test: m
Change-Id: Ic3b9d02ee33e8d94fdbe4e324ceb6db13fe3d2dc
USB Gadget V1.1 HAL supports USB port reset interface.
Bug: 138702846
Test: build pass, function works
Change-Id: Ia4b3b85bb0ce74307599832f849d3e23c2546187
When UsbSerialReader checks for package it needs to request package for
the calling user, because UsbSerialReader runs in system_proccess under
u0 and the calling package may not be installed for that user.
Fixes: 146079090
Test: flash and verify that UsbDevice#getSerial() returns correct string
(used to return null before the fix)
Change-Id: I637673165dd364f4728e587a59897184ea5b5620
... in preparation for creating a stub library from services.jar
Bug: 139391334
Test: m
Exempt-From-Owner-Approval: cherry-pick from internal
Merged-In: Ifd6cfc77acf2284804a2f64011c2733b5c222369
(cherry picked from commit bae2e907966dce0cb3eaf3e3a81cca4364b7d941)
Change-Id: Ifd6cfc77acf2284804a2f64011c2733b5c222369
UVC clients need to acquire the CAMERA permission
before trying to call open. The permission check is
currently done via calls to "checkCallingPermission".
In case the calling identity gets cleared, the check
will always fail. To resolve this, use "checkPermission"
with appropriate identity arguments.
Bug: 144433314
Test: Manual using application,
CtsVerifier USB Device test
Change-Id: I5318fbb4426bec1448ecc398c86ea96500bb3189
Merged-In: I5318fbb4426bec1448ecc398c86ea96500bb3189
UVC clients need to acquire the CAMERA permission
before trying to call open. The permission check is
currently done via calls to "checkCallingPermission".
In case the calling identity gets cleared, the check
will always fail. To resolve this, use "checkPermission"
with appropriate identity arguments.
Bug: 144433314
Test: Manual using application,
CtsVerifier USB Device test
Change-Id: I5318fbb4426bec1448ecc398c86ea96500bb3189
Also add mHasVideoCapture and mHasVideoPlayback members to UsbDevice.
Bug: 142321590
Test: Build, flash, connect USB Video Camera, examine logs
Change-Id: Ia6ae687182ec0b007c1688478545829395191984
To support, adding members to UsbDevice to mark devices as having audio
playback and audio capture capabilities.
Bug: 136080195
Test: Run "UsbAccess" test bed. Connect audio and non-audio USB devices
and see the additional prompt shown/not-shown.
Change-Id: Ie7c614d9ed30a163c350b18a54b8a9115698779d
When a device is connected the user might be prompted with
a dialog to launch an application. This change creates the
api that the system UI will use to give the user a
"deny [for this device+package] and remember" option.
Test: Manual:
Edit usb_device_manager.xml and observe correct behavior
Call new methods and observe correct changes in xml file
Bug: 136496922
Change-Id: I20e377d601ec11b8d42c79e4c726b9a4cb68c8b0
Bug: 136083296
Test: build, flash, connect USB interface, examine logs
Test: No regressions for normal audio playback w/ Presonus, USB-C
Headset.
Note that since this ONLY modifies the interfaces enumerated in the
UsbHost API, it has no effect on normal, framework access to USB Audio.
Change-Id: Ib7d4c83744dfb0961360749c01b008aa9ab9baa2
Previously a package could only get automatically granted USB
permission for a given device if it was the default app to launch
when the device is connected. This means only one package can
be granted automatically and it must be started on connection.
This change introduces a new usb permission mechanism which is meant
to separate the auto launch from usb permission so that multiple
packages can have permission without prompting the user.
The temporary usb permissions still work.
Test: edit usb_permissions.xml on device to allow, reboot,
connect usb headphones, deny launch dialog, open test app,
assert usb permission already granted.
Test: Check complement behavior to previous test, assert permission
not granted by default if not in usb_device_manager.xml or
explicitly denied in usb_device_manager.xml.
Bug: 136496922
Change-Id: I005d7470f1e6642d683c953a914f65f16ff7e1bb
Added framework to (eventually) parse video interface descriptors,
but at least not report errors/warnings when encountering them.
Centralizing control of logging towards making it a run-time option.
Bug: 124374863
Test: build, flash, connect USB device, pull and examine log...
run "adb shell dumpsys usb dump-descriptors -dump-list",
examine output, use device with JavaRecorder app.
Change-Id: I5d039b51c321d6ceb33a803f78e71f00908f1d69
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 b83cf0c7f14a05a4ba9fef5aa0f95cdb75bc9b28.
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