Create LifecycleEffect to listen for lifecycle

Bug: 236346018
Test: Unit test
Change-Id: I264f7215914d92dc32120254b355ba75be225f42
6 files changed