Make sure we don't accidentally allow the night mode tile

Bug: 28887927
Change-Id: I7cf9ae3f0c853d70172b2af3e75cd8d0106afde1
This commit is contained in:
Jason Monk
2016-06-13 15:39:11 -04:00
parent 6f1ed200b3
commit f31e6d704e

View File

@@ -80,14 +80,16 @@ public class AutoTileManager {
new NightModeController.Listener() {
@Override
public void onNightModeChanged() {
mHost.addTile("night");
Prefs.putBoolean(mContext, Key.QS_NIGHT_ADDED, true);
mHandler.post(new Runnable() {
@Override
public void run() {
mHost.getNightModeController().removeListener(mNightModeListener);
}
});
if (mHost.getNightModeController().isEnabled()) {
mHost.addTile("night");
Prefs.putBoolean(mContext, Key.QS_NIGHT_ADDED, true);
mHandler.post(new Runnable() {
@Override
public void run() {
mHost.getNightModeController().removeListener(mNightModeListener);
}
});
}
}
@Override