FIx occlusion status mismatch issue when screen turns off and on quickly

When KeyguardController detects occlude status change while the keyguard
is shown, it requests (UN)OCCLUDE app transition and PhoneWindowManager
defers committing the occlude state.

However KeyguardController and PhoneWindowManager use different
predicates to decide if keygaurd is shown or not. In case the predicates
return different value, occlude state in KeyguardController and
PhoneWindowManager remain inconsistent.

Test: manual
  1. set secure lock method (pattern)
  2. launch calculator app
  3. push power button to screen off
  4. just before the screen turns off, push power button to screen on
     again
Bug: 232002936
(cherry picked from commit b71c7b40e7d0ade68e1d1a0ee93c8370edf6e415)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b323776b1b205a4b266e16fbdc4095871cc4d9ec)
Merged-In: I4cd7e62e6800897cce50a5376495c499a0b9ad10
Change-Id: I4cd7e62e6800897cce50a5376495c499a0b9ad10
4 files changed