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

Commit 34cf12c0 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Break shared library adds into populate and modify

This change breaks current modification of shared lib state in the
system into object creation and a commit step so that multiple packages
may be interrogated before committing anything to the system.

Change-Id: I466d588be3e9690cffc8a04e025145d747fcbb2f
Bug: 109941548
Test: atest StaticSharedLibsHostTests
parent 8a8ec5a5
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -33,10 +33,28 @@ import java.util.List;
 * This class provides information for a shared library. There are
 * three types of shared libraries: builtin - non-updatable part of
 * the OS; dynamic - updatable backwards-compatible dynamically linked;
 * static - updatable non backwards-compatible emulating static linking.
 * static - non backwards-compatible emulating static linking.
 */
public final class SharedLibraryInfo implements Parcelable {

    /** @hide */
    public static SharedLibraryInfo createForStatic(PackageParser.Package pkg) {
        return new SharedLibraryInfo(null, pkg.packageName, pkg.getAllCodePaths(),
                pkg.staticSharedLibName,
                pkg.staticSharedLibVersion,
                TYPE_STATIC,
                new VersionedPackage(pkg.manifestPackageName, pkg.getLongVersionCode()),
                null, null);
    }

    /** @hide */
    public static SharedLibraryInfo createForDynamic(PackageParser.Package pkg, String name) {
        return new SharedLibraryInfo(null, pkg.packageName, pkg.getAllCodePaths(), name,
                (long) VERSION_UNDEFINED,
                TYPE_DYNAMIC, new VersionedPackage(pkg.packageName, pkg.getLongVersionCode()),
                null, null);
    }

    /** @hide */
    @IntDef(flag = true, prefix = { "TYPE_" }, value = {
            TYPE_BUILTIN,
+374 −212

File changed.

Preview size limit exceeded, changes collapsed.