Skip updating launcher state if it's already destroyed

- Prior to ag/9526193, there were a mixture of getCreatedActivity() and
  passed in Activity calls. In the cases where we used the passed in
  activity, it would happily make the call even if the activity is already
  destroyed, but since we migrated to using the unified getCreatedActivity()
  call, it results in an NPE. Since it's unnecessary to update the destroyed
  activity, we can simply skip this work.

  Long term, we should consider baking the activity associated with the
  call into the activity interface, and ensure that the interface itself
  is updated whenever the activity is recreated.

Bug: 141886704

Change-Id: I4f043e455d8d0d1c1b86362cc72618018bfbd900
Signed-off-by: Winson Chung <winsonc@google.com>
2 files changed