onTrustChanged callback triggered before onTrustGrantedForCurrentUser

KeyguardStateControllerImpl updates its internal state onTrustChanged,
which is then used onTrustGrantedForUser when the keyguard may be
dismissed, so the #onTrustChanged callback needs to be called
first, or else we may mistakenly end up preventing a keyguard
dismissal: "KeyguardSecurityView: Tried to dismiss keyguard when lockscreen is not dismissible and user was not authenticated with a primary security method (pin/password/pattern)."

Test: atest KeyguardUpdateMonitorTest
Fixes: 279547063
Change-Id: I239ffa1cfc1a252aaa7ea89f259f1f9bf97f2da3
2 files changed