summaryrefslogtreecommitdiff
path: root/core/java/android/debug/AdbManagerInternal.java
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
* 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 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
* Add AdbTransportType.aidl. Add AdbWifi internal API stubs.Joshua Duong2020-02-191-1/+1
| | | | | | | | | | | | | | | 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
* 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
* 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-311-0/+13
| | | | | | | | | 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