Global/Guest restrictions to be saved only on SYSTEM user's xml file

All users on a device share the same global device policies. The existing implementation saves them in each user's individual XML file
This leads to unnecessary duplication and it also doesn't update the global settings in stopped user's XML which could lead to outdated global settings if we change the way we read the XML files in the future.
Similar to that the guest restrictions which is also not attached to a single user is saved in userlist.xml which is intended to store the list of the users.

Since the SYSTEM user is always present on the device, we refactored the device policy global restrictions and guest restrictions writing to save them only in the SYSTEM user's XML file.

Bug: 299475754
Test: atest UserManagerServiceUserInfoTest#testWriteReadDevicePolicyUserRestrictions -c
Change-Id: I1f8f0e9c624903798eb51899620fa99ab45de3ee
2 files changed