summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/usb/UsbDeviceManager.java
AgeCommit message (Collapse)Author
2013-12-19Move some system services to separate directoriesAmith Yamasani
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-06-11Explicit locale when formatting machine strings.Jeff Sharkey
Bug: 9390451 Change-Id: I3581c53407554a1dffd541fb42b06d68f20a7be0
2013-05-02Start combining threads in system process.Dianne Hackborn
This introduces four generic thread that services can use in the system process: - Background: part of the framework for all processes, for work that is purely background (no timing constraint). - UI: for time-critical display of UI. - Foreground: normal foreground work. - IO: performing IO operations. I went through and moved services into these threads in the places I felt relatively comfortable about understanding what they are doing. There are still a bunch more we need to look at -- lots of networking stuff left, 3 or so different native daemon connectors which I didn't know how much would block, audio stuff, etc. Also updated Watchdog to be aware of and check these new threads, with a new API for other threads to also participate in this checking. Change-Id: Ie2f11061cebde5f018d7383b3a910fbbd11d5e11
2013-01-28UsbDebuggingManager: Add interface to clear secure adb keysBenoit Goby
This is called from Settings that has a button to clear secure adb public keys installed on the device. Change-Id: I63ef499c049766ef13ea6cb0594ed6719f35e5f3
2013-01-25UsbDeviceManager: Don't start UsbDebuggingManager when data is encryptedBenoit Goby
This avoids showing the confirmation dialog from the decryption screen Bug: 8019508 Change-Id: I7ff364437f6b8aeea26fa8308aa4fe35b7ede5d7
2012-11-12Useful annotations for code documentation.Jeff Sharkey
Bug: 6537978 Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
2012-11-08Remove extraneous logs.Dianne Hackborn
Change-Id: I4c47d36748de91bd6fddc419afbf59552bf63e9a
2012-10-02Make USB services multi-user aware.Jeff Sharkey
USB settings are now isolated per-user, since they revolve around installed packages. User-specific settings are returned based on calling user, or referenced by UserHandle passed to SystemUI. Each settings Context is wrapped as a specific user, so all broadcasts are sent correctly. Upgrades any existing USB settings to OWNER. Physical events, like new devices, are routed to the currently active user. Switch to using AtomicFile when persisting settings. Bug: 7244888 Change-Id: I8a723ad3d55ac1bff99276c5f3a3f5e8f013432f
2012-09-25Update references to migrated global settings.Jeff Brown
Fixed one setting that was migrated but not marked deprecated. Removed a hidden setting that is no longer used by the new power manager service. Bug: 7231172 Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
2012-09-24Fix issue #7214090: Need to be able to post notifications to all usersDianne Hackborn
Also fix a bunch of system services that should be doing this. And while doing that, found I needed to fix PendingIntent to evaluate USER_CURRENT at the point of sending, not creation. Note that this may end up with us having some notification shown to non-primary users that lead to settings UI that should only be for the primary user (such as the vpn notification). I'm not sure what to do about this, maybe we need a different UI to come up there or something, but showing the actual notification for those users at least seems less broken than not telling them at all. Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
2012-09-18Multi-user MTP.Jeff Sharkey
The current MTP kernel driver at /dev/mtp_usb is exclusive, meaning only one process can have it open. In addition, each MTP session with a desktop requires unique object IDs, which doesn't hold true across users on the device. To solve these two issues, when switching users we cycle the USB host stack to disconnect both local and remote MTP connections, giving the new user's media process a chance to claim /dev/mtp_usb, and causing the desktop to initiate a new MTP session. This change also allows BroadcastReceivers to registerReceiver() allow retrieval of a current sticky broadcast. Adds a system property to override maximum users. Removes MOUNTED broadcasts for secondary users. Allows INTERACT_ACROSS_USERS to getCurrentUser(). Bug: 6925114 Change-Id: I02b4a1b535af95fb2142655887b6d15a8068d18a
2012-09-11Include user identifier in external storage paths.Jeff Sharkey
When building external storage paths, always include user in path to enable cross-user paths and aid debugging. Each Zygote process continues to only have access to the appropriate user-specific emulated storage through bind mounts. A second set of mounts continue supporting legacy /sdcard-style paths. For example, a process running as owner has these mount points: /storage/emulated_legacy /storage/emulated_legacy/Android/obb /storage/emulated/0 /storage/emulated/obb Since Environment is created before Zygote forks, we need to update its internal paths after each process launches. Bug: 7131382 Change-Id: I6f8c6971f2a8edfb415c14cb4ed05ff97e587a21
2012-08-30Improve multi-user broadcasts.Dianne Hackborn
You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
2012-08-20Add UsbDebuggingManager and UsbDebuggingActivityBenoit Goby
The UsbDebuggingManager listens to adbd requests and displays a dialog when the public key authentification fails, for the user to confirm if it wants to allow USB debugging from the attached host. If the user chooses to always allow USB debugging, the UsbDebuggingManager writes the public key to adbd's config file so that the public key authenfication succeeds next time. Change-Id: I115c828331d8e326c380844ee33915d5dff22260
2012-05-10Merge "UsbService: Fix problem detecting audio accessory mode when connected ↵Mike Lockwood
at boot" into jb-dev
2012-05-10UsbService: Fix problem detecting audio accessory mode when connected at bootMike Lockwood
Change-Id: Ie0e23b8ec88f1dd29bb956bc1d21c241f3545059 Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-05-10Show the ADB icon in the status bar again.Daniel Sandler
Bug: 6440323 Change-Id: I3b1972d18be4ad77a87c4b71673b6cfb7735c59e
2012-04-26UsbService: Add support for accessory initiating USB audio supportMike Lockwood
Change-Id: I0e468f4b841de9e1ca7b75a05fc58299dbc78222 Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-04-06Add Intents to notify when USB audio devices or accessories are attachedMike Lockwood
In this change, only the USB audio accessory support is implemented. Change-Id: Id9b411319b07a96dc56649ca74cc5f3f89a55a7c Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-03-29Stop showing ADB and MTP/PTP/USB notifications at the top.Daniel Sandler
Two parts to this: 1. Stop treating FLAG_ONGOING_EVENT notifications specially (in particular, ordering them at the top of the panel). 2. Set the priority bits on the system UI notifications appropriately (low). Change-Id: I3bde7e573654c5aad5e1c5d29e6a21ba94edcc5b
2012-03-22fix setting only usb modeRoboErik
If you cleared the last usb mode it would fail (and so would setting it if you started with none). This fixes it to set and unset the last property correctly. Change-Id: Ice5be6e57b6ca6b8c9241b0ac62071a3bc72606a
2012-02-10Add OEM specific USB mode enumeration based on ro.bootmode propertyKazuhiro Ondo
This patch is adding a capability so that OEM can override USB mode in case the device is boot up with OEM specific mode. (i.e. modem debug, factory test etc.) Bug:5964042 Change-Id: Ic8e23d302563ce71eedb74ce94cca8c65838a4f7
2011-08-24Make sure to go to the right Settings panel when tapping a notificationChristopher Tate
We now use Intent.makeRestartActivityTask() to build the notification PendingIntent objects, so that when tapped they restart the activity in the desired state. Fixes bug 5011926 Change-Id: Ie1ec3543cc0f49d1bd407622a617316cf53a078c
2011-08-16UsbManager: Use resource IDs for notification IDsMike Lockwood
to avoid ID collisions with other system services. Bug: 5161005 Change-Id: I069fbc40a8764bc85cceeacd04264abd32b62668 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-03UsbDeviceManager: Fix typo that broke adb on/off setting persistenceMike Lockwood
Bug: 5108784 Change-Id: I68ed4d442ce4d3f4651cb618902fb226ac5a3673 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-08-02USB: Fix NPE that occurred when restoring default function in ↵Mike Lockwood
UsbManager.setEnabledFunctions Bug: 5110020 Change-Id: I5e4b5c27e4675fa6830823832ae51411dc448191 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-29Clean up USB configuration switching logic and beef up error handlingMike Lockwood
Bug: 5050853 Change-Id: Ia00698e2adbb8a7d7698e2ae306413f6c715fbdb
2011-07-27UsbDeviceManager: Don't show USB notification for RNDISMike Lockwood
since USB tethering already has a notification. Bug: 4988511 Change-Id: I928cb1e1d191c77340f7f05edfa80a74cdabe6ed Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-21UsbDeviceManager: Add USB notification string for USB accessory modeMike Lockwood
Bug: 5062341 Change-Id: I93af8274e538009dd8f00d1cea782b62334e43f1 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-21USB: Fix handling USB accessory attached when device is bootingMike Lockwood
Also defer anything that could start an activity from "system ready" to "boot completed" time. Bug: 5051683 Change-Id: I69db751cb991dd247bd0ac3c70a0d84c0d71f365 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-18UsbManager: document that passing null setCurrentFunction restores default ↵Mike Lockwood
function Change-Id: I4340b336f3e91b3b8242f2a66c34a7a7f5c3021f Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13UsbDeviceManager: clean up HandlerThread creationMike Lockwood
Change-Id: I84683b1753fcf3c3b501f8a506d6d890edf2eb37 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11UsbDeviceManager: Include kernel USB state in dumpsys outputMike Lockwood
Change-Id: Ia7f015057e24f376e285a40e583644f9d0b9213e Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11UsbDeviceManager: Initialize state based on persist.sys.usb.config rather ↵Mike Lockwood
than current kernel state This makes it more robust when recovering from runtime restarts Bug: 4986841 Change-Id: I54b94213447130ca881c66da2d0ce490242f0c96 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11UsbDeviceManager: Fix indentationMike Lockwood
Change-Id: I3eb1d407bdb4bf885d1765eedbfb30555f558b3b Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-06UsbDeviceManager: Initialize RNDIS ethernet address based on device serial ↵Mike Lockwood
number Change-Id: I4775e5d8350385777f70f1b28ac00aa22dbd9487 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-02UsbService: USB connected notification now redirects to USB screen in SettingsMike Lockwood
Change-Id: I2dc6d1294da53acfa7589ba5b693ec671695cd21 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-01UsbDeviceManager: Reset sys.usb.config if it is "none" at bootMike Lockwood
This will allow us to recover if we crash while changing USB configurations Change-Id: I22ba9a1ff0a8bcbfd4a0f18af0c95a3b66b99060 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-01UsbService: Use Slog instead of Log, and disable some loggingMike Lockwood
Change-Id: I094ab99919055848a9fa76363eae6d0df51de9fd Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-01USB: Update strings for USB connected notificationsMike Lockwood
We now have different strings depending on the current USB mode. Change-Id: Icc6392d5700a6fee008b75287d8eb0f06db1d880 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-22Combine UsbManager.setPrimaryFunction and setDefaultFunctionMike Lockwood
Due to the property trigger on persist.sys.usb.config, setting the default function also sets the current function. Now we combine both of these methods into setCurrentFunction, which has a "makeDefault" option to make the new function the default. This change should eliminate some problems with setting properties due to multiple property triggers happening at the same time. Change-Id: I9851299e9c2ee20475eada1a8104c0d50bf5a9e1 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-17USB connected notification and temporary USB options dialogMike Lockwood
This change adds a notification when USB is connected. Selecting the notification brings up a dialog to allow switching between MTP and PTP modes, and also allows mounting a CD image for installing AFT. The UI design is not final - this is a temporary implementation of the UI. Change-Id: Idd678537aba595fd4cb183ea755bf437f372d826 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-17USB: Support for new USB gadget driversMike Lockwood
Change-Id: Id08df50acb873a94f4765a991ee6a6f5b898ddf5 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-13Move adb related functionality from SystemServer and ↵Mike Lockwood
NotificationManagerService to UsbDeviceManager Change-Id: I9e64b54bc2d027d88ae2d2cd893068e29b6fe237 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-08UsbManager: Clean up extras for ACTION_USB_STATE broadcastMike Lockwood
Also added name for new PTP USB function Change-Id: Ia2775ba2b23ef6a6108ca7e060239eb51c2eecc8 Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-31UsbService: Refactor USB host and device support into two separate classesMike Lockwood
Host support is in UsbHostManager, device support is in UsbDeviceManager Renamed UsbDeviceSettingsManager to UsbSettingsManager Change-Id: Ib76e72957c233fa7f08f454d4d9a2a1da6368cc7 Signed-off-by: Mike Lockwood <lockwood@android.com>