← Back to Blogs

Android Shutdown Sequence

How Android shuts down gracefully, and how Automotive differs from a phone

1 min read
Android Shutdown Sequence

Every time Android shuts down, a precise chain of events ensures apps get a chance to save state, services stop cleanly, data is flushed, and only then does the kernel power off the hardware. The sequence differs significantly between a regular phone and an Android Automotive device.

Phone Shutdown: SystemUI Triggers It

On a regular Android phone, the user presses and holds the power button. The kernel sends a key event which SystemUI intercepts. SystemUI displays the power menu (Power off, Restart, Emergency). When the user taps Power off, SystemUI calls PowerManager.shutdown() which crosses into PowerManagerService inside system_server, and from there ShutdownThread takes over to orchestrate the graceful shutdown.

Phone Shutdown Flow

Phone Shutdown Flow

Automotive Shutdown: VHAL Triggers It

In Android Automotive, there is no user holding a power button the same way. The vehicle itself decides when to shut down, for example when the ignition is turned off, a sleep timer expires, or the vehicle enters a power-saving state. The Vehicle HAL (VHAL) communicates this to Android by setting a vendor property.

Android Automotive Shutdown Sequence

Android Automotive Shutdown Sequence

How Phone and Automotive Differ

What Happens to Apps During Shutdown

The image in this post shows the Android Automotive variant. In AOSP automotive builds, CarPowerManagementService is the critical layer that bridges vehicle hardware events to the Android framework shutdown path. On a regular phone, this layer does not exist and SystemUI talks directly to PowerManagerService.