diff options
author | 2024-11-21 22:09:26 +0000 | |
---|---|---|
committer | 2024-11-21 22:09:26 +0000 | |
commit | 9046af84d2a49c2082b9b9c4e6d29ab0465109fa (patch) | |
tree | d92721c6e92d8846f00810ca6140c068ffb5ba68 | |
parent | c90973046aef8b13ca8aa0e90cf0d4214b3b3f4d (diff) | |
parent | 9c8d20822dfa6d17f943354d4b1be5b56bef03e4 (diff) |
Change SignaturePermissionAllowlistConfigTest assertion to Log.w am: e5162bf79a am: 9c8d20822d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Permission/+/3369410
Change-Id: Ia70203effcdb6db0c081a036390bb8d99d655950
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt b/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt index 268bbd317..e6673718f 100644 --- a/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt +++ b/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/SignaturePermissionAllowlistConfigTest.kt @@ -20,6 +20,7 @@ import android.content.pm.ApplicationInfo import android.content.pm.PackageInfo import android.content.pm.PackageManager import android.content.pm.PermissionInfo +import android.util.Log import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import com.android.compatibility.common.util.CddTest @@ -52,13 +53,16 @@ class SignaturePermissionAllowlistConfigTest { } } } - assertTrue( - "Some platform-signed non-system packages don't have their requested platform" + - " signature permissions allowlisted. Suggested signature permission allowlist" + - " additions:\n\n" + - buildSiganturePermissionAllowlist(unallowlistedPackageAndPermissions), - unallowlistedPackageAndPermissions.isEmpty() - ) + // TODO(b/365777291): CDD 9.1/C-0-16 is still STRONGLY RECOMMENDED instead of MUST. + if (unallowlistedPackageAndPermissions.isNotEmpty()) { + Log.w( + LOG_TAG, + "Some platform-signed non-system packages don't have their requested platform" + + " signature permissions allowlisted. Suggested signature permission allowlist" + + " additions:\n\n" + + buildSiganturePermissionAllowlist(unallowlistedPackageAndPermissions), + ) + } } private fun getSignaturePermissionAllowlist(): Map<String, Set<String>> { @@ -107,12 +111,16 @@ class SignaturePermissionAllowlistConfigTest { } } } - assertTrue( - "Some platform-signed non-system packages don't have their requested platform" + - " signature permissions granted. Suggested signature permission allowlist" + - " additions:\n\n${buildSiganturePermissionAllowlist(deniedPackageAndPermissions)}", - deniedPackageAndPermissions.isEmpty() - ) + // TODO(b/365777291): CDD 9.1/C-0-16 is still STRONGLY RECOMMENDED instead of MUST. + if (deniedPackageAndPermissions.isNotEmpty()) { + Log.w( + LOG_TAG, + "Some platform-signed non-system packages don't have their requested platform" + + " signature permissions granted. Suggested signature permission allowlist" + + " additions:\n\n" + + buildSiganturePermissionAllowlist(deniedPackageAndPermissions), + ) + } } private fun getPlatformSignaturePermissionNames(): List<String> = @@ -142,4 +150,8 @@ class SignaturePermissionAllowlistConfigTest { append(" </signature-permissions>\n") } } + + companion object { + private val LOG_TAG = SignaturePermissionAllowlistConfigTest::class.java.simpleName + } } |