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

Commit b12dcfb1 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Remove org.apache.http.legacy for declared shared lib lists.

We currently unconditionally include this shared library in the
boot classpath, so attempts to compile it will fail resulting in
unnecessary logspam.

Change-Id: Iafe9b2e725e10d939cd39dd4a816a146a6031baf
parent 0b037e93
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -2750,15 +2750,21 @@ public class PackageParser {
            }
        }

        addSharedLibrariesForBackwardCompatibility(owner);
        modifySharedLibrariesForBackwardCompatibility(owner);

        return true;
    }

    private static void addSharedLibrariesForBackwardCompatibility(Package owner) {
        if (owner.applicationInfo.targetSdkVersion <= Build.VERSION_CODES.LOLLIPOP_MR1) {
            owner.usesLibraries = ArrayUtils.add(owner.usesLibraries, "org.apache.http.legacy");
        }
    private static void modifySharedLibrariesForBackwardCompatibility(Package owner) {
        // "org.apache.http.legacy" is now a part of the boot classpath so it doesn't need
        // to be an explicit dependency.
        //
        // A future change will remove this library from the boot classpath, at which point
        // all apps that target SDK 21 and earlier will have it automatically added to their
        // dependency lists.
        owner.usesLibraries = ArrayUtils.remove(owner.usesLibraries, "org.apache.http.legacy");
        owner.usesOptionalLibraries = ArrayUtils.remove(owner.usesOptionalLibraries,
                "org.apache.http.legacy");
    }

    /**