2/n: AuthSession should manage its own state

1) State calculation, updating, side-effects, outputs are moved
   within AuthSession
2) StatusBarService invocations are all within AuthSession
3) PendingSession and CurrentSession are merged into CurrentSession.
   PendingSession was mostly the same as CurrentSession, with the
   two considerations:
     A) It's only ever valid in STATE_AUTH_CALLED (waiting for sensors
        to become ready)
     B) It's possible for new authentication to be requested while
        CurrentSession is in-progress.

Previously, the PendingSession would request <Biometric>Service(s)
to prepare for auth, which would cancel any existing authentications
and send ERROR_CANCELED to BiometricService, ending the CurrentSession
lifecycle. With this change, if authentication is requested while an
existing AuthSession is in progress, it will immediately send
ERROR_CANCELED to the previous caller and cancel sensors if necessary.
ERROR_CANCELED that are received from the sensors will not affect
the new AuthSession (as expected), since the cookies will no longer
match.

Bug: 149067920

Test: atest com.android.systemui.biometrics
Test: atest com.android.server.biometrics

Change-Id: Ia89920d2225eb9a71f25a5b9fbbd36f92a550127
16 files changed