Merge "Stop animation when screen times out and the user turns on the phone." into sc-dev am: a16f9cc218
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302103 Change-Id: I2d2b108d84c6dd5cafe5fa2eaca8552288ea48c2
This commit is contained in:
@@ -66,6 +66,8 @@ class KeyguardController {
|
|||||||
|
|
||||||
private static final String TAG = TAG_WITH_CLASS_NAME ? "KeyguardController" : TAG_ATM;
|
private static final String TAG = TAG_WITH_CLASS_NAME ? "KeyguardController" : TAG_ATM;
|
||||||
|
|
||||||
|
static final String KEYGUARD_SLEEP_TOKEN_TAG = "keyguard";
|
||||||
|
|
||||||
private final ActivityTaskSupervisor mTaskSupervisor;
|
private final ActivityTaskSupervisor mTaskSupervisor;
|
||||||
private WindowManagerService mWindowManager;
|
private WindowManagerService mWindowManager;
|
||||||
private boolean mKeyguardShowing;
|
private boolean mKeyguardShowing;
|
||||||
@@ -82,7 +84,7 @@ class KeyguardController {
|
|||||||
ActivityTaskSupervisor taskSupervisor) {
|
ActivityTaskSupervisor taskSupervisor) {
|
||||||
mService = service;
|
mService = service;
|
||||||
mTaskSupervisor = taskSupervisor;
|
mTaskSupervisor = taskSupervisor;
|
||||||
mSleepTokenAcquirer = mService.new SleepTokenAcquirerImpl("keyguard");
|
mSleepTokenAcquirer = mService.new SleepTokenAcquirerImpl(KEYGUARD_SLEEP_TOKEN_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWindowManager(WindowManagerService windowManager) {
|
void setWindowManager(WindowManagerService windowManager) {
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ import static com.android.server.wm.ActivityTaskSupervisor.ON_TOP;
|
|||||||
import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS;
|
import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS;
|
||||||
import static com.android.server.wm.ActivityTaskSupervisor.dumpHistoryList;
|
import static com.android.server.wm.ActivityTaskSupervisor.dumpHistoryList;
|
||||||
import static com.android.server.wm.ActivityTaskSupervisor.printThisActivity;
|
import static com.android.server.wm.ActivityTaskSupervisor.printThisActivity;
|
||||||
|
import static com.android.server.wm.KeyguardController.KEYGUARD_SLEEP_TOKEN_TAG;
|
||||||
import static com.android.server.wm.RootWindowContainerProto.IS_HOME_RECENTS_COMPONENT;
|
import static com.android.server.wm.RootWindowContainerProto.IS_HOME_RECENTS_COMPONENT;
|
||||||
import static com.android.server.wm.RootWindowContainerProto.KEYGUARD_CONTROLLER;
|
import static com.android.server.wm.RootWindowContainerProto.KEYGUARD_CONTROLLER;
|
||||||
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
|
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
|
||||||
@@ -2664,16 +2665,31 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
}
|
}
|
||||||
mSleepTokens.remove(token.mHashKey);
|
mSleepTokens.remove(token.mHashKey);
|
||||||
final DisplayContent display = getDisplayContent(token.mDisplayId);
|
final DisplayContent display = getDisplayContent(token.mDisplayId);
|
||||||
if (display != null) {
|
if (display == null) {
|
||||||
|
Slog.d(TAG, "Remove sleep token for non-existing display: " + token + " from "
|
||||||
|
+ Debug.getCallers(6));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
display.mAllSleepTokens.remove(token);
|
display.mAllSleepTokens.remove(token);
|
||||||
if (display.mAllSleepTokens.isEmpty()) {
|
if (display.mAllSleepTokens.isEmpty()) {
|
||||||
mService.updateSleepIfNeededLocked();
|
mService.updateSleepIfNeededLocked();
|
||||||
if (token.mTag.equals(DISPLAY_OFF_SLEEP_TOKEN_TAG)) {
|
// Assuming no lock screen is set and a user launches an activity, turns off the screen
|
||||||
|
// and turn on the screen again, then the launched activity should be displayed on the
|
||||||
|
// screen without app transition animation. When the screen turns on, both keyguard
|
||||||
|
// sleep token and display off sleep token are removed, but the order is
|
||||||
|
// non-deterministic.
|
||||||
|
// Note: Display#mSkipAppTransitionAnimation will be ignored when keyguard related
|
||||||
|
// transition exists, so this affects only when no lock screen is set. Otherwise
|
||||||
|
// keyguard going away animation will be played.
|
||||||
|
// See also AppTransitionController#getTransitCompatType for more details.
|
||||||
|
if ((!mTaskSupervisor.getKeyguardController().isDisplayOccluded(display.mDisplayId)
|
||||||
|
&& token.mTag.equals(KEYGUARD_SLEEP_TOKEN_TAG))
|
||||||
|
|| token.mTag.equals(DISPLAY_OFF_SLEEP_TOKEN_TAG)) {
|
||||||
display.mSkipAppTransitionAnimation = true;
|
display.mSkipAppTransitionAnimation = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void addStartingWindowsForVisibleActivities() {
|
void addStartingWindowsForVisibleActivities() {
|
||||||
final ArrayList<Task> addedTasks = new ArrayList<>();
|
final ArrayList<Task> addedTasks = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user