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

Commit 53b65bdf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent dream service finishSelf before it was attached" into rvc-dev...

Merge "Prevent dream service finishSelf before it was attached" into rvc-dev am: 22404310 am: 47a6d4e2 am: 4fac25fe

Change-Id: I7c229239d8136b1d5101cb325129f9cda2b2915d
parents f700855a 4fac25fe
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -904,15 +904,21 @@ public class DreamService extends Service implements Window.Callback {
            if (!mActivity.isFinishing()) {
                // In case the activity is not finished yet, do it now.
                mActivity.finishAndRemoveTask();
                return;
            }
        } else if (!mWindowless) {
            Slog.w(TAG, "Finish was called before the dream was attached.");
            return;
        }

        if (!mFinished) {
        if (mFinished) {
            return;
        }
        mFinished = true;

        if (mDreamToken == null) {
            Slog.w(TAG, "Finish was called before the dream was attached.");
            stopSelf();
            return;
        }

        try {
            // finishSelf will unbind the dream controller from the dream service. This will
            // trigger DreamService.this.onDestroy and DreamService.this will die.
@@ -921,7 +927,6 @@ public class DreamService extends Service implements Window.Callback {
            // system server died
        }
    }
    }

    /**
     * Wakes the dream up gently.