Fixed a bug that could lead to an empty notification

With sensitive notifications, notification groups could
become empty.

Change-Id: Ibea016c64287d1952db136e038372b778d8febc2
Fixes: 30641080
This commit is contained in:
Selim Cinek
2016-08-05 11:04:37 -07:00
parent d871f95f49
commit aa3901a5ee
2 changed files with 23 additions and 2 deletions

View File

@@ -744,6 +744,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
}
if (!mWasCancelled) {
enableAppearDrawing(false);
onAppearAnimationFinished(isAppearing);
}
}
@@ -760,6 +761,9 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
mAppearAnimator.start();
}
protected void onAppearAnimationFinished(boolean wasAppearing) {
}
private void cancelAppearAnimation() {
if (mAppearAnimator != null) {
mAppearAnimator.cancel();

View File

@@ -598,7 +598,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
}
private NotificationHeaderView getVisibleNotificationHeader() {
if (mIsSummaryWithChildren) {
if (mIsSummaryWithChildren && !mShowingPublic) {
return mChildrenContainer.getHeaderView();
}
return getShowingLayout().getVisibleNotificationHeader();
@@ -1442,12 +1442,29 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
@Override
protected View getContentView() {
if (mIsSummaryWithChildren) {
if (mIsSummaryWithChildren && !mShowingPublic) {
return mChildrenContainer;
}
return getShowingLayout();
}
@Override
protected void onAppearAnimationFinished(boolean wasAppearing) {
super.onAppearAnimationFinished(wasAppearing);
if (wasAppearing) {
// During the animation the visible view might have changed, so let's make sure all
// alphas are reset
if (mChildrenContainer != null) {
mChildrenContainer.setAlpha(1.0f);
mChildrenContainer.setLayerType(LAYER_TYPE_NONE, null);
}
mPrivateLayout.setAlpha(1.0f);
mPrivateLayout.setLayerType(LAYER_TYPE_NONE, null);
mPublicLayout.setAlpha(1.0f);
mPublicLayout.setLayerType(LAYER_TYPE_NONE, null);
}
}
@Override
public int getExtraBottomPadding() {
if (mIsSummaryWithChildren && isGroupExpanded()) {