Merge changes from topic "TestSplitRuntimePermissions"

* changes:
  Apply fg/bg state in default grant policy
  Do not inherit grant of background location
  Split permissions inherit state from their parents
  Have a map of background -> foreground permssions
  Give 'restorePermissionState' a better name