setKeepScreenOn(true) doesn't seem to work?

I’m calling this function in my game:
cocos2d::Device::setKeepScreenOn(true);
But it doesn’t seem to have any effect, at least not in Android. Using cocos2d-x v3.15.1

Edit: there is a workaround:


But this affects the whole application, I’d prefer if it just worked in the in-game Scene