Ensure PropertyInvalidatedCache test mode in all locksettings tests
WeakEscrowTokenTests (and possibly other test classes in
com.android.server.locksettings) was missing a call to
PropertyInvalidatedCache.disableForTestMode(). There are other tests in
com.android.server.locksettings that do make that call, and it applies
to the whole process. So WeakEscrowTokenTests was relying on the
implicit test ordering, and it failed when run by itself.
To fix this, move the enabling of test mode into
BaseLockSettingsServiceTests, which is the base class that all the
relevant test classes inherit from.
Additionally, switch from a process-wide toggle to a per-test toggle.
That ensures implicit test ordering is no longer being relied on.
Test: atest FrameworksServicesTests:WeakEscrowTokenTests
Test: atest FrameworksServicesTests:com.android.server.locksettings
Bug: 418862901
Flag: TEST_ONLY
Change-Id: I30f451ff46b3a46bd5a89f6d618df69db6506f75
8 files changed