Merge "Add oldDream to mPreviousDreams always when dreams overlap" into udc-dev am: bcdb5a0319
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21610916 Change-Id: I03a83f25bb4a49cb55ab6b70d80751be4b75236f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -158,15 +158,14 @@ final class DreamController {
|
||||
final DreamRecord oldDream = mCurrentDream;
|
||||
mCurrentDream = new DreamRecord(token, name, isPreviewMode, canDoze, userId, wakeLock);
|
||||
if (oldDream != null) {
|
||||
if (!oldDream.mWakingGently) {
|
||||
// We will stop these previous dreams once the new dream is started.
|
||||
mPreviousDreams.add(oldDream);
|
||||
} else if (Objects.equals(oldDream.mName, mCurrentDream.mName)) {
|
||||
if (Objects.equals(oldDream.mName, mCurrentDream.mName)) {
|
||||
// We are attempting to start a dream that is currently waking up gently.
|
||||
// Let's silently stop the old instance here to clear the dream state.
|
||||
// This should happen after the new mCurrentDream is set to avoid announcing
|
||||
// a "dream stopped" state.
|
||||
stopDreamInstance(/* immediately */ true, "restarting same dream", oldDream);
|
||||
} else {
|
||||
mPreviousDreams.add(oldDream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user