|
|
|
|
@ -25,6 +25,7 @@ import android.net.NetworkCapabilities;
|
|
|
|
|
import android.net.Uri;
|
|
|
|
|
import android.os.Handler;
|
|
|
|
|
import android.os.Looper;
|
|
|
|
|
import android.os.SystemProperties;
|
|
|
|
|
import android.os.RemoteException;
|
|
|
|
|
import android.os.ServiceManager;
|
|
|
|
|
import android.provider.Settings;
|
|
|
|
|
@ -145,6 +146,8 @@ public class WirelessDebuggingPreferenceController extends DeveloperOptionsPrefe
|
|
|
|
|
if (cm == null) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
final boolean allowEthernet = SystemProperties.getBoolean(
|
|
|
|
|
"persist.adb.ethernet.enable", false);
|
|
|
|
|
for (Network network : cm.getAllNetworks()) {
|
|
|
|
|
final NetworkCapabilities nc = cm.getNetworkCapabilities(network);
|
|
|
|
|
if (nc == null) {
|
|
|
|
|
@ -153,6 +156,10 @@ public class WirelessDebuggingPreferenceController extends DeveloperOptionsPrefe
|
|
|
|
|
if (nc.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (allowEthernet && nc.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) {
|
|
|
|
|
Log.d(TAG, "Enabling ADB over Ethernet");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|