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

Skip to content
Commit 10531da3 authored by Eric Biggers's avatar Eric Biggers
Browse files

Fix and improve TrustManagerServiceTest

- Make these unit tests have fewer dependencies on the system.  For
  example, don't use the system's real UserManagerService and
  LockSettingsService.  Use userId 50 instead of userId 0 to help avoid
  unwanted dependencies.

- Set up more things in setUp() so that individual tests don't need to.

- Run the TrustManagerService handler on a separate thread so that code
  that flushes the message queue does not cause a deadlock.  The
  existing tests are fine without this, but this is needed for a later
  CL that adds tests that call reportKeyguardShowingChanged().

This fixes failures in firstBootCompleted_defaultTrustAgentEnabled,
newSystemTrustAgent_notEnabledWhenDefaultAgentIsSet, and
serviceBooted_knownAgentsNotSet_enabledAgentsNotUpdated.

Bug: 296464083
Test: atest TrustManagerServiceTest
Change-Id: I6d1baacd38275b3cc9ba583b98ed1b139123ea9b
parent 60b7604d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment