The big keyguard transition refactor (5/n)
Also save surface for the home task, so unlocking to the homescreen is as fast as before. Note that originally it was not possible to save surface for home task because of artifacts when clicking the home button. However, we added logic since then to disallow save surface if it's a different intent, which is the case when pressing the home button. Also consolidate some relayout for less overhead. Bug: 32057734 Change-Id: I53ede527cb1ff438001d4023ee3740283ee302ee
This commit is contained in:
@@ -101,18 +101,23 @@ class KeyguardController {
|
||||
*/
|
||||
void keyguardGoingAway(int flags) {
|
||||
if (mKeyguardShowing) {
|
||||
mKeyguardGoingAway = true;
|
||||
mWindowManager.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY,
|
||||
false /* alwaysKeepCurrent */, convertTransitFlags(flags),
|
||||
false /* forceOverride */);
|
||||
mWindowManager.keyguardGoingAway(flags);
|
||||
mService.updateSleepIfNeededLocked();
|
||||
mWindowManager.deferSurfaceLayout();
|
||||
try {
|
||||
mKeyguardGoingAway = true;
|
||||
mWindowManager.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY,
|
||||
false /* alwaysKeepCurrent */, convertTransitFlags(flags),
|
||||
false /* forceOverride */);
|
||||
mWindowManager.keyguardGoingAway(flags);
|
||||
mService.updateSleepIfNeededLocked();
|
||||
|
||||
// Some stack visibility might change (e.g. docked stack)
|
||||
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
|
||||
mWindowManager.executeAppTransition();
|
||||
mService.applyVrModeIfNeededLocked(mStackSupervisor.getResumedActivityLocked(),
|
||||
true /* enable */);
|
||||
// Some stack visibility might change (e.g. docked stack)
|
||||
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
|
||||
mWindowManager.executeAppTransition();
|
||||
mService.applyVrModeIfNeededLocked(mStackSupervisor.getResumedActivityLocked(),
|
||||
true /* enable */);
|
||||
} finally {
|
||||
mWindowManager.continueSurfaceLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2713,13 +2713,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
return false;
|
||||
}
|
||||
|
||||
Task task = getTask();
|
||||
if (task == null || task.inHomeStack()) {
|
||||
// Don't save surfaces for home stack apps. These usually resume and draw
|
||||
// first frame very fast. Saving surfaces are mostly a waste of memory.
|
||||
return false;
|
||||
}
|
||||
|
||||
final Task task = getTask();
|
||||
final AppWindowToken taskTop = task.getTopVisibleAppToken();
|
||||
if (taskTop != null && taskTop != mAppToken) {
|
||||
// Don't save if the window is not the topmost window.
|
||||
|
||||
Reference in New Issue
Block a user