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

Commit b540088d authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Fix the Lifecycle states.

Setting current state to DESTROYED effectively removes listeners. Change
to CREATED, which is equivalent to moving through onPause and onStop,
temporarily interrupting listening.

Fixes: 157437903
Test: manual, toggle ringer while QS is open
Change-Id: I7d5fd575795b51c0990374ab58abe9e6cd13718c
parent 12416fba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1173,7 +1173,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        }
        mUiEventLogger.log(GlobalActionsEvent.GA_POWER_MENU_CLOSE);
        mWindowManagerFuncs.onGlobalActionsHidden();
        mLifecycle.setCurrentState(Lifecycle.State.DESTROYED);
        mLifecycle.setCurrentState(Lifecycle.State.CREATED);
    }

    /**
+1 −3
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.systemui.qs;
import static android.app.StatusBarManager.DISABLE2_QUICK_SETTINGS;

import static com.android.systemui.util.InjectionInflationController.VIEW_CONTEXT;
import static com.android.systemui.util.Utils.useQsMediaPlayer;

import android.annotation.ColorInt;
import android.app.ActivityManager;
@@ -42,7 +41,6 @@ import android.view.ContextThemeWrapper;
import android.view.DisplayCutout;
import android.view.View;
import android.view.WindowInsets;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -477,7 +475,7 @@ public class QuickStatusBarHeader extends RelativeLayout implements
        } else {
            mZenController.removeCallback(this);
            mAlarmController.removeCallback(this);
            mLifecycle.setCurrentState(Lifecycle.State.DESTROYED);
            mLifecycle.setCurrentState(Lifecycle.State.CREATED);
        }
    }