DndTile: Avoid NPE during boot phase

* Listening handling can only take place once mController
   is properly initialized.

Change-Id: Icbef2d506417f132e1ab47e23d457dacb9c00146
This commit is contained in:
Bruno Martins
2018-02-02 18:29:32 +00:00
parent 73e7a1a739
commit f74ff84734

View File

@@ -235,6 +235,7 @@ public class DndTile extends QSTileImpl<BooleanState> {
public void handleSetListening(boolean listening) {
if (mListening == listening) return;
mListening = listening;
if (mController == null) return;
if (mListening) {
mController.addCallback(mZenCallback);
Prefs.registerListener(mContext, mPrefListener);