@@ -1587,10 +1587,6 @@ private WindowManager.LayoutParams getNavigationBarLayoutParams() {
15871587 }
15881588
15891589 private void addHeadsUpView () {
1590- if (mHeadsUpNotificationView != null && mHeadsUpNotificationView .isAttachedToWindow ()) {
1591- return ;
1592- }
1593-
15941590 WindowManager .LayoutParams lp = new WindowManager .LayoutParams (
15951591 LayoutParams .MATCH_PARENT , LayoutParams .WRAP_CONTENT ,
15961592 WindowManager .LayoutParams .TYPE_STATUS_BAR_PANEL , // above the status bar!
@@ -1614,9 +1610,7 @@ private void addHeadsUpView() {
16141610 }
16151611
16161612 private void removeHeadsUpView () {
1617- if (mHeadsUpNotificationView != null && mHeadsUpNotificationView .isAttachedToWindow ()) {
1618- mWindowManager .removeView (mHeadsUpNotificationView );
1619- }
1613+ mWindowManager .removeView (mHeadsUpNotificationView );
16201614 }
16211615
16221616 public void refreshAllStatusBarIcons () {
@@ -3908,12 +3902,10 @@ private void resetUserSetupObserver() {
39083902 private void setHeadsUpVisibility (boolean vis ) {
39093903 if (!ENABLE_HEADS_UP ) return ;
39103904 if (DEBUG ) Log .v (TAG , (vis ? "showing" : "hiding" ) + " heads up window" );
3911- if (mHeadsUpNotificationView != null && mHeadsUpNotificationView .isAttachedToWindow ()) {
3912- mHeadsUpNotificationView .setVisibility (vis ? View .VISIBLE : View .GONE );
3913- if (!vis ) {
3914- if (DEBUG ) Log .d (TAG , "setting heads up entry to null" );
3915- mInterruptingNotificationEntry = null ;
3916- }
3905+ mHeadsUpNotificationView .setVisibility (vis ? View .VISIBLE : View .GONE );
3906+ if (!vis ) {
3907+ if (DEBUG ) Log .d (TAG , "setting heads up entry to null" );
3908+ mInterruptingNotificationEntry = null ;
39173909 }
39183910 }
39193911
@@ -3954,6 +3946,10 @@ private static void copyNotifications(ArrayList<Pair<IBinder, StatusBarNotificat
39543946
39553947 private void recreateStatusBar () {
39563948 mRecreating = true ;
3949+ if (mHeadsUpNotificationView != null ) {
3950+ removeHeadsUpView ();
3951+ mHeadsUpNotificationView = null ;
3952+ }
39573953
39583954 synchronized (mLock ){
39593955 while (mTickerInProgress ){
@@ -3964,7 +3960,6 @@ private void recreateStatusBar() {
39643960 }
39653961 }
39663962 }
3967- removeHeadsUpView ();
39683963 mStatusBarContainer .removeAllViews ();
39693964 mStatusBarContainer .clearDisappearingChildren ();
39703965
0 commit comments