Skip to content
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

Implement SDL-0119 - SDL Passenger Mode #1296

Merged

Conversation

SatbirTanda
Copy link
Contributor

@SatbirTanda SatbirTanda commented Jun 5, 2019

Resolves #932

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Add unit test

Summary

Observe OnDriverDistraction notification from LockScreenManager, parse lockScreenDismissalEnabled, and enabled/disabled swipe gesture based on that

CLA

Parse lockScreenDismissalEnabled
Save last notification to instance variable
@SatbirTanda SatbirTanda changed the title Feature/119/passenger mode Implement Passenger Mode Jun 5, 2019
@joeljfischer joeljfischer added enhancement proposal Accepted SDL Evolution Proposal labels Jun 6, 2019
Test getter and setter of lockScreenDismissalEnabled
Update pointer syntax
Add readonly lockScreenDismissableEnabled property in SDLLockScreenManager.h
Refactor SDLLockScreenManager.m
Remove extra notification
Copy link
Contributor

@theresalech theresalech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SatbirTanda I've found a few required changes, per the accepted proposal

  • Actual: No message is displayed that indicates you can dismiss the lock screen. Expected: "Dismissals should include a warning to the user and ensure that they are not the driver."
  • Actual: Currently, the user has to swipe down to dismiss the lock screen. Expected: "the proposed solution is to have a swipe up gesture to dismiss the lock screen"

@joeljfischer joeljfischer self-requested a review June 13, 2019 13:27
@theresalech theresalech added this to In progress in v6.4 via automation Jun 13, 2019
Need translations - will need string to be localized
@SatbirTanda SatbirTanda changed the base branch from master to develop July 2, 2019 22:41
v6.4 automation moved this from In progress to Review in progress Jul 9, 2019
SmartDeviceLink/SDLLockScreenManager.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Show resolved Hide resolved
@joeljfischer
Copy link
Contributor

Also note that I have submitted a PR for revisions to this proposal: smartdevicelink/sdl_evolution#775

@joeljfischer joeljfischer changed the title Implement Passenger Mode Implement SDL-0119 - SDL Passenger Mode Jul 11, 2019
@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

SmartDeviceLink/SDLLockScreenManager.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenViewController.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLOnDriverDistraction.h Outdated Show resolved Hide resolved
@SatbirTanda
Copy link
Contributor Author

@theresalech ready for re-review

Copy link
Contributor

@joeljfischer joeljfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in my slack message, I have come to the realization that the SDLOnLockScreenStatus changes are major changes and will have to be reverted to their original state. SDLOnLockScreenStatus should be deprecated and warnings ignored. I apologize for not realizing the impact of that change earlier.

SmartDeviceLink-iOS.podspec Outdated Show resolved Hide resolved
SmartDeviceLink/SDLProxy.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLOnDriverDistraction.h Show resolved Hide resolved
SmartDeviceLink/SDLOnDriverDistraction.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
@SatbirTanda
Copy link
Contributor Author

@theresalech ready for re-review

Copy link
Contributor

@joeljfischer joeljfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more small issues

SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLLockScreenManager.m Outdated Show resolved Hide resolved
@SatbirTanda
Copy link
Contributor Author

@theresalech ready for review

Copy link
Contributor

@joeljfischer joeljfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did full testing against Core and everything seems to work correctly, however there are just a few minor issues remaining.


- (void)addDismissGestureWithCallback:(SwipeGestureCallbackBlock)swipeGestureCallback {
self.dismissGestureCallback = swipeGestureCallback;
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(sdl_didSwipeToDismiss:)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for this to be called multiple times and multiple dismiss gestures to be added? It seems like it is. This would probably be fixed by holding a reference to the gesture recognizer as a private property, and then checking if it already exists and not re-adding it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, pushed changes

}

- (void)removeDismissGesture {
self.view.gestureRecognizers = [[NSArray alloc] init];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In combination with the above change, this should just call removeGestureRecognizer: with the stored gesture and then the stored gesture cleared.

Set gesture to nil after its removed
v6.4 automation moved this from Review in progress to Reviewer approved Aug 1, 2019
@joeljfischer joeljfischer merged commit 2cfac60 into smartdevicelink:develop Aug 1, 2019
v6.4 automation moved this from Reviewer approved to Done Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Accepted SDL Evolution Proposal
Projects
No open projects
v6.4
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants