From e61f95b3f171c5913290931aab9d4ff165b62765 Mon Sep 17 00:00:00 2001 From: felkachang Date: Fri, 29 Jun 2018 15:34:28 +0800 Subject: fix overlay on status bar because of two clock Although the status bar block user's tap, the user still could drag the status bar to expland the notification panel. The root cause is that neither the clock nor the notification icon inner area doesn't hide when the user drag down the status bar in landscape condition but portrait does. The solution is to trigger mStatusBar.recomputeDisableFlags when the heads up is showing in landscape mode and the expand status is different. CollapsedStatusBarFragment.adjustDisableFlags should disable clock showing when the heads up showing. Change-Id: If7411f5d8eef9cf234b83a463006325ba0156311 Merged-In: If7411f5d8eef9cf234b83a463006325ba0156311 Bug: 110808257 Fix: 111698342 Test: atest SystemUITests (cherry picked from commit ca4eee83d9d7e920cc01e5762f6d9056bbe3f546) --- .../systemui/statusbar/phone/CollapsedStatusBarFragment.java | 8 ++++++++ .../android/systemui/statusbar/phone/NotificationPanelView.java | 3 ++- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java index f7b7eeb2ad88..43c83288dc96 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java @@ -184,6 +184,14 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue state |= DISABLE_SYSTEM_INFO; state |= DISABLE_CLOCK; } + + // In landscape, the heads up show but shouldHideNotificationIcons() return false + // because the visual icon is in notification icon area rather than heads up's space. + // whether the notification icon show or not, clock should hide when heads up show. + if (mStatusBarComponent.isHeadsUpShouldBeVisible()) { + state |= DISABLE_CLOCK; + } + if (mNetworkController != null && EncryptionHelper.IS_DATA_ENCRYPTED) { if (mNetworkController.hasEmergencyCryptKeeperText()) { state |= DISABLE_NOTIFICATION_ICONS; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 5c18782727df..f217a0740ace 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -2532,7 +2532,8 @@ public class NotificationPanelView extends PanelView implements } private void updateStatusBarIcons() { - boolean showIconsWhenExpanded = isFullWidth() && getExpandedHeight() < getOpeningHeight(); + boolean showIconsWhenExpanded = (isPanelVisibleBecauseOfHeadsUp() || isFullWidth()) + && getExpandedHeight() < getOpeningHeight(); if (showIconsWhenExpanded && mNoVisibleNotifications && isOnKeyguard()) { showIconsWhenExpanded = false; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 08ebc268f99d..9f5ebe4d434e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -2156,6 +2156,10 @@ public class StatusBar extends SystemUI implements DemoMode, } } + public boolean isHeadsUpShouldBeVisible() { + return mHeadsUpAppearanceController.shouldBeVisible(); + } + /** * All changes to the status bar and notifications funnel through here and are batched. */ -- cgit v1.2.3-59-g8ed1b