New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lock screen dismiss animation not working on certain older systems #1550
Fix lock screen dismiss animation not working on certain older systems #1550
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue.
* Check that the lock screen is presented before attempting the dismissal
* Fix `isPresentedOrPresenting` needs to be called on the main thread
* Change `dispatch_async`s in lock screen classes to run sync * Check whether we actually dismissed a VC to ensure that when we stop the presenter, it doesn't clear the presented window or view controller * When starting the lock manager, check if we're in the background and abort if we are. If we aren't, check if we didn't erase the lock view controller (and by extension, the window), which means that we may still need to dismiss it, then clear the presenter and re-setup
I got a crash when testing LMP with this branch installed to SYNC 3.0:
Expected ResultLock screen dismisses Actual ResultLock screen dismisses and app crashes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment about the library crashing.
* updateLockScreenToShow now has a completion handler to allow the startup to ensure that it's finished dismissing or presenting before re-setting up the lock screen
@NicoleYarroch I believe I have fixed the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lock screen does not show if you follow these steps with iPhone 11 (iOS 13.3.1) and SYNC v3.0:
- Set head unit moving status to "parked".
- Connect device to head unit with a USB cord and launch SDL app by tapping on the SDL app icon on the head unit.
- Open the app on the device.
- Toggle the driver distraction status by setting the moving status to "speed".
- Put app on the device in the background. App should not be killed.
- Disconnect USB cord. App should not be killed.
- Connect USB cord.
- Open the app on the device.
Expected Result
Lock screen should show since the head unit moving status is still set to "speed".
Actual Result
Lock screen is dismissed.
* Fix the lock screen not showing if the app is started, DD is on, the app is put into the background on the phone, then the app is disconnected, reconnected, then put into the foreground on the phone. * Stopping the LSM presenter now takes a completion handler * Starting the LSM now checks the presenter immediately to see if the lock screen should be presented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug 1
The locks screen is still presented when these steps are followed:
- App on device is closed.
- Connect app to TDK that is set to "Parked". Launch SDL app on HMI if necessary.
- Open app on device.
- Toggle the TDK's moving status to "Speed".
- Put app on device in background.
- Pull USB cord.
- Bring app on device back to foreground
Expected Result
Lock screen does not show because the device is not connected to the TDK
Actual Resul
Lock screen dismisses but then shows again.
Bug 2
The lock screen is not presented when these steps are followed:
- Open app on device. Put app on device in background.
- Connect app to TDK that is set to "Speed". Launch SDL app on HMI if necessary.
- Bring app on device to foreground.
Expected Result
Lock screen shows because the TDK moving status is set to "speed"
Actual Resul
Lock screen does not show.
@NicoleYarroch Bug 1 is fixed, Bug 2 I only saw once out of 8 tries and have not been able to replicate it since. |
* Clear the last lock notification to ensure that the lock screen is not presented when not connected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue where the lockscreen never presents.
// Store the expected state of the lockscreen | ||
self.shouldShowLockScreen = show; | ||
|
||
if (show) { | ||
[self sdl_presentWithCompletionHandler:^{ | ||
if (self.shouldShowLockScreen) { return; } | ||
if (self.shouldShowLockScreen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use weakSelf
/strongSelf
in this block
self.lockWindow = nil; | ||
[self sdl_dismissWithCompletionHandler:^(BOOL success) { | ||
if (success) { | ||
self.lockWindow = nil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use weakSelf
* Make sure `stop` completion handler is always called * Use strong / weak in all blocks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke tested with both template app (iOS 13, 12, and 11) and with streaming video/audio app (iOS 13, 12, and 11)
Fixes #1504, #1565
This PR is ready for review.
Risk
This PR makes no API changes.
Testing Plan
Unit Tests
Unit tests currently do not exist for the
SDLLockScreenPresenter
class, so no new unit tests were added in this bugfix PR. They were run and pass.Core Tests
Core version / branch / commit hash / module tested against: Sync Gen 3.0 (19205_DEVTEST), Sync Gen 3.0 (17276_DEVTEST)
HMI name / version / branch / commit hash / module tested against: Same as above
Summary
Changelog
Bug Fixes
CLA