Introduce hidden logging API for restriction types and reasons

Hidden API to be called from various parts of the system to
log when app restriction levels change. The API should be called
before a state change occurs, to log/store the reason before
the actual change to restriction state occurs.

Initial usage of the API to track hibernation, power-allowlist
exemption and background restriction.

More logging of state changes to follow...

Bug: 333882527
Test: m -j statsd_testdrive && statsd_testdrive 863
      Manually play with settings UI to restrict app
      or force-stop

Change-Id: Ic58f111c2c23108d8c28691bf0d8b69017ce2bcd
10 files changed