DO NOT MERGE Rearrange listener logic so it can be overriden
am: 19f5398e51

Change-Id: I13e9c845e2f9dd70e1e5a2f13efe557609611e3a