Merge "Prevent apk-in-apex from being registered under wrong apex" into rvc-qpr-dev
This commit is contained in:
@@ -757,12 +757,15 @@ public abstract class ApexManager {
|
|||||||
void registerApkInApex(AndroidPackage pkg) {
|
void registerApkInApex(AndroidPackage pkg) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
for (ActiveApexInfo aai : mActiveApexInfosCache) {
|
for (ActiveApexInfo aai : mActiveApexInfosCache) {
|
||||||
if (pkg.getBaseCodePath().startsWith(aai.apexDirectory.getAbsolutePath())) {
|
if (pkg.getBaseCodePath().startsWith(
|
||||||
|
aai.apexDirectory.getAbsolutePath() + File.separator)) {
|
||||||
List<String> apks = mApksInApex.get(aai.apexModuleName);
|
List<String> apks = mApksInApex.get(aai.apexModuleName);
|
||||||
if (apks == null) {
|
if (apks == null) {
|
||||||
apks = Lists.newArrayList();
|
apks = Lists.newArrayList();
|
||||||
mApksInApex.put(aai.apexModuleName, apks);
|
mApksInApex.put(aai.apexModuleName, apks);
|
||||||
}
|
}
|
||||||
|
Slog.i(TAG, "Registering " + pkg.getPackageName() + " as apk-in-apex of "
|
||||||
|
+ aai.apexModuleName);
|
||||||
apks.add(pkg.getPackageName());
|
apks.add(pkg.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user