Bug 1023329 - [VsD Refresh] Lockscreen Visual Refresh > Color overlay with notifications wrong with wallpapers chosen from gallery and camera

I prefer to not do something with side-effect within a predicting functions. Also I used to make the predictions return value, instead of set property. So you could split the function invocation with two steps:

    this._should... = this._checkGenerateMaskedBackgroundColor();
    if (...) {
        this._generateMaskedBackgroundColor();
    }

It seems more redundant than just one function call, but in semantics level you clear the code mixed with side-effects and pure prediction. Also, in this way we can have no hidden effect in the predicting function.