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 https://googleplex-android-review.googlesource.com/q/commit:4cb6e4d8317f100aef2f6988aa2adf692ee19e67)
Merged-In: I37b550f0c3933bc790c2917a14e917efbcccc4e8
Change-Id: I37b550f0c3933bc790c2917a14e917efbcccc4e8
13 files changed