Add config permissions and GIDs handling.

Also set up more actual system states, except for device and profile
owners.

Also add missing runtime-only permission handling, and reorder items
in Permission.kt.

Bug: 252884423
Test: presubmit
Change-Id: I6faf6c192b11ee668cf442dd8b885e761eefea6b
6 files changed