Resolve trust agents on USER_STARTED in addition to USER_ADDED.
ACTION_USER_ADDED is a broadcast that is sent once when the user is
created. TrustManagerService resolves the enabled trust agents for an
user only when the user is created. However, if there is a reboot or
power loss before the broadcast is received, the trust agents are never
resolved for that user.
This change also registers for ACTION_USER_STARTED, so the service
checks for enabled trust agents on every boot. If the trust agents have
been already resolved and initialized for that users, there is already a
Secure Settings key (TRUST_AGENTS_INITIALIZED) that is turned on, so we
wouldn't be doing this more than once per user.
Bug: 150145767
Test: TrustManagerService resolves trust agents only once - either on
USER_ADDED or USER_STARTED.
Change-Id: I83c2dd02d4b476f8b85af1aa4d9d0c77095207ce
1 file changed