Fix Dynamic Permission group auto grant behaivor

Fix the Dynamic Permission group auto grant behaivor so that a
permission group is only considered granted when (1) all permissions
were auto-granted or (2) a platform permission in the same group is
granted.

Bug: 340480881
Test: DynamicPermissionsTest
(cherry picked from commit 46abb4e1fd365a88efdfe3f2b1f87da4d255b41b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:111cac570a0f596cdca1b1d512dfbef17751e1a5)
Merged-In: Ie7de1b9826df72c708df02a4b73707c8fcffac86
Change-Id: Ie7de1b9826df72c708df02a4b73707c8fcffac86
21 files changed