diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/debug/AdbManager.java | 37 | ||||
| -rw-r--r-- | core/java/android/debug/IAdbManager.aidl | 11 |
2 files changed, 45 insertions, 3 deletions
diff --git a/core/java/android/debug/AdbManager.java b/core/java/android/debug/AdbManager.java index ae3d79490c98..0a76bedcd66e 100644 --- a/core/java/android/debug/AdbManager.java +++ b/core/java/android/debug/AdbManager.java @@ -16,15 +16,17 @@ package android.debug; +import android.annotation.RequiresPermission; +import android.annotation.SystemApi; import android.annotation.SystemService; import android.content.Context; +import android.os.RemoteException; /** - * This class allows the control of ADB-related functions. Currently only ADB over USB is - * supported, and none of the API is public. - * + * This class allows the control of ADB-related functions. * @hide */ +@SystemApi @SystemService(Context.ADB_SERVICE) public class AdbManager { private static final String TAG = "AdbManager"; @@ -39,4 +41,33 @@ public class AdbManager { mContext = context; mService = service; } + + /** + * @return true if the device supports secure ADB over Wi-Fi. + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) + public boolean isAdbWifiSupported() { + try { + return mService.isAdbWifiSupported(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * @return true if the device supports secure ADB over Wi-Fi and device pairing by + * QR code. + * @hide + */ + @SystemApi + @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) + public boolean isAdbWifiQrSupported() { + try { + return mService.isAdbWifiQrSupported(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } } diff --git a/core/java/android/debug/IAdbManager.aidl b/core/java/android/debug/IAdbManager.aidl index 79e0794fd9af..c48fc07791c0 100644 --- a/core/java/android/debug/IAdbManager.aidl +++ b/core/java/android/debug/IAdbManager.aidl @@ -41,4 +41,15 @@ interface IAdbManager { * Clear all public keys installed for secure ADB debugging. */ void clearDebuggingKeys(); + + /** + * Returns true if device supports secure Adb over Wi-Fi. + */ + boolean isAdbWifiSupported(); + + /** + * Returns true if device supports secure Adb over Wi-Fi and device pairing by + * QR code. + */ + boolean isAdbWifiQrSupported(); } |
