Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e31ca56a authored by Eric Biggers's avatar Eric Biggers
Browse files

Test both AIDL and HIDL Weaver interfaces in locksettings unit tests

Since Android 14, the current Weaver HAL interface has been the AIDL
interface.  But the HIDL interface is still supported too, considering
that devices may upgrade Android without upgrading Weaver.  Until now,
MockWeaverService implemented only the old (HIDL) interface.

Change it to instead implement the current (AIDL) interface, and provide
support for the old (HIDL) interface via an adapter.  Then, split
WeaverBasedSyntheticPasswordTests into two test classes, one that runs
with the HIDL interface and one that runs with the AIDL interface.  This
provides unit test coverage for the code that uses each interface.

Also, for read() with an incorrect key, return INCORRECT_KEY instead of
FAILED.  This matches what real Weaver implementations return.  This
does not change the result of any existing test.

Test: atest FrameworksServicesTests:com.android.server.locksettings
Bug: 182976659
Bug: 395976735
Flag: TEST_ONLY
Change-Id: I97fed67dae87ca9f4e1a6d24a790c1387509e8c0
parent 7fac4b7b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment