Commit 2041f52b authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

Correctly activate Passcode lock after time-out (close #9252)

parent c43d49fa
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#import "VLCHTTPUploaderController.h" #import "VLCHTTPUploaderController.h"
#import "VLCMenuTableViewController.h" #import "VLCMenuTableViewController.h"
#define PASSCODE_CHECK_INTERVAL 300
@interface VLCAppDelegate () <PAPasscodeViewControllerDelegate, VLCMediaFileDiscovererDelegate> { @interface VLCAppDelegate () <PAPasscodeViewControllerDelegate, VLCMediaFileDiscovererDelegate> {
PAPasscodeViewController *_passcodeLockController; PAPasscodeViewController *_passcodeLockController;
VLCDropboxTableViewController *_dropboxTableViewController; VLCDropboxTableViewController *_dropboxTableViewController;
...@@ -140,10 +142,12 @@ ...@@ -140,10 +142,12 @@
- (void)applicationWillEnterForeground:(UIApplication *)application - (void)applicationWillEnterForeground:(UIApplication *)application
{ {
[[MLMediaLibrary sharedMediaLibrary] applicationWillStart]; [[MLMediaLibrary sharedMediaLibrary] applicationWillStart];
[self validatePasscode];
} }
- (void)applicationWillResignActive:(UIApplication *)application - (void)applicationWillResignActive:(UIApplication *)application
{ {
self.nextPasscodeCheckDate = [NSDate dateWithTimeIntervalSinceNow:PASSCODE_CHECK_INTERVAL];
[[MLMediaLibrary sharedMediaLibrary] applicationWillExit]; [[MLMediaLibrary sharedMediaLibrary] applicationWillExit];
} }
...@@ -153,11 +157,6 @@ ...@@ -153,11 +157,6 @@
[self updateMediaList]; [self updateMediaList];
} }
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self validatePasscode]; // Lock library when going to background
}
- (void)applicationWillTerminate:(UIApplication *)application - (void)applicationWillTerminate:(UIApplication *)application
{ {
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
...@@ -264,7 +263,7 @@ ...@@ -264,7 +263,7 @@
- (void)PAPasscodeViewControllerDidEnterPasscode:(PAPasscodeViewController *)controller - (void)PAPasscodeViewControllerDidEnterPasscode:(PAPasscodeViewController *)controller
{ {
// TODO add transition animation, i.e. fade // TODO add transition animation, i.e. fade
self.nextPasscodeCheckDate = [NSDate dateWithTimeIntervalSinceNow:300]; self.nextPasscodeCheckDate = [NSDate dateWithTimeIntervalSinceNow:PASSCODE_CHECK_INTERVAL];
self.window.rootViewController = self.revealController; self.window.rootViewController = self.revealController;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment