Make test for hardware AES support explicit.

Various test expectations in StandardNames are determined by
CpuFeatures.isAESHardwareAccelerated().  Currently this also
acts as a test for AES not being available when expected because
assorted tests will fail in that scenario.

This change makes CpuFeatures.isAESHardwareAccelerated() return
the actual state of hardware acceleration as determined by
BoringSSL and adds a test for AES being enabled on platforms
where we know we should expect it.

Once this change lands I propose to make the equivalent change
in Conscrypt's copy of CpuFeatures.isAESHardwareAccelerated()
but only run the test for expected acceleration on non-Android
platforms where there is no need to handle emulated environments.

This is intended as a cleaner replacement for
https://r.android.com/1214558 to avoid adding native test code.

Test results:
Taimen:
    ABI arm64-v8a: PASSED
    ABI armeabi-v7a: PASSED
Cuttlefish:
    ABI x86: ASSUMPTION_FAILED
x86 AVD:
    ABI x86: ASSUMPTION_FAILED
x86_64 AVD:
    ABI x86_64: PASSED
    ABI x86: ASSUMPTION_FAILED

ABI in the above results is the ABI reported by atest.

ASSUMPTION_FAILED means that isKnownToSupportHardwareAes()
returned false for this ABI/hardware combination and so
isAesHardwareAccelerated() was not tested.

PASSED means isKnownToSupportHardwareAes() and
isAesHardwareAccelerated() both returned true.

Not tested: Physical x86_64 hardware or 32 bit only ARM,
but the results above demonstrate that our test expectations
are correct.

Bug: 144885685
Test: atest -a CtsLibcoreTestCases:libcore.javax.crypto.HardwareAesTest
    (See above for results on different platforms)
Change-Id: Ifec9b8f95eb71d4aa26fd0dc6df295a213b43a0b
(cherry picked from commit 1069fe063a36679a371284c7a3e4b587b40bf4ea)
3 files changed