Loading core/java/android/content/pm/PackageManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -3379,6 +3379,10 @@ public abstract class PackageManager { * 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. * <p> * This shared library no longer exists since Android R. * * @see #getServicesSystemSharedLibraryPackageName() * * @hide */ Loading Loading @@ -4745,6 +4749,9 @@ public abstract class PackageManager { /** * Get the name of the package hosting the services shared library. * <p> * Note that this package is no longer a shared library since Android R. It is now a package * that hosts for a bunch of updatable services that the system binds to. * * @return The library host package. * Loading core/java/android/service/watchdog/ExplicitHealthCheckService.java +3 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SdkConstant; import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading @@ -48,7 +49,8 @@ import java.util.concurrent.TimeUnit; * <p>To extend this class, you must declare the service in your manifest file with the * {@link android.Manifest.permission#BIND_EXPLICIT_HEALTH_CHECK_SERVICE} permission, * and include an intent filter with the {@link #SERVICE_INTERFACE} action. In adddition, * your implementation must live in {@link PackageManger#SYSTEM_SHARED_LIBRARY_SERVICES}. * your implementation must live in * {@link PackageManager#getServicesSystemSharedLibraryPackageName()}. * For example:</p> * <pre> * <service android:name=".FooExplicitHealthCheckService" Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4294,4 +4294,7 @@ <!-- Class name of the custom country detector to be used. --> <string name="config_customCountryDetector" translatable="false">com.android.server.location.ComprehensiveCountryDetector</string> <!-- Package name of the required service extension package. --> <string name="config_servicesExtensionPackage" translatable="false">android.ext.services</string> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3818,4 +3818,5 @@ <java-symbol type="string" name="capability_desc_canTakeScreenshot" /> <java-symbol type="string" name="capability_title_canTakeScreenshot" /> <java-symbol type="string" name="config_servicesExtensionPackage" /> </resources> services/core/java/com/android/server/pm/PackageManagerService.java +17 −6 Original line number Diff line number Diff line Loading @@ -1534,7 +1534,7 @@ public class PackageManagerService extends IPackageManager.Stub final @Nullable String mAppPredictionServicePackage; final @Nullable String mIncidentReportApproverPackage; final @Nullable String[] mTelephonyPackages; final @NonNull String mServicesSystemSharedLibraryPackageName; final @NonNull String mServicesExtensionPackageName; final @NonNull String mSharedSystemSharedLibraryPackageName; private final PackageUsage mPackageUsage = new PackageUsage(); Loading Loading @@ -3303,9 +3303,7 @@ public class PackageManagerService extends IPackageManager.Stub } else { mIntentFilterVerifier = null; } mServicesSystemSharedLibraryPackageName = getRequiredSharedLibraryLPr( PackageManager.SYSTEM_SHARED_LIBRARY_SERVICES, SharedLibraryInfo.VERSION_UNDEFINED); mServicesExtensionPackageName = getRequiredServicesExtensionPackageLPr(); mSharedSystemSharedLibraryPackageName = getRequiredSharedLibraryLPr( PackageManager.SYSTEM_SHARED_LIBRARY_SHARED, SharedLibraryInfo.VERSION_UNDEFINED); Loading @@ -3315,7 +3313,7 @@ public class PackageManagerService extends IPackageManager.Stub mRequiredUninstallerPackage = null; mIntentFilterVerifierComponent = null; mIntentFilterVerifier = null; mServicesSystemSharedLibraryPackageName = null; mServicesExtensionPackageName = null; mSharedSystemSharedLibraryPackageName = null; } // PermissionController hosts default permission granting and role management, so it's a Loading Loading @@ -3745,6 +3743,19 @@ public class PackageManagerService extends IPackageManager.Stub } } @NonNull private String getRequiredServicesExtensionPackageLPr() { String servicesExtensionPackage = ensureSystemPackageName( mContext.getString(R.string.config_servicesExtensionPackage)); if (TextUtils.isEmpty(servicesExtensionPackage)) { throw new RuntimeException( "Required services extension package is missing, check " + "config_servicesExtensionPackage."); } return servicesExtensionPackage; } private @NonNull String getRequiredInstallerLPr() { final Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); intent.addCategory(Intent.CATEGORY_DEFAULT); Loading Loading @@ -5467,7 +5478,7 @@ public class PackageManagerService extends IPackageManager.Stub public @NonNull String getServicesSystemSharedLibraryPackageName() { // allow instant applications synchronized (mLock) { return mServicesSystemSharedLibraryPackageName; return mServicesExtensionPackageName; } } Loading
core/java/android/content/pm/PackageManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -3379,6 +3379,10 @@ public abstract class PackageManager { * 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. * <p> * This shared library no longer exists since Android R. * * @see #getServicesSystemSharedLibraryPackageName() * * @hide */ Loading Loading @@ -4745,6 +4749,9 @@ public abstract class PackageManager { /** * Get the name of the package hosting the services shared library. * <p> * Note that this package is no longer a shared library since Android R. It is now a package * that hosts for a bunch of updatable services that the system binds to. * * @return The library host package. * Loading
core/java/android/service/watchdog/ExplicitHealthCheckService.java +3 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.SdkConstant; import android.annotation.SystemApi; import android.app.Service; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading @@ -48,7 +49,8 @@ import java.util.concurrent.TimeUnit; * <p>To extend this class, you must declare the service in your manifest file with the * {@link android.Manifest.permission#BIND_EXPLICIT_HEALTH_CHECK_SERVICE} permission, * and include an intent filter with the {@link #SERVICE_INTERFACE} action. In adddition, * your implementation must live in {@link PackageManger#SYSTEM_SHARED_LIBRARY_SERVICES}. * your implementation must live in * {@link PackageManager#getServicesSystemSharedLibraryPackageName()}. * For example:</p> * <pre> * <service android:name=".FooExplicitHealthCheckService" Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4294,4 +4294,7 @@ <!-- Class name of the custom country detector to be used. --> <string name="config_customCountryDetector" translatable="false">com.android.server.location.ComprehensiveCountryDetector</string> <!-- Package name of the required service extension package. --> <string name="config_servicesExtensionPackage" translatable="false">android.ext.services</string> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3818,4 +3818,5 @@ <java-symbol type="string" name="capability_desc_canTakeScreenshot" /> <java-symbol type="string" name="capability_title_canTakeScreenshot" /> <java-symbol type="string" name="config_servicesExtensionPackage" /> </resources>
services/core/java/com/android/server/pm/PackageManagerService.java +17 −6 Original line number Diff line number Diff line Loading @@ -1534,7 +1534,7 @@ public class PackageManagerService extends IPackageManager.Stub final @Nullable String mAppPredictionServicePackage; final @Nullable String mIncidentReportApproverPackage; final @Nullable String[] mTelephonyPackages; final @NonNull String mServicesSystemSharedLibraryPackageName; final @NonNull String mServicesExtensionPackageName; final @NonNull String mSharedSystemSharedLibraryPackageName; private final PackageUsage mPackageUsage = new PackageUsage(); Loading Loading @@ -3303,9 +3303,7 @@ public class PackageManagerService extends IPackageManager.Stub } else { mIntentFilterVerifier = null; } mServicesSystemSharedLibraryPackageName = getRequiredSharedLibraryLPr( PackageManager.SYSTEM_SHARED_LIBRARY_SERVICES, SharedLibraryInfo.VERSION_UNDEFINED); mServicesExtensionPackageName = getRequiredServicesExtensionPackageLPr(); mSharedSystemSharedLibraryPackageName = getRequiredSharedLibraryLPr( PackageManager.SYSTEM_SHARED_LIBRARY_SHARED, SharedLibraryInfo.VERSION_UNDEFINED); Loading @@ -3315,7 +3313,7 @@ public class PackageManagerService extends IPackageManager.Stub mRequiredUninstallerPackage = null; mIntentFilterVerifierComponent = null; mIntentFilterVerifier = null; mServicesSystemSharedLibraryPackageName = null; mServicesExtensionPackageName = null; mSharedSystemSharedLibraryPackageName = null; } // PermissionController hosts default permission granting and role management, so it's a Loading Loading @@ -3745,6 +3743,19 @@ public class PackageManagerService extends IPackageManager.Stub } } @NonNull private String getRequiredServicesExtensionPackageLPr() { String servicesExtensionPackage = ensureSystemPackageName( mContext.getString(R.string.config_servicesExtensionPackage)); if (TextUtils.isEmpty(servicesExtensionPackage)) { throw new RuntimeException( "Required services extension package is missing, check " + "config_servicesExtensionPackage."); } return servicesExtensionPackage; } private @NonNull String getRequiredInstallerLPr() { final Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); intent.addCategory(Intent.CATEGORY_DEFAULT); Loading Loading @@ -5467,7 +5478,7 @@ public class PackageManagerService extends IPackageManager.Stub public @NonNull String getServicesSystemSharedLibraryPackageName() { // allow instant applications synchronized (mLock) { return mServicesSystemSharedLibraryPackageName; return mServicesExtensionPackageName; } }