Fix the icon overlay after density change

After showing the heads up for the fullscreen notification, to
change the density by user will have the status bar icons
not show normally. It will the only one icon overlay on the
clock but actually there are more than one icons. And, it can't
back to normal after expandable notification and collapse the
notification panel.

The root cause is that all of instances of PhoneStatusBarView,
Clock, HeadsUpStatusBarView, and HeadsUpAppearanceController are
recreated by FragmentManager after configuration density and
font changing. The new HeadsUpAppearanceController status is
neither consistent with HeadsUpManager's status nor the state of
the previous instances.

The solution is that to apply the onSaveInstanceState and
onRestoreInstanceState in PhoneStatusBarView, Clock, PanelBar, and
HeadsUpStatusBarView. To make sure that the values of the fields
in the new instance, which are set by other source, have the
consistence with the state of the old instances.

HeadsUpAppearanceController's Constructor.
To hook onLayoutChangedListener to sync the status with
HeadsUpManager's status to HeadsUpStatusBarView if there is a
pinnded heads up notification.

In original, PanelBar.mState is the only one state to save. Instead
of only saving one, to save the view tree state in
CollapsedStatusBarFragment.onSaveInstanceState and restore the view
state in CollapsedStatusBarFragment.onViewCreated.
CollapsedStatusBarFragment.mDisabled1 doesn't need to save and
restore because CommandQueue.recomputeDisableFlags will give it
the correct value.

After density changed, RemoteViews will reinflate the instances of
NotificationHeaderView and the wrapper instances of
NoticationContentView will also recreated in
NotificationContentView.setAmbientChild. The recreated instance
should synchronized with the ExpandableNotificationRow intance.

Bug: 80224819
Fixes: 111996469
Fixes: 117818441
Test: atest SystemUITests
Change-Id: Ia3f8a0f138f403c8e0c74c00d56bd93baf604d3a
Merged-In: Ia3f8a0f138f403c8e0c74c00d56bd93baf604d3a
9 files changed