idleTimerDisabled is not working; cannot disable screensaver in tvOS 11.2

I'm working on an app that is essentially just a single view application. While it's running I don't want the tvOS screensaver to start or the Apple TV to go to sleep.


Normally, this is accomplished by setting idleTimerDisabled = YES on the UIApplication singleton instance. I did this in my application delegate's application:didFinishLaunchingWithOptions: method. Before I upgraded to tvOS 11.0 or 11.1 (not sure which), this was working fine.


However, after updating, suddenly the screensaver started activating during my app. I've confirmed that idleTimerDisabled is set to true, but it still activates.


The only workaround I've found is to create a timer that runs continously every few seconds, and sets idleTimerDisabled to false and then to true again immediately afterwards, i.e.:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [NSTimer scheduledTimerWithTimeInterval:2.0 repeats:YES block:^(NSTimer *timer) {
        application.idleTimerDisabled = NO;
        application.idleTimerDisabled = YES;
    }];
    return YES;
}


Is this a tvOS 11 bug, or am I doing something wrong? Why does setting idleTimerDisabled to true once when the application launches not disable the screensaver any longer?

Replies

This should work - can you please file a bug at bugreport.apple.com, and let us know the bug number here?

Just created it, bug number 36013286