summaryrefslogtreecommitdiff
path: root/core/java/android/debug
Commit message (Collapse)AuthorAgeFilesLines
* Fix ADB key file readingWilliam Hester2022-06-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "adb_temp_keys.xml" file is used to keep track of each ADB key and when it was previously connected. It also keeps track of authorized WiFi networks. It is written correctly, however, the parser currently is unable to read the file that it wrote, meaning that: 1. ADB keys never properly expire 2. WiFi APs are never properly restored Furthermore, because of complex interactions with restoring the adb_keys file in Test Harness Mode, duplicate keys get appended repteatedly to the adb_keys file if they're not in the key map. This cleans up the file, making it more testable, adds tests for the previously broken functionality, and just performs some simple restructuring of bits of the code that were error-prone. Now, the adb_keys file is nothing but a view of the temp keys file. When keys are added to the temp keys file, we completely rewrite the adb_keys file with the set of keys present in the temp keys file, meaning that duplicates cannot be added. This also introduces a method for other system services (primarily for TestHarnessModeService) to notify the AdbDebuggingManager that the key files were modified, and it should reload the state. Bug: 236299256 Test: atest AdbDebuggingManagerTest Change-Id: Iae955aca17e873288d58b16f184bd4d325d50d86 (cherry picked from commit efb8194ec4f4c60817999aa190c931a41f2196c7) Merged-In: Iae955aca17e873288d58b16f184bd4d325d50d86
* Restrict AdbManager broadcasts to apps with MANAGE_DEBUGGING permission.Joshua Duong2021-12-311-0/+3
| | | | | | Bug: 205836329 Test: atest AdbDebuggingManagerTest Change-Id: If18a874c6d6232d9131f2cc3de3614ef67a58bbd
* AdbService sends callback on adb debugging enabled / disabled.Yifan Hong2021-08-032-0/+42
| | | | | | Test: pass Bug: 190867939 Change-Id: Ieebe78e01bec948a1475d1c74a84b95e275fa48e
* IAdbManager.getPairDevices returns FingerprintAndPairDevice[].Yifan Hong2021-08-032-2/+33
| | | | | | | | | Map is not supported in C++ backend. To compile IAdbManager in C++, Map is translated into a list of key, value tuples. Test: pass Bug: 194829333 Change-Id: I92e3ad29e8a2bfbab3756d2ef5a2db76ba3cc3d9
* PairDevice to structured Parcelable.Yifan Hong2021-08-032-112/+39
| | | | | | Bug: 194829333 Test: pass Change-Id: I0b44555403113a7f68c865b33b87a85a6847cf21
* Don't attach PendingIntent if settings app is hidden.Joshua Duong2020-05-151-5/+14
| | | | | | | | | | | | | | | The settings app may not be available. In that case, just show the adb notification without a PendingIntent. Bug: 156453114 Test: atest AdbNotificationsTest Test: With USB debugging enabled, install TestDPC, and use it to hide settings app. Unplug and replug USB. USB debugging notification shows up and clicking it does nothing. Change-Id: Ie29d2c425c05bce9371600d76e4eb2eaba692fd7 Change-Id: Ie5f746cbc7b8a32fc280177bf281a9e973c8df12
* Fix PendingIntent hijacking for adb notifications.Joshua Duong2020-04-171-0/+90
| | | | | | | | | | | | | | | | | | Use an explicit intent and set PendingIntent.FLAG_IMMUTABLE to prevent someone from modifying the intent from PendingIntent.send(...). Bug: 153356209 Test: atest AdbNotificationsTest Test: In bug, install and launch the PoC apk and give it notification permissions. Then, with USB/Wifi debugging enabled, disconnect and connect the device to create the adb notification. the PoC apk should not have permission to display information from content://com.android.settings.files/my_cache/NOTICE.html. Change-Id: Ie49aa3cf9b33168cf1435fc2427e95aac7f4609b (cherry picked from commit 2c038814591d7e3d73b2b277db504a5555732456) Exempt-From-Owner-Approval: approved in master
* Allow UsbDeviceManager to start adbd again.Joshua Duong2020-02-261-0/+10
| | | | | | | | | | | | | | | | There's some weird state where if persist.sys.usb.config=none,adb, then adbd won't get started. Give back adbd start permissions to UsbDeviceManager to see if that fixes the issue. Bug: 150130503 Bug: 150116813 Test: adb shell su 0 setprop persist.sys.usb.config none,adb; adb reboot adb should be online after. Change-Id: I36c6ef4b20d58570a2d51ed70088ae5c54d6687d Exempt-From-Owner-Approval: Fix adbd offline failure (cherry picked from commit 7a3800993df55f87ce6493bf304730b9ffd91ad5)
* Add AdbTransportType.aidl. Add AdbWifi internal API stubs.Joshua Duong2020-02-196-2/+305
| | | | | | | | | | | | | | | Since wireless debugging can be enabled without usb debugging enabled, we'll need to differentiate between which transport is enabled. Also added the internal AdbManager stubs for wireless debugging. Adding implementation in separate CL to get around merge conflict with a SysUI CL in the stack. BUG: b/111434128 Test: make Exempt-From-Owner-Approval: already approved Change-Id: I4e1ae6398f291f321e61e7eb119564ebd5e54c2e
* Add SystemApis isAdbWifiSupported(), isAdbWifiQRSupported() to AdbManager.Joshua Duong2020-01-172-3/+45
| | | | | | | Bug: 146139798, 111434128 Test: make Change-Id: Iab20d20b39f0079418026a730cd4093de08d1db9
* Fix Test Harness Mode to work with new ADB fileWilliam Hester2019-02-081-0/+12
| | | | | | | | | | | | | | | | | | | | | Because the ADB keys are now stored in adb_temp_keys.xml as well, Test Harness Mode should back up and restore that file. To resolve a comment in the initial CL, it uses a LocalService to actually interact with the AdbService to retrieve the file, so any future changes in file location should be immediately propagated to Test Harness Mode. There were also two minor bugs fixed in this CL: 1) When serializing the adb keys to the XML file, if the allowedTime was 0, they were all removed 2) If all keys are removed, the file was only an XML header and therefore invalid XML Test: adb shell cmd testharness enable Test: adb shell settings put global adb_allowed_connection_time 1; unplug device, plug device back in, adb shell cat /data/misc/adb/adb_temp_keys.xml (should return 'No such file or directory') Change-Id: I09e2998a0b80660486502f7486d4c838219c342c
* Move AdbDebuggingManager to AdbServiceKenny Root2018-10-311-1/+24
| | | | | | | | | Also remove the "Usb" from the AIDL function since it's not really related to USB. Test: make Bug: 63820489 Change-Id: Ibf23964665a115a5bc835820dcff98aaf7ba610f
* AdbService: move source of truth for enabledKenny Root2018-10-311-0/+1
| | | | | | | | | | This makes the AdbService the source of truth for whether ADB is enabled on the system or not. All UsbManager checks will now query the AdbService. Test: make Bug: 63820489 Change-Id: I2965a15b5fa9f747fe0ae4dc791b5e357e78253f
* Add function to query ADB stateKenny Root2018-10-311-0/+5
| | | | | | | | | This is what the USB manager will use to query the current ADB state in the future. Bug: 63820489 Test: make Change-Id: I70484f97e56af4e5104611dc3b43ef83885671d7
* Add ADB transport skeletonKenny Root2018-10-312-0/+34
| | | | | | | | | This adds the AIDL definition for ADB transports. For instance USB is one type of ADB transport and the only one supported now. Bug: 63820489 Test: make Change-Id: Id422a814567021ab4b1097c2792a95c42bfccf74
* Add empty AdbManagerInternal for system serverKenny Root2018-10-311-0/+26
| | | | | | | | | This will allow the call of internal-only AdbService functions from within the system server. Bug: 63820489 Test: make Change-Id: Ic761b513a8c10ce0173ddb6bc761a6372799f15c
* Add empty AdbService to SystemServerKenny Root2018-10-312-0/+63
| | | | | | | | | Create skeleton service to migrate functions from UsbService in later change. Bug: 63820489 Test: make Change-Id: I07672fe87cfae188fe77c173fc49119e182c6b05
* Remove unused JNITest classAshok Bhat2014-02-211-48/+0
| | | | | | | | | | | JNITest class is no longer actively used. This patch removes the class (java and jni) files. JNI interfaces and calls are extensively tested in the art unit tests (art/tests) and in cts (see CtsJniTestCases). Change-Id: I62f7c72deb5d206fa3f545ae39a9cb9011110d0a Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
* Correct executable bit for source filesKenny Root2012-11-071-0/+0
| | | | | | | | | Many media files and source code files were marked as executable in Git. Remove those. Also a shell script and python script were not marked as executable. Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-032-0/+53
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-032-53/+0
|
* Initial ContributionThe Android Open Source Project2008-10-212-0/+53