Merge "Protect setPermissionGrantState coexistence code." into main