From e593837a5893e56e0ee01eb243335911f94592e1 Mon Sep 17 00:00:00 2001 From: Winson Date: Tue, 5 Apr 2022 09:33:17 -0700 Subject: [PATCH] Re-root and use device remount APIs for SystemPreparer This might improve success rates for remounting the device. The command goes through shell with no inherent state, so it's unclear how it can fail, but going through the official methods might help. Bug: 197552347 Test: atest --rerun-until-failure 100 \ com.android.server.pm.test.OverlayActorVisibilityTest Change-Id: I25c1f938064e72ddc288b12c048f0cd82217b583 --- .../src/com/android/internal/util/test/SystemPreparer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java b/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java index 525a78486efc4..c25ce71207ae4 100644 --- a/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java +++ b/tests/utils/hostutils/src/com/android/internal/util/test/SystemPreparer.java @@ -21,7 +21,6 @@ import static org.junit.Assert.assertTrue; import com.android.tradefed.device.DeviceNotAvailableException; import com.android.tradefed.device.ITestDevice; -import com.android.tradefed.log.LogUtil; import org.junit.Assert; import org.junit.ClassRule; @@ -369,7 +368,9 @@ public class SystemPreparer extends ExternalResource { device.executeShellCommand("disable-verity"); device.reboot(); } - device.executeShellCommand("remount"); + device.enableAdbRoot(); + device.remountSystemWritable(); + device.remountVendorWritable(); device.waitForDeviceAvailable(); }