Loading tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java +8 −0 Original line number Diff line number Diff line Loading @@ -477,4 +477,12 @@ public class StagedRollbackTest { StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE); assertThat(sm.isCheckpointSupported()).isTrue(); } @Test public void hasMainlineModule() throws Exception { String pkgName = getModuleMetadataPackageName(); boolean existed = InstrumentationRegistry.getInstrumentation().getContext() .getPackageManager().getModuleInfo(pkgName, 0) != null; assertThat(existed).isTrue(); } } tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { */ @Test public void testRollbackWhitelistedApp() throws Exception { assumeTrue(hasMainlineModule()); runPhase("testRollbackWhitelistedApp_Phase1"); getDevice().reboot(); runPhase("testRollbackWhitelistedApp_Phase2"); Loading Loading @@ -460,4 +461,16 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { return false; } } /** * True if this build has mainline modules installed. */ private boolean hasMainlineModule() throws Exception { try { runPhase("hasMainlineModule"); return true; } catch (AssertionError ignore) { return false; } } } Loading
tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java +8 −0 Original line number Diff line number Diff line Loading @@ -477,4 +477,12 @@ public class StagedRollbackTest { StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE); assertThat(sm.isCheckpointSupported()).isTrue(); } @Test public void hasMainlineModule() throws Exception { String pkgName = getModuleMetadataPackageName(); boolean existed = InstrumentationRegistry.getInstrumentation().getContext() .getPackageManager().getModuleInfo(pkgName, 0) != null; assertThat(existed).isTrue(); } }
tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,7 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { */ @Test public void testRollbackWhitelistedApp() throws Exception { assumeTrue(hasMainlineModule()); runPhase("testRollbackWhitelistedApp_Phase1"); getDevice().reboot(); runPhase("testRollbackWhitelistedApp_Phase2"); Loading Loading @@ -460,4 +461,16 @@ public class StagedRollbackTest extends BaseHostJUnit4Test { return false; } } /** * True if this build has mainline modules installed. */ private boolean hasMainlineModule() throws Exception { try { runPhase("hasMainlineModule"); return true; } catch (AssertionError ignore) { return false; } } }