Fix ADB key file reading
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
Loading
Please register or sign in to comment