From c494e38c07c27896e232db2bf7f63cf1b196cb06 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 31 Jan 2017 16:09:23 -0800 Subject: [PATCH] Fixed that the HUN layout could be visible on Keyguard Test: runtest systemui Change-Id: I9d106b6b021bb15fd709a6281beed8ab084201db Fixes: 34548351 --- .../systemui/statusbar/NotificationContentView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java index e0ddf13d685b0..57d2e1c841156 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java @@ -505,7 +505,8 @@ public class NotificationContentView extends FrameLayout { isTransitioningFromTo(VISIBLE_TYPE_HEADSUP, VISIBLE_TYPE_EXPANDED) || isTransitioningFromTo(VISIBLE_TYPE_EXPANDED, VISIBLE_TYPE_HEADSUP); boolean pinned = !isVisibleOrTransitioning(VISIBLE_TYPE_CONTRACTED) - && (mIsHeadsUp || mHeadsUpAnimatingAway); + && (mIsHeadsUp || mHeadsUpAnimatingAway) + && !mContainingNotification.isOnKeyguard(); if (transitioningBetweenHunAndExpanded || pinned) { return Math.min(mHeadsUpChild.getHeight(), mExpandedChild.getHeight()); } @@ -611,7 +612,7 @@ public class NotificationContentView extends FrameLayout { public int getMaxHeight() { if (mExpandedChild != null) { return mExpandedChild.getHeight(); - } else if (mIsHeadsUp && mHeadsUpChild != null) { + } else if (mIsHeadsUp && mHeadsUpChild != null && !mContainingNotification.isOnKeyguard()) { return mHeadsUpChild.getHeight(); } return mContractedChild.getHeight(); @@ -921,7 +922,8 @@ public class NotificationContentView extends FrameLayout { return VISIBLE_TYPE_SINGLELINE; } - if ((mIsHeadsUp || mHeadsUpAnimatingAway) && mHeadsUpChild != null) { + if ((mIsHeadsUp || mHeadsUpAnimatingAway) && mHeadsUpChild != null + && !mContainingNotification.isOnKeyguard()) { if (viewHeight <= mHeadsUpChild.getHeight() || noExpandedChild) { return VISIBLE_TYPE_HEADSUP; } else { @@ -1174,7 +1176,7 @@ public class NotificationContentView extends FrameLayout { mExpandable = expandable; // if the expanded child has the same height as the collapsed one we hide it. if (mExpandedChild != null && mExpandedChild.getHeight() != 0) { - if ((!mIsHeadsUp || mHeadsUpChild == null)) { + if (!mIsHeadsUp || mHeadsUpChild == null || mContainingNotification.isOnKeyguard()) { if (mExpandedChild.getHeight() == mContractedChild.getHeight()) { expandable = false; }