Merge "Improve diagnostics when cannot install wellbeing test apk" into sc-dev am: 1ba5a68e31
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14682231 Change-Id: I4c638b2ffb8ee2d01d7157e87fbe5e0feeca48b3
This commit is contained in:
@@ -22,6 +22,8 @@ import android.content.res.Resources;
|
|||||||
|
|
||||||
import androidx.test.uiautomator.UiDevice;
|
import androidx.test.uiautomator.UiDevice;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -48,7 +50,10 @@ public class TestUtil {
|
|||||||
in.close();
|
in.close();
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
UiDevice.getInstance(getInstrumentation()).executeShellCommand("pm install " + apkFilename);
|
final String result = UiDevice.getInstance(getInstrumentation())
|
||||||
|
.executeShellCommand("pm install " + apkFilename);
|
||||||
|
Assert.assertTrue("Failed to install wellbeing test apk; make sure the device is rooted",
|
||||||
|
"Success".equals(result.replaceAll("\\s+", "")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void uninstallDummyApp() throws IOException {
|
public static void uninstallDummyApp() throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user