Merge "[pm] clarify error message for INSTALL_FAILED_TEST_ONLY"

This commit is contained in:
Song Chun Fan
2023-01-31 16:43:57 +00:00
committed by Android (Google) Code Review

View File

@@ -1171,7 +1171,8 @@ final class InstallPackageHelper {
request.setName(pkgName);
if (parsedPackage.isTestOnly()) {
if ((installFlags & PackageManager.INSTALL_ALLOW_TEST) == 0) {
throw new PrepareFailure(INSTALL_FAILED_TEST_ONLY, "installPackageLI");
throw new PrepareFailure(INSTALL_FAILED_TEST_ONLY,
"Failed to install test-only apk. Did you forget to add -t?");
}
}