Use last reported configuration for apps that are going-away

This aligns the same condition as commit e3f5afa and a841c15
in WindowState#reportResized. Otherwise the app may get
inconsistent configuration. For example, switching activities
from one with show-when-locked to another one without the flag
with a secured lock and orientation change. The starting
activity needs to resume and relayout (mClientVisible) once,
but its visible-requested has been updated to false because
lockscreen is still showing. Then the app becomes out of sync
with ActivityRecord#mLastReportedConfiguration.

Bug: 183889107
Test: 1. Enable secured lock.
      2. Launch a landscape show-when-locked activity.
      3. Off/on screen to enter lockscreen.
      4. Press home key and unlock.
      Launcher should not get landscape configuration.
Change-Id: I19af6cf7f9a4a27fbc987d920630e2de95ced602
2 files changed