Fix bug where splitscreen causes unlaunchable camera

This CL changes the way split is dismissed when folding and locking.

Camera launch was broken in two ways:

1) Previously, we checked for occluding apps in onKeyguardStateChanged to determine if we had a SHOW_ABOVE_LOCKED case or not. However, this signal was not exact, and was catching a case where the camera is launched using the power button double-tap feature. Since Camera has the SHOW_ABOVE_LOCKED flag, this was erroneously triggering the "break split" case, breaking split, and preventing the camera from launching (even when Camera had nothing to do with the split pair).

Now, we perform the check instead of StageCoordinator.startAnimation, where we can see more clearly which split apps are being sent TO_BACK or not. If not all the split apps are being sent to back in the same transition, we assume we are in a SHOW_ABOVE_LOCKED case, and break split there.

2) Previously, on device fold, we would check for a wake signal and use it to break split (due to UX-specified behavior that split should break on fold + lock + wake). This was being done in onFinishedWakingUp(), which inadvertently clobbered the Camera launch when the Camera was the wake trigger.

Now we perform the same behavior, but onStartedWakingUp() instead, which happens slightly earlier and does not clobber the Camera.

Fixes: 373477295
Test: Repro steps do not repro anymore
Flag: EXEMPT bugfix
Change-Id: I49b3b104c10cc844caf217e4879eddd3332d1972
5 files changed