OSDN Git Service

Take snapshot when screen is turning off
authorJorim Jaggi <jjaggi@google.com>
Wed, 17 May 2017 15:25:32 +0000 (17:25 +0200)
committerJorim Jaggi <jjaggi@google.com>
Thu, 18 May 2017 22:55:31 +0000 (00:55 +0200)
commit51304d7380b6122ac55645fd9085ba071b04afa9
tree930d1e29b3769a055b77848626c091cab2c11ede
parent95cf170ce94f51e9455304207ab20d4bd7109697
Take snapshot when screen is turning off

Since we can't take a snapshot when screen is turned off, we need
to snapshot before we are turning the screen off. For this, we
- Add a callback from DisplayPowerController to give policy a
chance to do something before display will be turned off.
- Implement this callback by taking snapshots of all visible
tasks.

Test: Inspect logs/traces about screen off blocking to make sure
callback is working correctly.
Test: Insert artificial 500ms delay in onScreenTurningOff and make
sure we are unblocking screen off when turning on screen in the
meantime.
Test: Open Maps, go to recents, open maps again, scroll to another
location, toggle power button, make sure the old location isn't
shown during unlock.

Change-Id: I489f31358f838d418f894f996495946084f136a4
Fixes: 37107783
core/java/android/view/WindowManagerPolicy.java
services/core/java/com/android/server/display/DisplayPowerController.java
services/core/java/com/android/server/policy/PhoneWindowManager.java
services/core/java/com/android/server/wm/DisplayContent.java
services/core/java/com/android/server/wm/Task.java
services/core/java/com/android/server/wm/TaskSnapshotController.java
services/core/java/com/android/server/wm/WindowContainer.java
services/core/java/com/android/server/wm/WindowManagerService.java
services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java