diff --git a/api/Android.bp b/api/Android.bp index 29eaec6ffbd21..7fb647cd68535 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -98,6 +98,7 @@ combined_apis { "framework-connectivity", "framework-connectivity-t", "framework-graphics", + "framework-healthconnect", "framework-media", "framework-mediaprovider", "framework-ondevicepersonalization", @@ -114,6 +115,7 @@ combined_apis { ], system_server_classpath: [ "service-art", + "service-healthconnect", "service-media-s", "service-permission", "service-sdksandbox", diff --git a/core/api/current.txt b/core/api/current.txt index 65c1f4640428a..e356dc72b1bc6 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -9831,6 +9831,7 @@ package android.content { field public static final String FINGERPRINT_SERVICE = "fingerprint"; field public static final String GAME_SERVICE = "game"; field public static final String HARDWARE_PROPERTIES_SERVICE = "hardware_properties"; + field public static final String HEALTHCONNECT_SERVICE = "healthconnect"; field public static final String INPUT_METHOD_SERVICE = "input_method"; field public static final String INPUT_SERVICE = "input"; field public static final String IPSEC_SERVICE = "ipsec"; diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index e5c080acbedb3..d5b85cde49262 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -111,6 +111,7 @@ import android.hardware.location.ContextHubManager; import android.hardware.radio.RadioManager; import android.hardware.usb.IUsbManager; import android.hardware.usb.UsbManager; +import android.healthconnect.HealthServicesInitializer; import android.location.CountryDetector; import android.location.ICountryDetector; import android.location.ILocationManager; @@ -1524,6 +1525,7 @@ public final class SystemServiceRegistry { BluetoothFrameworkInitializer.registerServiceWrappers(); TelephonyFrameworkInitializer.registerServiceWrappers(); AppSearchManagerFrameworkInitializer.initialize(); + HealthServicesInitializer.registerServiceWrappers(); WifiFrameworkInitializer.registerServiceWrappers(); StatsFrameworkInitializer.registerServiceWrappers(); RollbackManagerFrameworkInitializer.initialize(); diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 430b52c28f272..c658b3e11c477 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -6049,6 +6049,15 @@ public abstract class Context { @SystemApi public static final String AMBIENT_CONTEXT_SERVICE = "ambient_context"; + /** + * Use with {@link #getSystemService(String)} to retrieve a + * {@link android.healthconnect.HealthConnectManager}. + * + * @see #getSystemService(String) + * @see android.healthconnect.HealthConnectManager + */ + public static final String HEALTHCONNECT_SERVICE = "healthconnect"; + /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 7652d6df133a5..7563643dc5caa 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -399,7 +399,8 @@ public final class SystemServer implements Dumpable { "com.android.server.media.MediaCommunicationService"; private static final String APP_COMPAT_OVERRIDES_SERVICE_CLASS = "com.android.server.compat.overrides.AppCompatOverridesService$Lifecycle"; - + private static final String HEALTHCONNECT_MANAGER_SERVICE_CLASS = + "com.android.server.healthconnect.HealthConnectManagerService"; private static final String ROLE_SERVICE_CLASS = "com.android.role.RoleService"; private static final String GAME_MANAGER_SERVICE_CLASS = "com.android.server.app.GameManagerService$Lifecycle"; @@ -2735,6 +2736,10 @@ public final class SystemServer implements Dumpable { mSystemServiceManager.startService(APP_COMPAT_OVERRIDES_SERVICE_CLASS); t.traceEnd(); + t.traceBegin("HealthConnectManagerService"); + mSystemServiceManager.startService(HEALTHCONNECT_MANAGER_SERVICE_CLASS); + t.traceEnd(); + // These are needed to propagate to the runnable below. final NetworkManagementService networkManagementF = networkManagement; final NetworkPolicyManagerService networkPolicyF = networkPolicy;