History log of /frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fe9a53bc45fd0124a876dc0a49680aaf86641d3e 31-Mar-2017 Jeff Sharkey <jsharkey@android.com> Consistent dump() permission checking.

This change introduces new methods on DumpUtils that can check if the
caller has DUMP and/or PACKAGE_USAGE_STATS access. It then moves all
existing dump() methods to use these checks so that we emit
consistent error messages.

Test: cts-tradefed run commandAndExit cts-dev -m CtsSecurityTestCases -t android.security.cts.ServicePermissionsTest
Bug: 32806790
Change-Id: Iaff6b9506818ee082b1e169c89ebe1001b3bfeca
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
7a396be6d5ba8914933a54b5bfac25e118db0e9f 13-Oct-2016 Jerry Zhang <zhangjerry@google.com> Refactored setCurrentFunction and setUsbDataUnlocked into single method.

This gets rid of an extraneous configuration change when going from
adb to adb + file transfer as previously the config would have been
reset once for functions and once for data unlocked.

It also simplifies some of the code.

Test: manually changing usb configurations
Change-Id: Ica10a195338b2189db13113f44657393db110bee
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
880389e6cc8044f751dd8569f2172ca61eaf2cd3 10-Oct-2016 Philip P. Moltmann <moltmann@google.com> Clear USB device defaults when user is removed

If a user is removed it is either the parent user of the profile or a
child user. If the parent is removed the whole profile group settings
are removed, but if only a child user is removed we have to remove the
user settings from the groups settings.

Test: Registered a USB device default for a child and parent user and
removed them. Checked dumpsys usb before and after
Fixes: 31995672

Change-Id: I984cd294dc01437b042687684c058eb79332f520
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
a6bf206649b24cabcf1348219e1b00f38214e06a 10-Sep-2016 Philip P. Moltmann <moltmann@google.com> Make default USB handling apps per profile group.

If a USB device is plugged in a default app might be started. As the
user does not indicate which profile he is interested in by pluggin in a
USB device, all handling of this operation has to be per default group.

To do this Split UsbUserSettingsManager into UsbUserSettingsManager and
UsbProfileGroupSettingsManager and modify
UsbProfileGroupSettingsManager.

Bug: 29233186
Change-Id: I8e56b621eeb802966504360d372a8a0140106114
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
031cee90a350b7be93ef939630b277cfb28c171b 07-Sep-2016 Philip P. Moltmann <moltmann@google.com> Allow connection from secondary profiles

... and send device-attached broadcasts to all apps instead of just the
current user.

Note: Usb*Manager.open* needs to be called with the identity of the
app.

Bug: 29233186
Change-Id: I225c47bdb409eee1c8fe0499d600fded470aa101
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
badbbae6fa2846415778b2a152a0758acbf0eb74 05-Jan-2016 Keun-young Park <keunyoung@google.com> allow external USB host management

- Setting config_UsbDeviceConnectionHandling_component leads into
launching specified Activity whenever USB device is connected.
- This allows external Activity to manage USB device based on
its own setup and settings.
- Device access can be passed to other app with permission update
by UsbManager.grantPermission.
- added UsbDeviceConnection.resetDevice() to reset USB device connected.
This is necessary to get device out from AOAP.
- Test requires installing UsbHostExternalManagmentTestApp and
AoapTestHost to USB host, and AoapTestDevice to USB Device.

bug: 26404209
Change-Id: I8e77ddc646c15454d9b2ecf1356924cf6351fc28
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
1913ae958c7ee20466fffe3d9c6e5b820760ca41 04-Aug-2015 Nick Kralevich <nnk@google.com> am 8ad7c8f9: am 94933e43: am 2eafb06f: am b2c71814: am 97b68bbe: Merge "UsbDeviceManager: fix b/21429947 regression (try #2)" into mnc-dev

* commit '8ad7c8f9553611798fa39ff20cea3313c5b64922':
UsbDeviceManager: fix b/21429947 regression (try #2)
1a008c1ca04871386830f511ee4b47299b92b01f 31-Jul-2015 Nick Kralevich <nnk@google.com> UsbDeviceManager: fix b/21429947 regression (try #2)

As discussed in b/21429947 (commit
674019065bceb4150190bfb1aa63cda9de0a8560), MTP must always be
enabled, even if access to the underlying MTP data is disabled.
Otherwise, Android will not enumerate on the USB bus, and won't
receive notifications from the kernel about USB state changes. This
effectively prevents using MTP functionality on user builds, or
on userdebug/eng builds with adb turned off.

Always ensure that MTP is the default driver mode.

Move the DISALLOW_USB_FILE_TRANSFER filtering of mUsbDataUnlocked from
setting time to the time we post the sticky broadcast.

Remove isUsbDataUnlocked(). It essentially duplicates data in the sticky
broadcast.

Bug: 22447614
Bug: 21429947
Change-Id: I9d0d94cadbf6db6281ebd77bfb7162f9d06520c2
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
233d94c0df13a7e54f738f442457cebc62294384 31-Jul-2015 Xiaohui Chen <xiaohuic@google.com> clean up UserHandle.USER_OWNER reference

cleaning up a few in framework/base/services.

Bug: 19913735
Change-Id: I1af5f24d9b39d6712ad3a665effa6166e32ce3d3
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
76c4c6668a1486bc003ab0c585bb1f41d16e27a7 07-Jul-2015 Jeff Brown <jeffbrown@google.com> Add USB port manager.

Add some new internal APIs to enumerate USB Type C ports, query their
status, determine whether they support changing power or data roles,
and doing so. The API also adds a new ACTION_USB_PORT_CHANGED broadcast
for port state changes.

The implementation includes a mechanism for simulating the behavior
of the USB stack. See 'adb shell dumpsys usb -h' for details.

Note that the underlying kernel driver interface is still subject
to change but its behavior has been encapsulated as much as possible.

Bug: 21615151
Change-Id: I0c853ae179248a4550b3e60d02a7a7e65e4546b2
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
2dbccc1926ea2d3e27c5cfd2d61d2b3d5ed787c0 07-Jul-2015 Jeff Brown <jeffbrown@google.com> Clean up USB Manager dump.

Tidy up the dump() implementation in preparation for further work.

Bug: 21615151
Change-Id: If6d94c8dc9457b8e93103541ec1798981eeb5b54
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
2a67840c3c35a6267663e5d3ae921ee9ac614db9 09-Jul-2015 Jeff Brown <jeffbrown@google.com> Fix a bad merge.

Change-Id: Ib722459a25c189bb800eb85d48b80bdc91a2b7db
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
c1aebfa02c393471fb344c3a94ee2ae62bb78f93 09-Jul-2015 Jeff Brown <jeffbrown@google.com> Merge "Clean up USB Manager and fix ADB." into mnc-dev
460a146eb8f827e4e70f2dd93d1ba852d0feb06b 01-Jul-2015 Jeff Brown <jeffbrown@google.com> Clean up USB Manager and fix ADB.

Moved functions which parse the USB functions list into one common
place on UsbManager.

Deleted the no longer supported USB_FUNCTION_MASS_STORAGE.

Ensured that the UserManager.DISALLOW_USB_FILE_TRANSFER rule is
consistently applied during user switch and when changing the
current USB functions and make sure it only affects MTP and PTP.

Collapsed the boot completed and user switched receivers to
ensure consistent ordering of side-effects.

Validate the list of functions passed to setCurrentFunction() so
that the separation of concerns is clearer. It was somewhat
ambiguous as to whether functions such as ADB could / should be
enabled through that interface. Improved the docs for clarity.

Fixed a bunch of broken stuff related to the USB config
persistent property (list of default functions) that could cause
ADB and other functions to not work at all. Added new failsafes
to ensure that we reliably get back into a happy state.

Bug: 22206076
Change-Id: I02915ddfce7193a8f67a14f0d76bab22fc575dfa
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
b2eb6b9049567c134d7654f6cd79b4a47de643af 07-Jul-2015 Zoltan Szatmary-Ban <szatmz@google.com> Prevent accidental unlocking of USB data transfer.

When DISALLOW_USB_FILE_TRANSFER is in effect, there must be no chance to
unlock data transfer over USB.

Bug: 22291579
Change-Id: I990fedbfeecd90e7dd26981034d0352b83dc694e
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
674019065bceb4150190bfb1aa63cda9de0a8560 10-Jun-2015 Nick Kralevich <nnk@google.com> Fix USB access control when adb is disabled.

When adb is disabled, the default usb mode would be "none", which
would turn off the driver and prevent UsbDeviceManager from receiving
any new USB connect / disconnect messages. This prevents the user
from ever enabling MTP and sharing data when adb is turned off.

As discussed in bug 21429947, we work around this problem by keeping
the USB driver in MTP mode most of the time, so that we continue to
receive USB connect / disconnect messages.

To avoid leaking confidential user photos, this change introduces an
unlocked state. Setting the mtp enabled function is now decoupled from
exposing data on the USB connection. Only if MTP is enabled and
USB data has been unlocked is confidential user data allowed to be
shared.

Bug: 21429947
Change-Id: Iefb5c7e22dc4962bf5226f2ed3d0155b5c7b413c
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
fcf10f7c12cb3107bdfedce6f76a8c866d154f3c 13-May-2015 Nick Kralevich <nnk@google.com> Modify how USB connections are handled.

* Introduce a new "charger only" mode. In this mode, MTP is disabled,
and no file transfers can occur.
* Make charger only mode the default.
* Modify "persist.sys.usb.config" so it now only holds the adb status.
* Make the USB settings non-persistent. Unplugging the USB connection will
reset the device back to "charger only" mode.
* Fixup wording per UI guidelines.

TODO: Re-implement MDM restrictions for USB / MTP access controls.

Bug: 18905620
Change-Id: I99a50d9132a81e98187f431166fd9fef4d437e4f
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
d9c7f2456957a5610cbbca1b2e31aa7b3574c50d 10-May-2015 Nick Kralevich <nnk@google.com> UsbManager / UsbService / UsbDeviceManager: delete unused code

These functions are never called.

Change-Id: Ic436e1036bed717d2c64701fddd9a810abb9443e
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
2e3434149e00f921ca3555ae55cba04d3c64eeb1 08-Jan-2015 Mike Lockwood <lockwood@google.com> Replace broadcasts with calls to IAudioService.setWiredDeviceConnectionState() to report USB device status

Change-Id: Ic96cffaa63b6c6350b76e7cb29398c5f5dc86962
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
1848d31c2cbb5404be383ad44049e58e36b258ba 26-Jun-2014 Emily Bernier <ember@google.com> Prevent users from mounting USB, if restricted.

Bug: 13585295

Change-Id: I6b7905fad06bf2e1d4dd629a266280ddff9b3121
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java
2cb6c60c0d2de3bc743c043aca963db6fe52662f 15-Feb-2014 Adam Lesinski <adamlesinski@google.com> Make UsbService optional

Tweaked the services Android.mk to build dependencies
when building with mm[m].

Change-Id: I6dad511c652bcacc085f27ede5f8f22a6982c6bd
/frameworks/base/services/usb/java/com/android/server/usb/UsbService.java