summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/usb
Commit message (Collapse)AuthorAgeFilesLines
* Move some system services to separate directoriesAmith Yamasani2013-12-195-2835/+0
| | | | | | | | 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
* Explicit locale when formatting machine strings.Jeff Sharkey2013-06-111-1/+2
| | | | | Bug: 9390451 Change-Id: I3581c53407554a1dffd541fb42b06d68f20a7be0
* Cleanup some of the thread merging.Dianne Hackborn2013-05-071-1/+1
| | | | | | | | | | | | | | | Adds an optimization for checking whether a looper is stuck, with a new Looper method to see if its thread is currently idle. This will allow us to put a large number of loopers in the monitor efficiently, since we generally won't have to do a context switch on each of them (since most looper threads spend most of their time idle waiting for work). Also change things so the system process's main thread is actually running on the main thread. Because Jeff asked for this, and who am I to argue? :) Change-Id: I12999e6f9c4b056c22dd652cb78c2453c391061f
* Start combining threads in system process.Dianne Hackborn2013-05-022-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow system server to bind to USB devices.Jeff Brown2013-03-281-2/+11
| | | | Change-Id: I31f9ed1ff3fcda53f62f08ae198d18d0df3321b7
* UsbDebuggingManager: Add interface to clear secure adb keysBenoit Goby2013-01-283-3/+40
| | | | | | | This is called from Settings that has a button to clear secure adb public keys installed on the device. Change-Id: I63ef499c049766ef13ea6cb0594ed6719f35e5f3
* UsbDeviceManager: Don't start UsbDebuggingManager when data is encryptedBenoit Goby2013-01-251-1/+3
| | | | | | | This avoids showing the confirmation dialog from the decryption screen Bug: 8019508 Change-Id: I7ff364437f6b8aeea26fa8308aa4fe35b7ede5d7
* Add new disabled state for "optional" built-in apps.Dianne Hackborn2013-01-221-1/+2
| | | | | | | | | | | | | | | The disabled state allows you to make an app disabled except for whatever parts of the system still want to provide access to them and automatically enable them if the user want to use it. Currently the input method manager service is the only part of the system that supports this, so you can put an IME in this state and it will generally look disabled but still be available in the IME list and once selected switched to the enabled state. Change-Id: I77f01c70610d82ce9070d4aabbadec8ae2cff2a3
* Useful annotations for code documentation.Jeff Sharkey2012-11-123-3/+8
| | | | | Bug: 6537978 Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
* Remove extraneous logs.Dianne Hackborn2012-11-081-3/+3
| | | | Change-Id: I4c47d36748de91bd6fddc419afbf59552bf63e9a
* Make USB services multi-user aware.Jeff Sharkey2012-10-024-115/+274
| | | | | | | | | | | | | | 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
* Update references to migrated global settings.Jeff Brown2012-09-251-4/+4
| | | | | | | | | | 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
* Fix issue #7214090: Need to be able to post notifications to all usersDianne Hackborn2012-09-241-8/+11
| | | | | | | | | | | | | | | 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
* Multi-user MTP.Jeff Sharkey2012-09-181-2/+27
| | | | | | | | | | | | | | | | | | | | 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
* Include user identifier in external storage paths.Jeff Sharkey2012-09-111-6/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Improve multi-user broadcasts.Dianne Hackborn2012-08-302-5/+7
| | | | | | | | | | | | | | | | | | | 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
* UsbDebuggingManager: Fix restart when toggling USB debuggingBenoit Goby2012-08-291-2/+3
| | | | Change-Id: Iaaec9162b03c4ea77735d096eec670392c61308a
* UsbDebuggingManager: add missing break in switchBenoit Goby2012-08-291-0/+1
| | | | | Bug: 7079044 Change-Id: Icf4090e79af47db7d068981537c97f2028d8e405
* Add UsbDebuggingManager and UsbDebuggingActivityBenoit Goby2012-08-203-0/+358
| | | | | | | | | | | 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
* Merge "Added missing USB_DEVICE_ATTACHED broadcast to running Activity"Mike Lockwood2012-08-131-0/+4
|\
| * Added missing USB_DEVICE_ATTACHED broadcast to running ActivityRobin Cutshaw2012-06-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | If an Activity programatically adds an ACTION_USB_DEVICE_ATTACHED intent, it will never be delivered when the device is attached. This change adds the missing intent broadcast to running Activities. File changes: modified: services/java/com/android/server/usb/UsbSettingsManager.java Change-Id: I767ee4d0765a7901c36e4c6f4aaf6583da2ac6f4 Signed-off-by: Robin Cutshaw <robin.cutshaw@gmail.com>
* | Merge "UsbService: Fix problem detecting audio accessory mode when connected ↵Mike Lockwood2012-05-101-26/+23
|\ \ | | | | | | | | | at boot" into jb-dev
| * | UsbService: Fix problem detecting audio accessory mode when connected at bootMike Lockwood2012-05-101-26/+23
| | | | | | | | | | | | | | | Change-Id: Ie0e23b8ec88f1dd29bb956bc1d21c241f3545059 Signed-off-by: Mike Lockwood <lockwood@google.com>
* | | Show the ADB icon in the status bar again.Daniel Sandler2012-05-101-1/+1
|/ / | | | | | | | | Bug: 6440323 Change-Id: I3b1972d18be4ad77a87c4b71673b6cfb7735c59e
* | UsbService: Add support for accessory initiating USB audio supportMike Lockwood2012-04-262-13/+41
| | | | | | | | | | Change-Id: I0e468f4b841de9e1ca7b75a05fc58299dbc78222 Signed-off-by: Mike Lockwood <lockwood@google.com>
* | Move handling of package changes to a background thread.Dianne Hackborn2012-04-191-1/+1
| | | | | | | | | | | | Helps get rid of some jank when installing applications. Change-Id: I97d0022f82d67796e334d37086e5911dd6ca6b62
* | Add Intents to notify when USB audio devices or accessories are attachedMike Lockwood2012-04-061-0/+34
| | | | | | | | | | | | | | In this change, only the USB audio accessory support is implemented. Change-Id: Id9b411319b07a96dc56649ca74cc5f3f89a55a7c Signed-off-by: Mike Lockwood <lockwood@google.com>
* | Stop showing ADB and MTP/PTP/USB notifications at the top.Daniel Sandler2012-03-291-0/+2
| | | | | | | | | | | | | | | | | | | | 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
* | fix setting only usb modeRoboErik2012-03-221-5/+8
|/ | | | | | | | 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
* Add OEM specific USB mode enumeration based on ro.bootmode propertyKazuhiro Ondo2012-02-101-1/+69
| | | | | | | | | 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
* Make sure to go to the right Settings panel when tapping a notificationChristopher Tate2011-08-241-12/+6
| | | | | | | | | | 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
* UsbManager: Use resource IDs for notification IDsMike Lockwood2011-08-161-28/+13
| | | | | | | | | to avoid ID collisions with other system services. Bug: 5161005 Change-Id: I069fbc40a8764bc85cceeacd04264abd32b62668 Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Fix typo that broke adb on/off setting persistenceMike Lockwood2011-08-031-1/+1
| | | | | | | Bug: 5108784 Change-Id: I68ed4d442ce4d3f4651cb618902fb226ac5a3673 Signed-off-by: Mike Lockwood <lockwood@android.com>
* USB: Fix NPE that occurred when restoring default function in ↵Mike Lockwood2011-08-021-6/+10
| | | | | | | | | UsbManager.setEnabledFunctions Bug: 5110020 Change-Id: I5e4b5c27e4675fa6830823832ae51411dc448191 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Clean up USB configuration switching logic and beef up error handlingMike Lockwood2011-07-291-45/+49
| | | | | | Bug: 5050853 Change-Id: Ia00698e2adbb8a7d7698e2ae306413f6c715fbdb
* UsbDeviceManager: Don't show USB notification for RNDISMike Lockwood2011-07-271-15/+14
| | | | | | | | | since USB tethering already has a notification. Bug: 4988511 Change-Id: I928cb1e1d191c77340f7f05edfa80a74cdabe6ed Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Add USB notification string for USB accessory modeMike Lockwood2011-07-211-1/+6
| | | | | | | Bug: 5062341 Change-Id: I93af8274e538009dd8f00d1cea782b62334e43f1 Signed-off-by: Mike Lockwood <lockwood@android.com>
* USB: Fix handling USB accessory attached when device is bootingMike Lockwood2011-07-211-10/+28
| | | | | | | | | | 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>
* UsbManager: document that passing null setCurrentFunction restores default ↵Mike Lockwood2011-07-181-4/+1
| | | | | | | function Change-Id: I4340b336f3e91b3b8242f2a66c34a7a7f5c3021f Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: clean up HandlerThread creationMike Lockwood2011-07-131-6/+4
| | | | | Change-Id: I84683b1753fcf3c3b501f8a506d6d890edf2eb37 Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Include kernel USB state in dumpsys outputMike Lockwood2011-07-111-0/+10
| | | | | Change-Id: Ia7f015057e24f376e285a40e583644f9d0b9213e Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Initialize state based on persist.sys.usb.config rather ↵Mike Lockwood2011-07-111-8/+7
| | | | | | | | | | | 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>
* UsbDeviceManager: Fix indentationMike Lockwood2011-07-111-13/+13
| | | | | Change-Id: I3eb1d407bdb4bf885d1765eedbfb30555f558b3b Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Initialize RNDIS ethernet address based on device serial ↵Mike Lockwood2011-07-061-1/+27
| | | | | | | number Change-Id: I4775e5d8350385777f70f1b28ac00aa22dbd9487 Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbService: USB connected notification now redirects to USB screen in SettingsMike Lockwood2011-07-021-3/+4
| | | | | Change-Id: I2dc6d1294da53acfa7589ba5b693ec671695cd21 Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbDeviceManager: Reset sys.usb.config if it is "none" at bootMike Lockwood2011-07-011-2/+11
| | | | | | | This will allow us to recover if we crash while changing USB configurations Change-Id: I22ba9a1ff0a8bcbfd4a0f18af0c95a3b66b99060 Signed-off-by: Mike Lockwood <lockwood@android.com>
* UsbService: Use Slog instead of Log, and disable some loggingMike Lockwood2011-07-013-32/+30
| | | | | Change-Id: I094ab99919055848a9fa76363eae6d0df51de9fd Signed-off-by: Mike Lockwood <lockwood@android.com>
* USB: Update strings for USB connected notificationsMike Lockwood2011-07-011-107/+112
| | | | | | | We now have different strings depending on the current USB mode. Change-Id: Icc6392d5700a6fee008b75287d8eb0f06db1d880 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Combine UsbManager.setPrimaryFunction and setDefaultFunctionMike Lockwood2011-06-222-54/+57
| | | | | | | | | | | | | 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>
* USB connected notification and temporary USB options dialogMike Lockwood2011-06-171-1/+64
| | | | | | | | | | 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>