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

Commit 6feb3a1c authored by Gabriele M's avatar Gabriele M
Browse files

QS: Remove listeners only if added

handleDestroy() calls setListening(false) unconditionally. This
causes an error if no listener was never added. Check if we added
a listener and then try to remove it.

Change-Id: Iefe8aacbe87ba1c2c19c9e77cf132fc7c84798f9
parent 46f8d427
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -312,7 +312,9 @@ public abstract class QSTile<TState extends State> {
    protected abstract void setListening(boolean listening);

    protected void handleDestroy() {
        if (mListeners.size() != 0) {
            setListening(false);
        }
        mCallbacks.clear();
    }