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

Commit 408108c3 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

SDK -> SDK_PACKAGE to address API feedback.

+documentation updated,
+don't load SDKs automatically.

Bug: 208096588
Bug: 210622326
Test: presubmit
Change-Id: I52efce96111ba72a788404f5eca92da2554fc807
parent 3578c8f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12225,7 +12225,7 @@ package android.content.pm {
    field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.SharedLibraryInfo> CREATOR;
    field public static final int TYPE_BUILTIN = 0; // 0x0
    field public static final int TYPE_DYNAMIC = 1; // 0x1
    field public static final int TYPE_SDK = 3; // 0x3
    field public static final int TYPE_SDK_PACKAGE = 3; // 0x3
    field public static final int TYPE_STATIC = 2; // 0x2
    field public static final int VERSION_UNDEFINED = -1; // 0xffffffff
  }
+4 −0
Original line number Diff line number Diff line
@@ -746,6 +746,10 @@ public final class LoadedApk {
                // default linker namespace.
                continue;
            }
            if (info.isSdk()) {
                // SDKs are not loaded automatically.
                continue;
            }
            if (libsToLoadAfter.contains(info.getName())) {
                if (DEBUG) {
                    Slog.v(ActivityThread.TAG,
+13 −7
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public final class SharedLibraryInfo implements Parcelable {
            TYPE_BUILTIN,
            TYPE_DYNAMIC,
            TYPE_STATIC,
            TYPE_SDK,
            TYPE_SDK_PACKAGE,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface Type{}
@@ -68,15 +68,21 @@ public final class SharedLibraryInfo implements Parcelable {
     * Shared library type: this library is <strong>not</strong> backwards
     * -compatible, can be updated and updates can be uninstalled. Clients
     * link against a specific version of the library.
     *
     * Static shared libraries simulate static linking while allowing for
     * multiple clients to reuse the same instance of the library.
     */
    public static final int TYPE_STATIC = 2;

    /**
     * SDK library type: this library is <strong>not</strong> backwards
     * -compatible, can be updated and updates can be uninstalled. Clients
     * depend on a specific version of the library.
     * SDK package shared library type: this library is <strong>not</strong>
     * compatible between versions, can be updated and updates can be
     * uninstalled. Clients depend on a specific version of the library.
     *
     * SDK packages are not loaded automatically by the OS and rely
     * e.g. on 3P libraries to make them available for the clients.
     */
    public static final int TYPE_SDK = 3;
    public static final int TYPE_SDK_PACKAGE = 3;

    /**
     * Constant for referring to an undefined version.
@@ -301,7 +307,7 @@ public final class SharedLibraryInfo implements Parcelable {
     * @hide
     */
    public boolean isSdk() {
        return mType == TYPE_SDK;
        return mType == TYPE_SDK_PACKAGE;
    }

    /**
@@ -367,7 +373,7 @@ public final class SharedLibraryInfo implements Parcelable {
            case TYPE_STATIC: {
                return "static";
            }
            case TYPE_SDK: {
            case TYPE_SDK_PACKAGE: {
                return "sdk";
            }
            default: {
+1 −1
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ class PackageManagerShellCommand extends ShellCommand {
                final List<SharedLibraryInfo> libs = libsSlice.getList();
                for (int l = 0, lsize = libs.size(); l < lsize; ++l) {
                    SharedLibraryInfo lib = libs.get(l);
                    if (lib.getType() == SharedLibraryInfo.TYPE_SDK) {
                    if (lib.getType() == SharedLibraryInfo.TYPE_SDK_PACKAGE) {
                        name = lib.getName() + ":" + lib.getLongVersion();
                        break;
                    }
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class AndroidPackageUtils {
                AndroidPackageUtils.getAllCodePaths(pkg),
                pkg.getSdkLibName(),
                pkg.getSdkLibVersionMajor(),
                SharedLibraryInfo.TYPE_SDK,
                SharedLibraryInfo.TYPE_SDK_PACKAGE,
                new VersionedPackage(pkg.getManifestPackageName(),
                        pkg.getLongVersionCode()),
                null, null, false /* isNative */);
Loading