Enforce owner rights check to get/setMimeGroup

In the normal cases, the package name and the calling uid should be
from the same application. Adding this checking to get/setMimeGroup,
and moving the implementation to the internal variants. Also, guard
PackageSetting with the synchronized.

Bug: 184745603
Bug: 184745431
Test: atest CtsDynamicMimeHostTestCases
Test: manually using the PoC in the buganizer to ensure the symptom
      no longer exists.
Change-Id: Ic6956a55077ba4f3aed4df405b6db7219de8b267
1 file changed