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

Commit e0feadca authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Add an API to query the package name of the services shared lib" into nyc-dev

parents e852d93e d7b1f411
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -429,6 +429,16 @@ public class ApplicationPackageManager extends PackageManager {
        }
    }

    /** @hide */
    @Override
    public @Nullable String getServicesSystemSharedLibraryPackageName() {
        try {
            return mPM.getServicesSystemSharedLibraryPackageName();
        } catch (RemoteException e) {
            throw new RuntimeException("Package manager has died", e);
        }
    }

    @Override
    public FeatureInfo[] getSystemAvailableFeatures() {
        try {
+2 −0
Original line number Diff line number Diff line
@@ -534,4 +534,6 @@ interface IPackageManager {
    boolean isEphemeralApplication(String packageName, int userId);

    boolean setRequiredForSystemUser(String packageName, boolean systemUserApp);

    String getServicesSystemSharedLibraryPackageName();
}
+31 −0
Original line number Diff line number Diff line
@@ -2326,6 +2326,28 @@ public abstract class PackageManager {
    @SystemApi
    public static final int MASK_PERMISSION_FLAGS = 0xFF;

    /**
     * This is a library that contains components apps can invoke. For
     * example, a services for apps to bind to, or standard chooser UI,
     * etc. This library is versioned and backwards compatible. Clients
     * should check its version via {@link android.ext.services.Version
     * #getVersionCode()} and avoid calling APIs added in later versions.
     *
     * @hide
     */
    public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services";

    /**
     * This is a library that contains components apps can dynamically
     * load. For example, new widgets, helper classes, etc. This library
     * is versioned and backwards compatible. Clients should check its
     * version via {@link android.ext.shared.Version#getVersionCode()}
     * and avoid calling APIs added in later versions.
     *
     * @hide
     */
    public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared";

    /**
     * Retrieve overall information about an application package that is
     * installed on the system.
@@ -3364,6 +3386,15 @@ public abstract class PackageManager {
     */
    public abstract String[] getSystemSharedLibraryNames();

    /**
     * Get the name of the package hosting the services shared library.
     *
     * @return The library host package.
     *
     * @hide
     */
    public abstract @Nullable String getServicesSystemSharedLibraryPackageName();

    /**
     * Get a list of features that are available on the
     * system.
+12 −0
Original line number Diff line number Diff line
@@ -3426,6 +3426,18 @@ public class PackageManagerService extends IPackageManager.Stub {
        return null;
    }
    @Override
    public @Nullable String getServicesSystemSharedLibraryPackageName() {
        synchronized (mPackages) {
            SharedLibraryEntry libraryEntry = mSharedLibraries.get(
                    PackageManager.SYSTEM_SHARED_LIBRARY_SERVICES);
            if (libraryEntry != null) {
                return libraryEntry.apk;
            }
        }
        return null;
    }
    @Override
    public FeatureInfo[] getSystemAvailableFeatures() {
        Collection<FeatureInfo> featSet;
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.test.mock;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.PackageInstallObserver;
import android.content.ComponentName;
import android.content.Intent;
@@ -806,6 +807,12 @@ public class MockPackageManager extends PackageManager {
        throw new UnsupportedOperationException();
    }

    /** @hide */
    @Override
    public @Nullable String getServicesSystemSharedLibraryPackageName() {
        throw new UnsupportedOperationException();
    }

    @Override
    public FeatureInfo[] getSystemAvailableFeatures() {
        throw new UnsupportedOperationException();