summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2019-09-24 14:44:15 +0100
committerPaul Duffin <paulduffin@google.com>2019-09-25 11:05:52 +0100
commit01f6c021fa3cc3d8a7168ea38d27b3394770d0ef (patch)
treeba093434ce43d609a70f353a9c3b65b45a770c22 /annotations/generate_annotated_java_files.py
parent0d94b993ae698fdd463cc25fc4359e2222cf2cbc (diff)
Add TestRule to enable access to deprecated BC algorithms
Android restricts access to a number of deprecated BouncyCastle algorithms to APKs that target SDK version <= 27. However, those algorithms still need testing. Rather than set the target SDK version to be <= 27 (which could have other side effects) tests use Providers.setMaximumAllowableApiLevelForBcDeprecation(int) to raise the level to make them accessible at the current target SDK version and resets it the default value afterwards. This change adds a JUnit test rule to implement that behavior and uses it to replace duplicate setUp() and tearDown() code across a number of tests. It also insulates the tests from having to access the internal sun.security.jca.Providers and dalvik.system.VMRuntime classes. This is intended to be used by external/conscrypt so that the conscrypt-tests module can stop depending on core-all-systems-module. Bug: 141539296 Test: atest CtsLibcoreTestCases Change-Id: If41b5c221c392e9b6d14d500537115d3380c4999
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions