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
4 files changed