summaryrefslogtreecommitdiff
path: root/core/java/android/debug/AdbManagerInternal.java
diff options
context:
space:
mode:
authorWilliam Hester <williamhester@google.com>2019-02-06 17:36:37 -0800
committerWilliam Hester <williamhester@google.com>2019-02-08 12:38:08 -0800
commit99a7d633b37a71459e366a9707153938879b6591 (patch)
treeaf641ae81291faaf7b673035ce5fc7ad6b0aa96f /core/java/android/debug/AdbManagerInternal.java
parent0def48bd5d9486189583c58074eba0f677d72f97 (diff)
Fix Test Harness Mode to work with new ADB file
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
Diffstat (limited to 'core/java/android/debug/AdbManagerInternal.java')
-rw-r--r--core/java/android/debug/AdbManagerInternal.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/debug/AdbManagerInternal.java b/core/java/android/debug/AdbManagerInternal.java
index 4469f0f965c3..51eb7fc2d804 100644
--- a/core/java/android/debug/AdbManagerInternal.java
+++ b/core/java/android/debug/AdbManagerInternal.java
@@ -16,6 +16,8 @@
package android.debug;
+import java.io.File;
+
/**
* This class allows the control of ADB-related functions that should only be called from the system
* server.
@@ -41,4 +43,14 @@ public abstract class AdbManagerInternal {
* Returns {@code true} if ADB debugging is enabled.
*/
public abstract boolean isAdbEnabled();
+
+ /**
+ * Returns the file that contains all of the ADB keys used by the device.
+ */
+ public abstract File getAdbKeysFile();
+
+ /**
+ * Returns the file that contains all of the ADB keys and their last used time.
+ */
+ public abstract File getAdbTempKeysFile();
}