diff options
| author | Joshua Duong <joshuaduong@google.com> | 2020-01-22 01:12:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-01-22 01:12:19 +0000 |
| commit | e9beb8ddbcc45d9a3b48db296956ef9856e14eeb (patch) | |
| tree | ef66a1b126d091a97867722193b10a3fd1d9fccb /core/java | |
| parent | 7790a36021df767ea448fa47934f80308b11063f (diff) | |
| parent | a5cbda47298280abad7653d5e5c6b33c3fa1d9ec (diff) | |
Merge "Add SystemApis isAdbWifiSupported(), isAdbWifiQRSupported() to AdbManager."
Diffstat (limited to 'core/java')
| -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(); } |
