diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2023-02-16 17:46:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-02-16 17:46:45 +0000 |
commit | 2608f1849b3784e4655c5394eff551cf31ab2c55 (patch) | |
tree | 62d55d50e0fdb637a6f0a6f5cda20fe6caa0998e | |
parent | 5abfdec15219007b454a6de69b8e8bee2e25cc0e (diff) | |
parent | 3df09fb11af5a315526b8022fc71be28f22163dc (diff) | |
download | hal-2608f1849b3784e4655c5394eff551cf31ab2c55.tar.gz |
Merge "Ban use of Thread.sleep() - HalUsbGadgetV1_0HostTest"
-rw-r--r-- | usb/gadget/V1_0/host/src/com/android/tests/usbgadget/HalUsbGadgetV1_0HostTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usb/gadget/V1_0/host/src/com/android/tests/usbgadget/HalUsbGadgetV1_0HostTest.java b/usb/gadget/V1_0/host/src/com/android/tests/usbgadget/HalUsbGadgetV1_0HostTest.java index 692f79b1..c50952c5 100644 --- a/usb/gadget/V1_0/host/src/com/android/tests/usbgadget/HalUsbGadgetV1_0HostTest.java +++ b/usb/gadget/V1_0/host/src/com/android/tests/usbgadget/HalUsbGadgetV1_0HostTest.java @@ -29,6 +29,7 @@ import com.android.tradefed.invoker.TestInformation; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; import com.android.tradefed.testtype.junit4.BeforeClassWithInfo; +import com.android.tradefed.util.RunUtil; import com.google.common.base.Strings; import com.sun.jna.Native; import com.sun.jna.Pointer; @@ -111,7 +112,7 @@ public class HalUsbGadgetV1_0HostTest extends BaseHostJUnit4Test { public void testMtp() throws Exception { assumeTrue(String.format("The device doesn't have service %s", HAL_SERVICE), mHasService); getDevice().executeShellCommand("svc usb setFunctions mtp true"); - Thread.sleep(WAIT_TIME); + RunUtil.getDefault().sleep(WAIT_TIME); assertTrue("MTP not present", checkProtocol(6, 1, 1)); } @@ -125,7 +126,7 @@ public class HalUsbGadgetV1_0HostTest extends BaseHostJUnit4Test { public void testPtp() throws Exception { assumeTrue(String.format("The device doesn't have service %s", HAL_SERVICE), mHasService); getDevice().executeShellCommand("svc usb setFunctions ptp true"); - Thread.sleep(WAIT_TIME); + RunUtil.getDefault().sleep(WAIT_TIME); assertTrue("PTP not present", checkProtocol(6, 1, 1)); } @@ -141,7 +142,7 @@ public class HalUsbGadgetV1_0HostTest extends BaseHostJUnit4Test { getDevice().hasFeature(FEATURE_AUTOMOTIVE)); assumeTrue(String.format("The device doesn't have service %s", HAL_SERVICE), mHasService); getDevice().executeShellCommand("svc usb setFunctions midi true"); - Thread.sleep(WAIT_TIME); + RunUtil.getDefault().sleep(WAIT_TIME); assertTrue("MIDI not present", checkProtocol(1, 3, 0)); } } |