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

Commit 3437745a authored by Galia Peycheva's avatar Galia Peycheva Committed by Android (Google) Code Review
Browse files

Merge "Release doze lock when the dream component changes" into tm-qpr-dev

parents d756cb55 e85f0e12
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -244,8 +244,6 @@ final class DreamController {
                }

                mListener.onDreamStopped(dream.mToken);
            } else if (dream.mCanDoze && !mCurrentDream.mCanDoze) {
                mListener.stopDozing(dream.mToken);
            }

        } finally {
@@ -292,7 +290,6 @@ final class DreamController {
     */
    public interface Listener {
        void onDreamStopped(Binder token);
        void stopDozing(Binder token);
    }

    private final class DreamRecord implements DeathRecipient, ServiceConnection {
+5 −11
Original line number Diff line number Diff line
@@ -499,12 +499,7 @@ public final class DreamManagerService extends SystemService {
        }

        synchronized (mLock) {
            if (mCurrentDream == null) {
                return;
            }

            final boolean sameDream = mCurrentDream.token == token;
            if ((sameDream && mCurrentDream.isDozing) || (!sameDream && !mCurrentDream.isDozing)) {
            if (mCurrentDream != null && mCurrentDream.token == token && mCurrentDream.isDozing) {
                mCurrentDream.isDozing = false;
                mDozeWakeLock.release();
                mPowerManagerInternal.setDozeOverrideFromDreamManager(
@@ -665,6 +660,10 @@ public final class DreamManagerService extends SystemService {

        Slog.i(TAG, "Entering dreamland.");

        if (mCurrentDream != null && mCurrentDream.isDozing) {
            stopDozingInternal(mCurrentDream.token);
        }

        mCurrentDream = new DreamRecord(name, userId, isPreviewMode, canDoze);

        if (!mCurrentDream.name.equals(mAmbientDisplayComponent)) {
@@ -770,11 +769,6 @@ public final class DreamManagerService extends SystemService {
                }
            }
        }

        @Override
        public void stopDozing(Binder token) {
            stopDozingInternal(token);
        }
    };

    private final ContentObserver mDozeEnabledObserver = new ContentObserver(null) {