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

Commit 47a8e5be authored by Marcin Wojtas's avatar Marcin Wojtas Committed by Android (Google) Code Review
Browse files

Merge "DeviceState: Add a 2nd stage initialization" into main

parents 62b7a14d dd2c9da6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -312,6 +312,13 @@ public final class DeviceStateManagerService extends SystemService {
                mProcessObserver);
    }

    @Override
    public void onBootPhase(int phase) {
        if (phase == PHASE_SYSTEM_SERVICES_READY) {
            mDeviceStatePolicy.getDeviceStateProvider().onSystemReady();
        }
    }

    @VisibleForTesting
    Handler getHandler() {
        return mHandler;
+5 −0
Original line number Diff line number Diff line
@@ -90,6 +90,11 @@ public interface DeviceStateProvider extends Dumpable {
    @Retention(RetentionPolicy.SOURCE)
    @interface SupportedStatesUpdatedReason {}

    /**
     * Called when the system boot phase advances to PHASE_SYSTEM_SERVICES_READY.
     */
    default void onSystemReady() {};

    /**
     * Registers a listener for changes in provider state.
     * <p>