Merge "Block new installs into ASEC containers."

This commit is contained in:
Jeff Sharkey
2017-02-24 19:32:04 +00:00
committed by Android (Google) Code Review
3 changed files with 17 additions and 0 deletions

View File

@@ -624,8 +624,10 @@ public abstract class PackageManager {
* should be installed as forward locked, i.e. only the app itself should
* have access to its code and non-resource assets.
*
* @deprecated new installs into ASEC containers are no longer supported.
* @hide
*/
@Deprecated
public static final int INSTALL_FORWARD_LOCK = 0x00000001;
/**
@@ -648,8 +650,11 @@ public abstract class PackageManager {
* Flag parameter for {@link #installPackage} to indicate that this package
* must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}.
*
* @deprecated new installs into ASEC containers are no longer supported;
* use adoptable storage instead.
* @hide
*/
@Deprecated
public static final int INSTALL_EXTERNAL = 0x00000008;
/**

View File

@@ -607,6 +607,12 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
+ "to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag");
}
if ((params.installFlags & PackageManager.INSTALL_FORWARD_LOCK) != 0
|| (params.installFlags & PackageManager.INSTALL_EXTERNAL) != 0) {
throw new IllegalArgumentException(
"New installs into ASEC containers no longer supported");
}
// Defensively resize giant app icons
if (params.appIcon != null) {
final ActivityManager am = (ActivityManager) mContext.getSystemService(

View File

@@ -13068,6 +13068,12 @@ public class PackageManagerService extends IPackageManager.Stub {
+ "to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag");
}
if ((installFlags & PackageManager.INSTALL_FORWARD_LOCK) != 0
|| (installFlags & PackageManager.INSTALL_EXTERNAL) != 0) {
throw new IllegalArgumentException(
"New installs into ASEC containers no longer supported");
}
final File originFile = new File(originPath);
final OriginInfo origin = OriginInfo.fromUntrustedFile(originFile);