Merge "Require targetSdk >= O for ephemeral installs"

This commit is contained in:
Chad Brubaker
2016-12-20 18:19:23 +00:00
committed by Android (Google) Code Review

View File

@@ -15468,6 +15468,14 @@ public class PackageManagerService extends IPackageManager.Stub {
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
}
// Ephemeral apps must have target SDK >= O.
// TODO: Update conditional and error message when O gets locked down
if (ephemeral && pkg.applicationInfo.targetSdkVersion <= Build.VERSION_CODES.N_MR1) {
res.setError(PackageManager.INSTALL_FAILED_EPHEMERAL_INVALID,
"Ephemeral apps must have target SDK version of at least O");
return;
}
// If we are installing a clustered package add results for the children
if (pkg.childPackages != null) {
synchronized (mPackages) {