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

Commit b3e74b2f authored by Calin Juravle's avatar Calin Juravle
Browse files

Add missing return in DexManager

Harmless issue but which can spam the logs.

Test: mostly manual since the check is buried deep inside and cannot be
verified accurately. I added another test to DexManager to stress that
code path and then checked the logs.

Bug: 36117123

(cherry picked from commit 2dfc1b3e)

Merged-In: I1a878a200f3f726dfaa85f1bed1398acc8dce979
Change-Id: Ib2c034add2e8229b90eb4aaa0067d42d26798670
parent 24ff75fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ public class DexManager {
        // Ignore framework code.
        // TODO(calin): is there a better way to detect it?
        if (dexPath.startsWith("/system/framework/")) {
            new DexSearchResult("framework", DEX_SEARCH_NOT_FOUND);
            return new DexSearchResult("framework", DEX_SEARCH_NOT_FOUND);
        }

        // First, check if the package which loads the dex file actually owns it.
+9 −1
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ public class DexManagerTests {

    @Before
    public void setup() {

        mUser0 = 0;
        mUser1 = 1;

@@ -352,6 +351,15 @@ public class DexManagerTests {
        assertNull(pui);
    }

    @Test
    public void testNotifyFrameworkLoad() {
        String frameworkDex = "/system/framework/com.android.location.provider.jar";
        // Load a dex file from framework.
        notifyDexLoad(mFooUser0, Arrays.asList(frameworkDex), mUser0);
        // The dex file should not be recognized as a package.
        assertNull(mDexManager.getPackageUseInfo(frameworkDex));
    }

    private void assertSecondaryUse(TestData testData, PackageUseInfo pui,
            List<String> secondaries, boolean isUsedByOtherApps, int ownerUserId) {
        for (String dex : secondaries) {