Output a tracing instant when device state changes.

Also set the debug.tracing.device_state system property so that
tracing can determine the initial device state.

SELinux blocks the test app from setting a system property, so
refactor slightly to allow injection of a test implementation
that can also be used to verify the behavior.

Bug: 233041857
Test: Manual & atest com.android.server.devicestate.DeviceStateManagerServiceTest
Change-Id: Ice4e0059c19df9ef8bd814954f9865e68f8d2b17
2 files changed