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

Commit 527b24f1 authored by JW Wang's avatar JW Wang
Browse files

Fix comparator

The original code doesn't satisfy
compare(x,y) == -compare(y,x)

Bug: 225756739
Bug: 238202065
Test: presubmit
Change-Id: I26ca8096a3362a07c5cd10985ffc905271f6703b
parent 8bc7ad63
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3464,8 +3464,9 @@ final class InstallPackageHelper {
        }
        // Sort the list to ensure we always process factory packages first
        Collections.sort(parseResults, (a, b) -> {
            ApexInfo ai = parsingApexInfo.get(a.scanFile);
            return ai.isFactory ? -1 : 1;
            ApexInfo i1 = parsingApexInfo.get(a.scanFile);
            ApexInfo i2 = parsingApexInfo.get(b.scanFile);
            return Boolean.compare(i2.isFactory, i1.isFactory);
        });