Fix heads up views freeing too early.

In the previous CL, heads up views were freed while they were still
animating away.  As a result, there could be a sudden shift in the view
the notification uses (most easily reproducible if you tap on a HUN with
actions as the actions disappear).  This CL introduces an API to set a
a listener for when the content view becomes inactive and remove it then.

Bug: 111809944
Test: runtest systemui, manual (HUN with full screen intent, tap, see
that it goes away without visual jank)

Change-Id: Ib27bcf993f6be41aa4fde50b39817004610f5fd4
9 files changed