Fixes the invisible unknownApps blocking keyguard transition.

An activity can be added into unknownAppVisibility controller if it
does not declared as noDisplay and it was started before keyguard
unlocked.
If that activity start another activity and finish itself immediately,
the app transition controller will stuck in the status because
unknownApp is not resolved.

And before the keyguard transition been executed, if anything trigger
to prepare new app transition, we will reset the 5 seconds timeout
even if the keyguard transition didn't been overwrite, which extends
original timeout.

To fix this issue, we should remove the activity from unknown apps
once it must become invisible.
Also we don't need to reset app transition timeout if
prepareAppTransition doesn't apply new transition.

Fixes: 161499433
Test: atest AppTransitionTests KeyguardTransitionTests
KeyguardLockedTests UnknownAppVisibilityControllerTest

Change-Id: Ia9aed128fa44f3677e8a420aa9e81aac983bf9a2
3 files changed