Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ea67b0c authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Automerger Merge Worker
Browse files

Merge "Prevent apk-in-apex from being registered under wrong apex" into rvc-qpr-dev am: 21d910e0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14211761

Change-Id: I296b1d98f4268773f712c4b7167cd291d4731c94
parents 8380a16e 21d910e0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -766,12 +766,15 @@ public abstract class ApexManager {
        void registerApkInApex(AndroidPackage pkg) {
            synchronized (mLock) {
                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);
                        if (apks == null) {
                            apks = Lists.newArrayList();
                            mApksInApex.put(aai.apexModuleName, apks);
                        }
                        Slog.i(TAG, "Registering " + pkg.getPackageName() + " as apk-in-apex of "
                                + aai.apexModuleName);
                        apks.add(pkg.getPackageName());
                    }
                }