The reason why HMI level was not restored is because the State Controller was not subscribed on ActivateApp event.
There is noticed the State Controller subscribes in runtime on events CloseApplication and ActivateApp and then never unsubscribes from it. In PR the subscription condition has been changed to prevent situation when we mistakenly did not subscribe on event. And also added unsubscribe for these events.
Fixes #3821
This PR is [ready ] for review.
Risk
This PR makes [no] API changes.
Testing Plan
ATF
Summary
The reason why HMI level was not restored is because the
State Controller
was not subscribed onActivateApp
event. There is noticed theState Controller
subscribes in runtime on eventsCloseApplication
andActivateApp
and then never unsubscribes from it. In PR the subscription condition has been changed to prevent situation when we mistakenly did not subscribe on event. And also added unsubscribe for these events.CLA