Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 591928f2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Skip testPhysicalEthernet if the test run adb over network" am:...

Merge "Skip testPhysicalEthernet if the test run adb over network" am: 349c5720 am: 8181ca51 am: 924a5e06 am: f4f528d8 am: fdf9d4af

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354445

Change-Id: Ia80b411c3f5eac3f1154a02d88ef1b7fcea1a55a
parents 41361657 fdf9d4af
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import android.net.dhcp.DhcpPacket;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.system.Os;
import android.util.Log;

@@ -224,9 +225,19 @@ public class EthernetTetheringTest {

    }

    private boolean isAdbOverNetwork() {
        // If adb TCP port opened, this test may running by adb over network.
        return (SystemProperties.getInt("persist.adb.tcp.port", -1) > -1)
                || (SystemProperties.getInt("service.adb.tcp.port", -1) > -1);
    }

    @Test
    public void testPhysicalEthernet() throws Exception {
        assumeTrue(mEm.isAvailable());
        // Do not run this test if adb is over network and ethernet is connected.
        // It is likely the adb run over ethernet, the adb would break when ethernet is switching
        // from client mode to server mode. See b/160389275.
        assumeFalse(isAdbOverNetwork());

        // Get an interface to use.
        final String iface = mTetheredInterfaceRequester.getInterface();