Commit 23dba31c authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

forward-port state restoration fixes from the 2.6 branch

parent f641f130
......@@ -382,6 +382,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
{
_passcodeValidated = YES;
[self.playlistViewController updateViewContents];
if ([VLCPlaybackController sharedInstance].isPlaying)
[_playerDisplayController pushPlaybackView];
}
- (BOOL)passcodeValidated
......@@ -394,6 +396,8 @@ didFailToContinueUserActivityWithType:(NSString *)userActivityType
VLCKeychainCoordinator *keychainCoordinator = [VLCKeychainCoordinator defaultCoordinator];
if (!_passcodeValidated && [keychainCoordinator passcodeLockEnabled]) {
[_playerDisplayController dismissPlaybackView];
[keychainCoordinator validatePasscode];
} else
_passcodeValidated = YES;
......
......@@ -111,10 +111,15 @@
[_artworkView addGestureRecognizer:_artworkTapRecognizer];
_artworkView.userInteractionEnabled = YES;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(appBecameActive:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self
selector:@selector(appBecameActive:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[center addObserver:self
selector:@selector(appBecameActive:)
name:VLCPasscodeValidated
object:nil];
return self;
}
......
......@@ -26,4 +26,7 @@ typedef NS_ENUM(NSUInteger, VLCPlayerDisplayControllerDisplayMode) {
- (void)showFullscreenPlayback;
- (void)closeFullscreenPlayback;
- (void)pushPlaybackView;
- (void)dismissPlaybackView;
@end
......@@ -162,6 +162,19 @@ static inline void commonSetup(VLCPlayerDisplayController *self)
return [[UIApplication sharedApplication] applicationState] != UIApplicationStateBackground;
}
- (void)pushPlaybackView
{
switch (self.displayMode) {
case VLCPlayerDisplayControllerDisplayModeFullscreen:
[self _presentFullscreenPlaybackViewIfNeeded];
break;
case VLCPlayerDisplayControllerDisplayModeMiniplayer:
[self _showHideMiniPlaybackView];
default:
break;
}
}
- (void)dismissPlaybackView
{
switch (self.displayMode) {
......
Supports Markdown
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