Restart after flag changes on screen off.

On debug builds, restart as soon as the screen goes off.
On release builds, restart after the device is plugged in,
the screen is off, and the device has been idle for a few
seconds.

The flag app does not yet reflect this change, but it will
allow multiple flags to be flipped.

Bug: 257302229
Test: manual
Change-Id: I9da58f9881973d69fc0e35b394ca42a4166ceb08
9 files changed