Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 601f091a authored by Darrell Shi's avatar Darrell Shi Committed by Automerger Merge Worker
Browse files

Merge changes from topic "dream-restart-reland" into tm-qpr-dev am: ef7f9416

parents 7b38f5ef ef7f9416
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -123,15 +123,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);
                }
            }