Merge change 9075 into donut
* changes: Change the resource path for fwd locked apps when scanning the fwd locked install directory
This commit is contained in:
@ -494,7 +494,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
mDrmAppInstallObserver = new AppDirObserver(
|
mDrmAppInstallObserver = new AppDirObserver(
|
||||||
mDrmAppPrivateInstallDir.getPath(), OBSERVER_EVENTS, false);
|
mDrmAppPrivateInstallDir.getPath(), OBSERVER_EVENTS, false);
|
||||||
mDrmAppInstallObserver.startWatching();
|
mDrmAppInstallObserver.startWatching();
|
||||||
scanDirLI(mDrmAppPrivateInstallDir, 0, scanMode);
|
scanDirLI(mDrmAppPrivateInstallDir, 0, scanMode | SCAN_FORWARD_LOCKED);
|
||||||
|
|
||||||
EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SCAN_END,
|
EventLog.writeEvent(LOG_BOOT_PROGRESS_PMS_SCAN_END,
|
||||||
SystemClock.uptimeMillis());
|
SystemClock.uptimeMillis());
|
||||||
@ -1763,7 +1763,12 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
int i;
|
int i;
|
||||||
for (i=0; i<files.length; i++) {
|
for (i=0; i<files.length; i++) {
|
||||||
File file = new File(dir, files[i]);
|
File file = new File(dir, files[i]);
|
||||||
PackageParser.Package pkg = scanPackageLI(file, file, file,
|
File resFile = file;
|
||||||
|
// Pick up the resource path from settings for fwd locked apps
|
||||||
|
if ((scanMode & SCAN_FORWARD_LOCKED) != 0) {
|
||||||
|
resFile = null;
|
||||||
|
}
|
||||||
|
PackageParser.Package pkg = scanPackageLI(file, file, resFile,
|
||||||
flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
|
flags|PackageParser.PARSE_MUST_BE_APK, scanMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1865,8 +1870,12 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
if (ps != null && !ps.codePath.equals(ps.resourcePath)) {
|
if (ps != null && !ps.codePath.equals(ps.resourcePath)) {
|
||||||
scanMode |= SCAN_FORWARD_LOCKED;
|
scanMode |= SCAN_FORWARD_LOCKED;
|
||||||
}
|
}
|
||||||
|
File resFile = destResourceFile;
|
||||||
|
if ((scanMode & SCAN_FORWARD_LOCKED) != 0) {
|
||||||
|
resFile = getFwdLockedResource(ps.name);
|
||||||
|
}
|
||||||
// Note that we invoke the following method only if we are about to unpack an application
|
// Note that we invoke the following method only if we are about to unpack an application
|
||||||
return scanPackageLI(scanFile, destCodeFile, destResourceFile,
|
return scanPackageLI(scanFile, destCodeFile, resFile,
|
||||||
pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE);
|
pkg, parseFlags, scanMode | SCAN_UPDATE_SIGNATURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3808,6 +3817,11 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private File getFwdLockedResource(String pkgName) {
|
||||||
|
final String publicZipFileName = pkgName + ".zip";
|
||||||
|
return new File(mAppInstallDir, publicZipFileName);
|
||||||
|
}
|
||||||
|
|
||||||
private PackageInstalledInfo installPackageLI(Uri pPackageURI,
|
private PackageInstalledInfo installPackageLI(Uri pPackageURI,
|
||||||
int pFlags, boolean newInstall, String installerPackageName) {
|
int pFlags, boolean newInstall, String installerPackageName) {
|
||||||
File tmpPackageFile = null;
|
File tmpPackageFile = null;
|
||||||
@ -3887,8 +3901,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
final String destFilePath = destPackageFile.getAbsolutePath();
|
final String destFilePath = destPackageFile.getAbsolutePath();
|
||||||
File destResourceFile;
|
File destResourceFile;
|
||||||
if ((pFlags&PackageManager.INSTALL_FORWARD_LOCK) != 0) {
|
if ((pFlags&PackageManager.INSTALL_FORWARD_LOCK) != 0) {
|
||||||
final String publicZipFileName = pkgName + ".zip";
|
destResourceFile = getFwdLockedResource(pkgName);
|
||||||
destResourceFile = new File(mAppInstallDir, publicZipFileName);
|
|
||||||
forwardLocked = true;
|
forwardLocked = true;
|
||||||
} else {
|
} else {
|
||||||
destResourceFile = destPackageFile;
|
destResourceFile = destPackageFile;
|
||||||
|
Reference in New Issue
Block a user