Loading api/system-current.txt +9 −0 Original line number Diff line number Diff line Loading @@ -2092,6 +2092,15 @@ package android.content.rollback { } package android.debug { public class AdbManager { method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiQrSupported(); method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiSupported(); } } package android.hardware { public final class Sensor { Loading core/java/android/debug/AdbManager.java +34 −3 Original line number Diff line number Diff line Loading @@ -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"; Loading @@ -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(); } } } core/java/android/debug/IAdbManager.aidl +11 −0 Original line number Diff line number Diff line Loading @@ -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(); } services/core/java/com/android/server/adb/AdbService.java +25 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.adb; import android.content.ContentResolver; import android.content.Context; import android.content.pm.PackageManager; import android.database.ContentObserver; import android.debug.AdbManagerInternal; import android.debug.IAdbManager; Loading Loading @@ -260,6 +261,30 @@ public class AdbService extends IAdbManager.Stub { } } /** * @return true if the device supports secure ADB over Wi-Fi. * @hide */ @Override public boolean isAdbWifiSupported() { mContext.enforceCallingPermission( android.Manifest.permission.MANAGE_DEBUGGING, "AdbService"); return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI); } /** * @return true if the device supports secure ADB over Wi-Fi and device pairing by * QR code. * @hide */ @Override public boolean isAdbWifiQrSupported() { mContext.enforceCallingPermission( android.Manifest.permission.MANAGE_DEBUGGING, "AdbService"); return isAdbWifiSupported() && mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_ANY); } private void setAdbEnabled(boolean enable) { if (DEBUG) Slog.d(TAG, "setAdbEnabled(" + enable + "), mAdbEnabled=" + mAdbEnabled); Loading Loading
api/system-current.txt +9 −0 Original line number Diff line number Diff line Loading @@ -2092,6 +2092,15 @@ package android.content.rollback { } package android.debug { public class AdbManager { method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiQrSupported(); method @RequiresPermission(android.Manifest.permission.MANAGE_DEBUGGING) public boolean isAdbWifiSupported(); } } package android.hardware { public final class Sensor { Loading
core/java/android/debug/AdbManager.java +34 −3 Original line number Diff line number Diff line Loading @@ -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"; Loading @@ -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(); } } }
core/java/android/debug/IAdbManager.aidl +11 −0 Original line number Diff line number Diff line Loading @@ -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(); }
services/core/java/com/android/server/adb/AdbService.java +25 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.adb; import android.content.ContentResolver; import android.content.Context; import android.content.pm.PackageManager; import android.database.ContentObserver; import android.debug.AdbManagerInternal; import android.debug.IAdbManager; Loading Loading @@ -260,6 +261,30 @@ public class AdbService extends IAdbManager.Stub { } } /** * @return true if the device supports secure ADB over Wi-Fi. * @hide */ @Override public boolean isAdbWifiSupported() { mContext.enforceCallingPermission( android.Manifest.permission.MANAGE_DEBUGGING, "AdbService"); return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI); } /** * @return true if the device supports secure ADB over Wi-Fi and device pairing by * QR code. * @hide */ @Override public boolean isAdbWifiQrSupported() { mContext.enforceCallingPermission( android.Manifest.permission.MANAGE_DEBUGGING, "AdbService"); return isAdbWifiSupported() && mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_ANY); } private void setAdbEnabled(boolean enable) { if (DEBUG) Slog.d(TAG, "setAdbEnabled(" + enable + "), mAdbEnabled=" + mAdbEnabled); Loading