diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java index 62a527b15c39e..48efa5c31f2b8 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerSession.java +++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java @@ -2357,6 +2357,17 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { "Invalid filename: " + targetName); } + // Yell loudly if installers drop attribute installLocation when apps explicitly set. + if (apk.installLocation != PackageInfo.INSTALL_LOCATION_UNSPECIFIED) { + final String installerPackageName = getInstallerPackageName(); + if (installerPackageName != null + && (params.installLocation != apk.installLocation)) { + Slog.wtf(TAG, installerPackageName + + " drops manifest attribute android:installLocation in " + targetName + + " for " + mPackageName); + } + } + final File targetFile = new File(stageDir, targetName); resolveAndStageFileLocked(addedFile, targetFile, apk.splitName);