resolved conflicts for merge of 37a00a36 to master
This commit is contained in:
@@ -2111,6 +2111,12 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
File file = new File(dir, files[i]);
|
||||
PackageParser.Package pkg = scanPackageLI(file,
|
||||
flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
|
||||
// Don't mess around with apps in system partition.
|
||||
if (pkg == null && (flags & PackageParser.PARSE_IS_SYSTEM) == 0) {
|
||||
// Delete the apk
|
||||
Log.w(TAG, "Cleaning up failed install of " + file);
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2353,6 +2359,13 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
private PackageParser.Package scanPackageLI(
|
||||
PackageParser.Package pkg, int parseFlags, int scanMode) {
|
||||
File scanFile = new File(pkg.mScanPath);
|
||||
if (scanFile == null || pkg.applicationInfo.sourceDir == null ||
|
||||
pkg.applicationInfo.publicSourceDir == null) {
|
||||
// Bail out. The resource and code paths haven't been set.
|
||||
Log.w(TAG, " Code and resource paths haven't been set correctly");
|
||||
mLastScanError = PackageManager.INSTALL_FAILED_INVALID_APK;
|
||||
return null;
|
||||
}
|
||||
mScanningPath = scanFile;
|
||||
if (pkg == null) {
|
||||
mLastScanError = PackageManager.INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME;
|
||||
|
||||
Reference in New Issue
Block a user