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

Commit 1d94eb9e authored by Gavin Corkery's avatar Gavin Corkery
Browse files

Initialize RebootReadinessManagerService

Initialize reboot readiness service from the
system server. This service is started
by calling into service-scheduling.jar
directly.

Test: Manual, add logs to check that service
      is correctly started.
Bug: 161353402

Change-Id: I06d55ee6ee5c3dde7524cf508324fd408fb81d22
parent 338545d7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2120,6 +2120,7 @@ package android.content {
    field public static final String OEM_LOCK_SERVICE = "oem_lock";
    field public static final String PERMISSION_SERVICE = "permission";
    field public static final String PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block";
    field public static final String REBOOT_READINESS_SERVICE = "reboot_readiness";
    field public static final String ROLLBACK_SERVICE = "rollback";
    field public static final String SEARCH_UI_SERVICE = "search_ui";
    field public static final String SECURE_ELEMENT_SERVICE = "secure_element";
+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ import android.permission.PermissionControllerManager;
import android.permission.PermissionManager;
import android.print.IPrintManager;
import android.print.PrintManager;
import android.scheduling.SchedulingFrameworkInitializer;
import android.security.FileIntegrityManager;
import android.security.IFileIntegrityService;
import android.service.oemlock.IOemLockService;
@@ -1440,6 +1441,7 @@ public final class SystemServiceRegistry {
            MediaFrameworkPlatformInitializer.registerServiceWrappers();
            MediaFrameworkInitializer.registerServiceWrappers();
            RoleFrameworkInitializer.registerServiceWrappers();
            SchedulingFrameworkInitializer.registerServiceWrappers();
        } finally {
            // If any of the above code throws, we're in a pretty bad shape and the process
            // will likely crash, but we'll reset it just in case there's an exception handler...
+12 −0
Original line number Diff line number Diff line
@@ -3520,6 +3520,7 @@ public abstract class Context {
            APPWIDGET_SERVICE,
            //@hide: VOICE_INTERACTION_MANAGER_SERVICE,
            //@hide: BACKUP_SERVICE,
            REBOOT_READINESS_SERVICE,
            ROLLBACK_SERVICE,
            DROPBOX_SERVICE,
            //@hide: DEVICE_IDLE_CONTROLLER,
@@ -4741,6 +4742,17 @@ public abstract class Context {
    @SystemApi
    public static final String ROLLBACK_SERVICE = "rollback";

    /**
     * Use with {@link #getSystemService(String)} to retrieve an
     * {@link android.app.scheduling.RebootReadinessManagerService} for communicating
     * with the reboot readiness detector.
     *
     * @see #getSystemService(String)
     * @hide
     */
    @SystemApi
    public static final String REBOOT_READINESS_SERVICE = "reboot_readiness";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.os.DropBoxManager} instance for recording
+10 −0
Original line number Diff line number Diff line
@@ -252,6 +252,10 @@ public final class SystemServer implements Dumpable {
            "com.android.server.companion.CompanionDeviceManagerService";
    private static final String STATS_COMPANION_APEX_PATH =
            "/apex/com.android.os.statsd/javalib/service-statsd.jar";
    private static final String SCHEDULING_APEX_PATH =
            "/apex/com.android.scheduling/javalib/service-scheduling.jar";
    private static final String REBOOT_READINESS_LIFECYCLE_CLASS =
            "com.android.server.scheduling.RebootReadinessManagerService$Lifecycle";
    private static final String CONNECTIVITY_SERVICE_APEX_PATH =
            "/apex/com.android.tethering/javalib/service-connectivity.jar";
    private static final String STATS_COMPANION_LIFECYCLE_CLASS =
@@ -2446,6 +2450,12 @@ public final class SystemServer implements Dumpable {
                STATS_COMPANION_LIFECYCLE_CLASS, STATS_COMPANION_APEX_PATH);
        t.traceEnd();

        // Reboot Readiness
        t.traceBegin("StartRebootReadinessManagerService");
        mSystemServiceManager.startServiceFromJar(
                REBOOT_READINESS_LIFECYCLE_CLASS, SCHEDULING_APEX_PATH);
        t.traceEnd();

        // Statsd pulled atoms
        t.traceBegin("StartStatsPullAtomService");
        mSystemServiceManager.startService(STATS_PULL_ATOM_SERVICE_CLASS);