From e697938afcc07b5af494b1c1a7988cf97a01bedf Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 30 May 2018 22:04:06 -0700 Subject: [PATCH] Re-enable the idle timer when streaming has ended --- Limelight/ViewControllers/StreamFrameViewController.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 273b2914..588e9626 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -56,6 +56,7 @@ - (void) returnToMainFrame { [_controllerSupport cleanup]; + [UIApplication sharedApplication].idleTimerDisabled = NO; [self.navigationController popToRootViewControllerAnimated:YES]; } @@ -84,6 +85,9 @@ Log(LOG_I, @"Connection terminated: %ld", errorCode); dispatch_async(dispatch_get_main_queue(), ^{ + // Allow the display to go to sleep now + [UIApplication sharedApplication].idleTimerDisabled = NO; + UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert]; [conTermAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ [self returnToMainFrame]; @@ -112,6 +116,9 @@ Log(LOG_I, @"Stage %s failed: %ld", stageName, errorCode); dispatch_async(dispatch_get_main_queue(), ^{ + // Allow the display to go to sleep now + [UIApplication sharedApplication].idleTimerDisabled = NO; + UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed" message:[NSString stringWithFormat:@"%s failed with error %ld", stageName, errorCode] @@ -132,6 +139,9 @@ Log(LOG_I, @"Launch failed: %@", message); dispatch_async(dispatch_get_main_queue(), ^{ + // Allow the display to go to sleep now + [UIApplication sharedApplication].idleTimerDisabled = NO; + UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed" message:message preferredStyle:UIAlertControllerStyleAlert];