getLifecycleStateAndSetListener

Gets the lifecycle state and sets the serviceLifecycleListener.

A previous set serviceLifecycleListener is cleared.