Merge "Use shell command to uninstall network stack package (2/n)"

This commit is contained in:
TreeHugger Robot
2019-10-24 14:24:40 +00:00
committed by Android (Google) Code Review

View File

@@ -218,7 +218,7 @@ public class StagedRollbackTest {
String networkStack = getNetworkStackPackageName();
rm.expireRollbackForPackage(networkStack);
Uninstall.packages(networkStack);
uninstallNetworkStackPackage();
assertThat(getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(),
networkStack)).isNull();
@@ -252,6 +252,12 @@ public class StagedRollbackTest {
return comp.getPackageName();
}
private void uninstallNetworkStackPackage() {
// Since the host side use shell command to install the network stack package, uninstall
// must be done by shell command as well. Otherwise uninstall by a different user will fail.
runShellCommand("pm uninstall " + getNetworkStackPackageName());
}
@Test
public void testPreviouslyAbandonedRollbacks_Phase1() throws Exception {
Uninstall.packages(TestApp.A);
@@ -294,7 +300,7 @@ public class StagedRollbackTest {
String networkStack = getNetworkStackPackageName();
rm.expireRollbackForPackage(networkStack);
Uninstall.packages(networkStack);
uninstallNetworkStackPackage();
assertThat(getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(),
networkStack)).isNull();