summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Don't destroy usb debugging dialog for emulator if usb is not connected.Joshua Duong2021-06-011-1/+3
| | | | | | | | | | ACTION_USB_STATE is always false for emulator, which causes the dialog to appear and then immediately disappear. Bug: 187862091, 160861855 Test: adb kill-server; rm <adb keys>; adb devices (should popup dialog) Change-Id: Ia21533d8b8b5d10526f1789abdffe4bbe32d7025
* Keep USB disconnected receiver active when ADB activity in bgMichael Groover2020-07-221-20/+14
| | | | | | | | | | | | | | | | | | When a new adb connection is attempted adbd will send the system's key to the framework to prompt the user for consent to authorize the connection. If another app is displayed over the adb prompt and the user is not able to switch foreground apps (for instance during setup wizard) the user will not be able to authorize the connection. This commit keeps the USB disconnected receiver active even when the ADB activity is in the background; if the user reseats the USB cable the existing activity will be able to notify adbd and terminate, and a new activity can be displayed in the foreground allowing the user to authorize the connection. Fixes: 152630548 Test: Manually verified the activity terminated and a new prompt was displayed after reseating the cable with the ADB activity in bg Change-Id: I3293536639a20557982113ff9f6ac2bf6f7c1975
* UsbDebuggingActivity: notify failure in onDestroy, not onStop.Josh Gao2020-06-241-1/+6
| | | | | | | | | | | | On initial boot, the prompt can be shown and then get hidden, which would previously cause the initial public key authorization request to be spuriously rejected, if the adb client was running during boot. Move the rejection to onDestroy instead, so we only reject prompts that have no chance of being actually accepted. Bug: http://b/159061108 Test: manual Change-Id: I9acb1145b1f8a6c8d6f82d1c4459bcd86eb306df
* Notify adb service on usb disconnect and activity stopMichael Groover2020-06-091-3/+37
| | | | | | | | | | | | | | | | | | | | When a system with a new key attempts to connect to adb adbd passes the key to the system_server which then launches an activity to prompt the user to allow the key; adbd then waits for a response from the system_server. For adb over usb if the user disconnects the usb cable before responding to the prompt the system_server will not send a response to adbd requiring a restart of adbd before a new connection can be established. This commit notifies the adb service when the usb cable is disconnected or when the activity is stopped through some other means (back, home, or recent apps buttons); the system_server then sends a response to adbd to deny the connection which allows subsequent connections to succeed. Fixes: 156323450 Test: Disconnected usb cable, used back, home, and recent buttons to stop app and verified subsequent connections displayed a prompt and adb sessions were successful when allowed. Change-Id: I50d5ce3a4a1fbdc2caa843b85e2905260a37a7e9
* Revert "Don't dismiss adb authorization prompt upon USB disconnect."Michael Groover2020-06-081-0/+55
| | | | | | | | | | | | This reverts commit e34087b1b3a84d49cc42af9bff276f7ad97e4ae5. Reason for revert: Restoring UsbDisconnectedReceiver to allow dialog in the background to be closed and redisplayed in the foreground by reseating the usb cable. Bug: 156323450 Test: Removed usb cable, verified dialog was closed Change-Id: I84a636ba3c9f7e35beb0769ae80aa6c6df0c2f2c
* Remove touch listener on UsbDebuggingActivityBeverly2020-05-151-22/+0
| | | | | | | | | We can rely on the SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS flag to prevent overlays from displaying above the dialog. Test: manual Fixes: 156482465 Change-Id: Icd6beeceac747177cfcf7c9bb4dad5e40190a992
* Don't dismiss adb authorization prompt upon USB disconnect.Josh Gao2019-12-111-55/+0
| | | | | | | | | | | | | | adbd expects a reply from system_server for authorization: normally there's a reply of "OK" or "NO", but when the prompt is dismissed because of USB disconnect, no response is sent, and we can't prompt for user authorization until system_server or adbd is restarted. Dismissing the authorization prompt on USB disconnect is also wrong: the request might not be coming in over USB. Bug: http://b/145814587 Test: unplugged a device with authorization dialog open Change-Id: I5a9925b917a7169213256daa557637b770583058
* Finish migrating to BroadcastDispatcherFabian Kozynski2019-11-041-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL migrates most of the remaining classes to use BroadcastDispatcher. Some classes left are Views or created before the BroadcastDispatcher can be injected. Adds docs for instructions on using the BroadcastDispatcher. Using the broadcast dispatcher, the time system_server spends dispatching common intents to SystemUI like SCREEN_OFF and SCREEN_ON can be seen to decrease from ~70-150ms (in a Q build) to ~2-4ms. Additionally, once a broadcast is received by the dispatcher, time until it is fully dispatched inside SystemUI is not impacted greatly. Most broadcasts are fully dispatched after ~20ms with a few of them taking ~100ms. Test: atest SystemUITests no regressions Test: build and boot Test: tried some random broadcasts and they are properly dispatched Test: BroadcastDispatch dump Test: adb shell dumpsys activity broadcasts Bug: 134566046 Change-Id: I26a592be66b053f25669b5481b58bf7f07bfd0da
* Merge "Stop USB Debugging authorization window dismissing on tap outside." ↵Tobias Thierer2019-05-311-0/+1
|\ | | | | | | | | | | | | | | am: 1b817b81fd am: e9f31c6529 Change-Id: I3452ae3ffb097d5bbfed2306414ff23cbc0d036b
| * Stop USB Debugging authorization window dismissing on tap outside.Tobias Thierer2019-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This dialog is onerous to trigger (requires disconnecting and reconnecting the device), and is too easy to dismiss accidentally by slightly mis-tapping (happens to me all the time). This code is mostly abandoned - it has barely been touched at all since it was introduced in 2012. This CL makes it not dismiss when the user clicks outside the dialog. To dismiss, the user now has to click either CANCEL or ALLOW. Test: Manually checked that clicking outside the dialog dismissed it before but not after this CL. Change-Id: I603bba9c79e0df8a52ba7db323fea3a13acaa0a5
* | Merge "UsbDebuggingActivity.java: OK -> Allow" am: f9718dbe17 am: 56ed214f67Nick Kralevich2019-01-221-1/+1
|\| | | | | | | | | | | am: 889ff4966b Change-Id: I54ce67321abe0d058920c96298d97e6cc2834b09
| * UsbDebuggingActivity.java: OK -> AllowNick Kralevich2019-01-111-1/+1
| | | | | | | | | | | | | | | | Per UI review, change the label of the ADB allow button. Test: Manual Bug: 111852244 Change-Id: If6663c742aa1f3fc9c8025fdd9f17c69400ae486
* | Move AdbDebuggingManager to AdbServiceKenny Root2018-10-311-5/+5
| | | | | | | | | | | | | | | | | | Also remove the "Usb" from the AIDL function since it's not really related to USB. Test: make Bug: 63820489 Change-Id: Ibf23964665a115a5bc835820dcff98aaf7ba610f
* | Rename system-api wm flags to SYSTEM_...Philip P. Moltmann2018-10-091-1/+1
|/ | | | | | | | | Also add a special API to set them. Internally they are still just regular private flags Test: Built Bug: 116798569 Change-Id: I687b751fa18c7fbcc9bf95aa44d94d8a5614a88f
* Added SafetyNet logging for UsbDebugging security bug.Beverly2017-09-141-0/+2
| | | | | | Bug: 62187985 Test: n/a Change-Id: I69244381b2172357c5adc8785fc73d1cfd3cc17d
* Hides non-system overlays on USB debugging dialog.Beverly2017-08-221-0/+1
| | | | | | | | | | This is necessary since some apps may use overlays that cannot be seen. This prevents those overlays from preventing the USB dialog from being accepted. Bug: 62187985 Test: manual Change-Id: Ic58ddd6d54e96f522445e67b90760dcfed13c27d
* USB debug dialog won't give permission if obscured.Beverly2017-08-171-0/+30
| | | | | | | | | | | | | | | | Previously, the USB debugging dialog was suceptible to tapjacking over tcp if a malicious party obscured the USB debugging text to mask the id of the system requesting permissions. The fix prevents users from giving permissions if the dialog being displayed is partially obscured. Instead, it will present a toast explaining to the user why they cannot give permissions. Test: manual Bug: 62187985 Change-Id: I3bdcd1876cd6dbe8a728bbce74edb52ab79f3e4c
* Remove dialog iconsAlan Viverette2014-07-221-1/+0
| | | | | BUG: 16493564 Change-Id: Ica59abb70a924cccd705172d323a535ef9b75cf1
* Organize the imports in systemui.John Spurlock2013-06-121-5/+0
| | | | | | | To follow android conventions, more importantly to remove the unused. Change-Id: I75881718e84360a579a3b02c26489ad250bc9227
* Fix UsbDebuggingActivity not shown in adb tcpip modeBenoit Goby2013-04-171-1/+5
| | | | | Bug: 8646772 Change-Id: If34c756bece903a0a452070bbc94ebc71d325bf6
* Add UsbDebuggingManager and UsbDebuggingActivityBenoit Goby2012-08-201-0/+137
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