Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +23 −19 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private OnClickListener mExpandClickListener = new OnClickListener() { @Override public void onClick(View v) { if (!mShowingPublic && (!mIsLowPriority || isExpanded()) if (!shouldShowPublic() && (!mIsLowPriority || isExpanded()) && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) { mGroupExpansionChanging = true; final boolean wasExpanded = mGroupManager.isGroupExpanded(mStatusBarNotification); Loading Loading @@ -790,7 +790,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * {@link #getNotificationHeader()} in case it is a low-priority group. */ public NotificationHeaderView getVisibleNotificationHeader() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getVisibleHeader(); } return getShowingLayout().getVisibleNotificationHeader(); Loading Loading @@ -1512,10 +1512,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } private void updateChildrenVisibility() { mPrivateLayout.setVisibility(!mShowingPublic && !mIsSummaryWithChildren ? VISIBLE mPrivateLayout.setVisibility(!shouldShowPublic() && !mIsSummaryWithChildren ? VISIBLE : INVISIBLE); if (mChildrenContainer != null) { mChildrenContainer.setVisibility(!mShowingPublic && mIsSummaryWithChildren ? VISIBLE mChildrenContainer.setVisibility(!shouldShowPublic() && mIsSummaryWithChildren ? VISIBLE : INVISIBLE); } // The limits might have changed if the view suddenly became a group or vice versa Loading Loading @@ -1566,7 +1566,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public boolean isExpandable() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return !mChildrenExpanded; } return mEnableNonGroupedNotificationExpand && mExpandable; Loading Loading @@ -1611,7 +1611,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView */ public void setUserExpanded(boolean userExpanded, boolean allowChildExpansion) { mFalsingManager.setNotificationExpanded(); if (mIsSummaryWithChildren && !mShowingPublic && allowChildExpansion if (mIsSummaryWithChildren && !shouldShowPublic() && allowChildExpansion && !mChildrenContainer.showingAsLowPriority()) { final boolean wasExpanded = mGroupManager.isGroupExpanded(mStatusBarNotification); mGroupManager.setGroupExpanded(mStatusBarNotification, userExpanded); Loading Loading @@ -1906,7 +1906,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE); updateChildrenVisibility(); } else { animateShowingPublic(delay, duration); animateShowingPublic(delay, duration, mShowingPublic); } NotificationContentView showingLayout = getShowingLayout(); showingLayout.updateBackgroundColor(animated); Loading @@ -1916,13 +1916,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mShowingPublicInitialized = true; } private void animateShowingPublic(long delay, long duration) { private void animateShowingPublic(long delay, long duration, boolean showingPublic) { View[] privateViews = mIsSummaryWithChildren ? new View[] {mChildrenContainer} : new View[] {mPrivateLayout}; View[] publicViews = new View[] {mPublicLayout}; View[] hiddenChildren = mShowingPublic ? privateViews : publicViews; View[] shownChildren = mShowingPublic ? publicViews : privateViews; View[] hiddenChildren = showingPublic ? privateViews : publicViews; View[] shownChildren = showingPublic ? publicViews : privateViews; for (final View hiddenView : hiddenChildren) { hiddenView.setVisibility(View.VISIBLE); hiddenView.animate().cancel(); Loading Loading @@ -1959,7 +1959,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * see {@link #isClearable()}. */ public boolean canViewBeDismissed() { return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral); return isClearable() && (!shouldShowPublic() || !mSensitiveHiddenInGeneral); } private boolean shouldShowPublic() { return mSensitive && mHideSensitiveForIntrinsicHeight; } public void makeActionsVisibile() { Loading Loading @@ -2005,7 +2009,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public boolean isContentExpandable() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return true; } NotificationContentView showingLayout = getShowingLayout(); Loading @@ -2014,7 +2018,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override protected View getContentView() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer; } return getShowingLayout(); Loading Loading @@ -2079,7 +2083,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public int getMaxContentHeight() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getMaxContentHeight(); } NotificationContentView showingLayout = getShowingLayout(); Loading @@ -2093,7 +2097,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } else if (!ignoreTemporaryStates && isHeadsUpAllowed() && mIsHeadsUp && mHeadsUpManager.isTrackingHeadsUp()) { return getPinnedHeadsUpHeight(false /* atLeastMinHeight */); } else if (mIsSummaryWithChildren && !isGroupExpanded() && !mShowingPublic) { } else if (mIsSummaryWithChildren && !isGroupExpanded() && !shouldShowPublic()) { return mChildrenContainer.getMinHeight(); } else if (!ignoreTemporaryStates && isHeadsUpAllowed() && mIsHeadsUp) { return mHeadsUpHeight; Loading @@ -2104,7 +2108,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public int getCollapsedHeight() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getCollapsedHeight(); } return getMinHeight(); Loading Loading @@ -2144,7 +2148,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public NotificationContentView getShowingLayout() { return mShowingPublic ? mPublicLayout : mPrivateLayout; return shouldShowPublic() ? mPublicLayout : mPrivateLayout; } public void setLegacy(boolean legacy) { Loading Loading @@ -2250,7 +2254,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (header != null && header.isInTouchRect(x - getTranslation(), y)) { return true; } if ((!mIsSummaryWithChildren || mShowingPublic) if ((!mIsSummaryWithChildren || shouldShowPublic()) && getShowingLayout().disallowSingleClick(x, y)) { return true; } Loading Loading @@ -2280,7 +2284,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (canViewBeDismissed()) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_DISMISS); } boolean expandable = mShowingPublic; boolean expandable = shouldShowPublic(); boolean isExpanded = false; if (!expandable) { if (mIsSummaryWithChildren) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -3681,6 +3681,7 @@ public class NotificationStackScrollLayout extends ViewGroup mHideSensitiveNeedsAnimation = true; mNeedsAnimation = true; } updateContentHeight(); requestChildrenUpdate(); } } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { @Test public void testGroupSummaryNotShowingIconWhenPublic() { mGroup.setSensitive(true, true); mGroup.setHideSensitive(true, false, 0, 0); mGroup.setHideSensitiveForIntrinsicHeight(true); Assert.assertTrue(mGroup.isSummaryWithChildren()); Assert.assertFalse(mGroup.isShowingIcon()); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +23 −19 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private OnClickListener mExpandClickListener = new OnClickListener() { @Override public void onClick(View v) { if (!mShowingPublic && (!mIsLowPriority || isExpanded()) if (!shouldShowPublic() && (!mIsLowPriority || isExpanded()) && mGroupManager.isSummaryOfGroup(mStatusBarNotification)) { mGroupExpansionChanging = true; final boolean wasExpanded = mGroupManager.isGroupExpanded(mStatusBarNotification); Loading Loading @@ -790,7 +790,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * {@link #getNotificationHeader()} in case it is a low-priority group. */ public NotificationHeaderView getVisibleNotificationHeader() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getVisibleHeader(); } return getShowingLayout().getVisibleNotificationHeader(); Loading Loading @@ -1512,10 +1512,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } private void updateChildrenVisibility() { mPrivateLayout.setVisibility(!mShowingPublic && !mIsSummaryWithChildren ? VISIBLE mPrivateLayout.setVisibility(!shouldShowPublic() && !mIsSummaryWithChildren ? VISIBLE : INVISIBLE); if (mChildrenContainer != null) { mChildrenContainer.setVisibility(!mShowingPublic && mIsSummaryWithChildren ? VISIBLE mChildrenContainer.setVisibility(!shouldShowPublic() && mIsSummaryWithChildren ? VISIBLE : INVISIBLE); } // The limits might have changed if the view suddenly became a group or vice versa Loading Loading @@ -1566,7 +1566,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public boolean isExpandable() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return !mChildrenExpanded; } return mEnableNonGroupedNotificationExpand && mExpandable; Loading Loading @@ -1611,7 +1611,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView */ public void setUserExpanded(boolean userExpanded, boolean allowChildExpansion) { mFalsingManager.setNotificationExpanded(); if (mIsSummaryWithChildren && !mShowingPublic && allowChildExpansion if (mIsSummaryWithChildren && !shouldShowPublic() && allowChildExpansion && !mChildrenContainer.showingAsLowPriority()) { final boolean wasExpanded = mGroupManager.isGroupExpanded(mStatusBarNotification); mGroupManager.setGroupExpanded(mStatusBarNotification, userExpanded); Loading Loading @@ -1906,7 +1906,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mPublicLayout.setVisibility(mShowingPublic ? View.VISIBLE : View.INVISIBLE); updateChildrenVisibility(); } else { animateShowingPublic(delay, duration); animateShowingPublic(delay, duration, mShowingPublic); } NotificationContentView showingLayout = getShowingLayout(); showingLayout.updateBackgroundColor(animated); Loading @@ -1916,13 +1916,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mShowingPublicInitialized = true; } private void animateShowingPublic(long delay, long duration) { private void animateShowingPublic(long delay, long duration, boolean showingPublic) { View[] privateViews = mIsSummaryWithChildren ? new View[] {mChildrenContainer} : new View[] {mPrivateLayout}; View[] publicViews = new View[] {mPublicLayout}; View[] hiddenChildren = mShowingPublic ? privateViews : publicViews; View[] shownChildren = mShowingPublic ? publicViews : privateViews; View[] hiddenChildren = showingPublic ? privateViews : publicViews; View[] shownChildren = showingPublic ? publicViews : privateViews; for (final View hiddenView : hiddenChildren) { hiddenView.setVisibility(View.VISIBLE); hiddenView.animate().cancel(); Loading Loading @@ -1959,7 +1959,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * see {@link #isClearable()}. */ public boolean canViewBeDismissed() { return isClearable() && (!mShowingPublic || !mSensitiveHiddenInGeneral); return isClearable() && (!shouldShowPublic() || !mSensitiveHiddenInGeneral); } private boolean shouldShowPublic() { return mSensitive && mHideSensitiveForIntrinsicHeight; } public void makeActionsVisibile() { Loading Loading @@ -2005,7 +2009,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public boolean isContentExpandable() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return true; } NotificationContentView showingLayout = getShowingLayout(); Loading @@ -2014,7 +2018,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override protected View getContentView() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer; } return getShowingLayout(); Loading Loading @@ -2079,7 +2083,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public int getMaxContentHeight() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getMaxContentHeight(); } NotificationContentView showingLayout = getShowingLayout(); Loading @@ -2093,7 +2097,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } else if (!ignoreTemporaryStates && isHeadsUpAllowed() && mIsHeadsUp && mHeadsUpManager.isTrackingHeadsUp()) { return getPinnedHeadsUpHeight(false /* atLeastMinHeight */); } else if (mIsSummaryWithChildren && !isGroupExpanded() && !mShowingPublic) { } else if (mIsSummaryWithChildren && !isGroupExpanded() && !shouldShowPublic()) { return mChildrenContainer.getMinHeight(); } else if (!ignoreTemporaryStates && isHeadsUpAllowed() && mIsHeadsUp) { return mHeadsUpHeight; Loading @@ -2104,7 +2108,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView @Override public int getCollapsedHeight() { if (mIsSummaryWithChildren && !mShowingPublic) { if (mIsSummaryWithChildren && !shouldShowPublic()) { return mChildrenContainer.getCollapsedHeight(); } return getMinHeight(); Loading Loading @@ -2144,7 +2148,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } public NotificationContentView getShowingLayout() { return mShowingPublic ? mPublicLayout : mPrivateLayout; return shouldShowPublic() ? mPublicLayout : mPrivateLayout; } public void setLegacy(boolean legacy) { Loading Loading @@ -2250,7 +2254,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (header != null && header.isInTouchRect(x - getTranslation(), y)) { return true; } if ((!mIsSummaryWithChildren || mShowingPublic) if ((!mIsSummaryWithChildren || shouldShowPublic()) && getShowingLayout().disallowSingleClick(x, y)) { return true; } Loading Loading @@ -2280,7 +2284,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (canViewBeDismissed()) { info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_DISMISS); } boolean expandable = mShowingPublic; boolean expandable = shouldShowPublic(); boolean isExpanded = false; if (!expandable) { if (mIsSummaryWithChildren) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -3681,6 +3681,7 @@ public class NotificationStackScrollLayout extends ViewGroup mHideSensitiveNeedsAnimation = true; mNeedsAnimation = true; } updateContentHeight(); requestChildrenUpdate(); } } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { @Test public void testGroupSummaryNotShowingIconWhenPublic() { mGroup.setSensitive(true, true); mGroup.setHideSensitive(true, false, 0, 0); mGroup.setHideSensitiveForIntrinsicHeight(true); Assert.assertTrue(mGroup.isSummaryWithChildren()); Assert.assertFalse(mGroup.isShowingIcon()); } Loading