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

Commit 18ebadcc authored by Ivan Chiang's avatar Ivan Chiang Committed by Android (Google) Code Review
Browse files

Merge "Fix to pass apex package names to ApexManager methods" into main

parents f5798466 fafd2494
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -180,7 +180,9 @@ final class InitAppsHelper {
        // priority of system overlays.
        final ArrayMap<String, File> apkInApexPreInstalledPaths = new ArrayMap<>();
        for (ApexManager.ActiveApexInfo apexInfo : mApexManager.getActiveApexInfos()) {
            for (String packageName : mApexManager.getApksInApex(apexInfo.apexModuleName)) {
            final String apexPackageName = mApexManager.getActivePackageNameForApexModuleName(
                    apexInfo.apexModuleName);
            for (String packageName : mApexManager.getApksInApex(apexPackageName)) {
                apkInApexPreInstalledPaths.put(packageName, apexInfo.preInstalledApexPath);
            }
        }
+8 −4
Original line number Diff line number Diff line
@@ -343,10 +343,12 @@ public class ApexManagerTest {
        List<ApexManager.ScanResult> scanResults = scanApexInfos(apexInfo);
        mApexManager.notifyScanResult(scanResults);

        assertThat(mApexManager.getApkInApexInstallError(activeApex.apexModuleName)).isNull();
        final String apexPackageName = mApexManager.getActivePackageNameForApexModuleName(
                activeApex.apexModuleName);
        assertThat(mApexManager.getApkInApexInstallError(apexPackageName)).isNull();
        mApexManager.reportErrorWithApkInApex(activeApex.apexDirectory.getAbsolutePath(),
                "Some random error");
        assertThat(mApexManager.getApkInApexInstallError(activeApex.apexModuleName))
        assertThat(mApexManager.getApkInApexInstallError(apexPackageName))
                .isEqualTo("Some random error");
    }

@@ -370,9 +372,11 @@ public class ApexManagerTest {
        List<ApexManager.ScanResult> scanResults = scanApexInfos(apexInfo);
        mApexManager.notifyScanResult(scanResults);

        assertThat(mApexManager.getApksInApex(activeApex.apexModuleName)).isEmpty();
        final String apexPackageName = mApexManager.getActivePackageNameForApexModuleName(
                activeApex.apexModuleName);
        assertThat(mApexManager.getApksInApex(apexPackageName)).isEmpty();
        mApexManager.registerApkInApex(fakeApkInApex);
        assertThat(mApexManager.getApksInApex(activeApex.apexModuleName)).isEmpty();
        assertThat(mApexManager.getApksInApex(apexPackageName)).isEmpty();
    }

    @Test