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

Commit ce6c5e7b authored by Doug Anderson's avatar Doug Anderson Committed by Android (Google) Code Review
Browse files

Merge changes from topic "b409835922" into main

* changes:
  power: Move setting `sys.shutdown.requested` earlier
  power: Fix import order for com.android.server.LocalServices
parents 3d3000cc fc5f98d9
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -59,8 +59,8 @@ import android.view.SurfaceControl;
import android.view.WindowManager;

import com.android.internal.annotations.VisibleForTesting;
import com.android.server.PackageWatchdog;
import com.android.server.LocalServices;
import com.android.server.PackageWatchdog;
import com.android.server.statusbar.StatusBarManagerInternal;

import java.io.File;
@@ -404,6 +404,20 @@ public final class ShutdownThread extends Thread {
            sIsStarted = true;
        }

        /*
         * Write a system property in case the system_server reboots before we
         * get to the actual hardware restart. If that happens, we'll retry at
         * the beginning of the SystemServer startup.
         *
         * NOTE: the `init` process also monitors this property to kick off a
         * watchdog making sure that the shutdown process doesn't take too long.
         */
        {
            String reason = (sInstance.mReboot ? "1" : "0")
                          + (sInstance.mReason != null ? sInstance.mReason : "");
            SystemProperties.set(SHUTDOWN_ACTION_PROPERTY, reason);
        }

        sInstance.mProgressDialog = showShutdownDialog(context);
        sInstance.mContext = context;
        sInstance.mPowerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
@@ -470,16 +484,6 @@ public final class ShutdownThread extends Thread {
                new File(CHECK_POINTS_FILE_BASENAME));
        dumpCheckPointsThread.start();

        /*
         * Write a system property in case the system_server reboots before we
         * get to the actual hardware restart. If that happens, we'll retry at
         * the beginning of the SystemServer startup.
         */
        {
            String reason = (mReboot ? "1" : "0") + (mReason != null ? mReason : "");
            SystemProperties.set(SHUTDOWN_ACTION_PROPERTY, reason);
        }

        /*
         * If we are rebooting into safe mode, write a system property
         * indicating so.