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

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

Merge "Fix DreamService not finishing correctly" into rvc-dev

parents 4456f7d2 95b12348
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -900,10 +900,11 @@ public class DreamService extends Service implements Window.Callback {
    public final void finish() {
        if (mDebug) Slog.v(TAG, "finish(): mFinished=" + mFinished);

        if (mActivity != null) {
            if (!mActivity.isFinishing()) {
        Activity activity = mActivity;
        if (activity != null) {
            if (!activity.isFinishing()) {
                // In case the activity is not finished yet, do it now.
                mActivity.finishAndRemoveTask();
                activity.finishAndRemoveTask();
            }
            return;
        }
@@ -1106,6 +1107,7 @@ public class DreamService extends Service implements Window.Callback {

                    @Override
                    public void onViewDetachedFromWindow(View v) {
                        mActivity = null;
                        finish();
                    }
                });