Merge "Improve pref behavior across lifecycle events"