diff options
| author | 2024-03-18 23:13:59 +0000 | |
|---|---|---|
| committer | 2024-03-19 18:22:53 +0000 | |
| commit | 88c8663679df27e4c0d01fed615dec50322e3a0f (patch) | |
| tree | fa29153ec4b8817df90e06e9b3d448b23bdcd8f2 | |
| parent | a0d8e5fb48383cefd514acad6249514f70aff489 (diff) | |
Add minimized status setting for async group header and rename parameters
Add minimized status setting for async group header, this fixes the test failures that is related with setting Sensitive status of Notification rows.
Previously, we use the term: low priority to refer to the minimized notifications because of history reason. Now the definitions of low priority notifications and minimized notifications are different, so we rename the parameter names that have lowPriority with minimized to reduce the confusion and improve code quality.
Bug: 217799515
Test: atest
PlatformScenarioTests:MinPriorityGroupNotificationRowInflation
atest
PlatformScenarioTests:AutoGroupingNotificationInflation
atest
PlatformScenarioTests:ConversationGroupNotification
Flag: ACONFIG notification_async_group_header_inflation DEVELOPMENT
Change-Id: I30b36920df21f834028bb45a9742d0b4ccd65b42
12 files changed, 174 insertions, 149 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 615534809c97..c6083e47e6a8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -884,7 +884,7 @@ public class NotificationShelf extends ActivatableNotificationView { boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf(); iconState.hidden = isAppearing || (view instanceof ExpandableNotificationRow - && ((ExpandableNotificationRow) view).isLowPriority() + && ((ExpandableNotificationRow) view).isMinimized() && mShelfIcons.areIconsOverflowing()) || (transitionAmount == 0.0f && !iconState.isAnimating(icon)) || row.isAboveShelf() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java index c5b55c7b1d9b..842011b52afb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java @@ -290,7 +290,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { mRowContentBindStage.requestRebind(entry, en -> { mLogger.logRebindComplete(entry); row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight); - row.setIsLowPriority(isLowPriority); + row.setIsMinimized(isLowPriority); if (inflationCallback != null) { inflationCallback.onAsyncInflationFinished(en); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 5f3a83aa35e0..cbdb77a7c885 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -329,7 +329,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private OnClickListener mExpandClickListener = new OnClickListener() { @Override public void onClick(View v) { - if (!shouldShowPublic() && (!mIsLowPriority || isExpanded()) + if (!shouldShowPublic() && (!mIsMinimized || isExpanded()) && mGroupMembershipManager.isGroupSummary(mEntry)) { mGroupExpansionChanging = true; final boolean wasExpanded = mGroupExpansionManager.isGroupExpanded(mEntry); @@ -384,7 +384,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private boolean mAboveShelf; private OnUserInteractionCallback mOnUserInteractionCallback; private NotificationGutsManager mNotificationGutsManager; - private boolean mIsLowPriority; + private boolean mIsMinimized; private boolean mUseIncreasedCollapsedHeight; private boolean mUseIncreasedHeadsUpHeight; private float mTranslationWhenRemoved; @@ -469,7 +469,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (viewWrapper != null) { setIconAnimationRunningForChild(running, viewWrapper.getIcon()); } - NotificationViewWrapper lowPriWrapper = mChildrenContainer.getLowPriorityViewWrapper(); + NotificationViewWrapper lowPriWrapper = mChildrenContainer + .getMinimizedGroupHeaderWrapper(); if (lowPriWrapper != null) { setIconAnimationRunningForChild(running, lowPriWrapper.getIcon()); } @@ -682,7 +683,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (color != Notification.COLOR_INVALID) { return color; } else { - return mEntry.getContrastedColor(mContext, mIsLowPriority && !isExpanded(), + return mEntry.getContrastedColor(mContext, mIsMinimized && !isExpanded(), getBackgroundColorWithoutTint()); } } @@ -1547,7 +1548,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView * Set the low-priority group notification header view * @param headerView header view to set */ - public void setLowPriorityGroupHeader(NotificationHeaderView headerView) { + public void setMinimizedGroupHeader(NotificationHeaderView headerView) { NotificationChildrenContainer childrenContainer = getChildrenContainerNonNull(); childrenContainer.setLowPriorityGroupHeader( /* headerViewLowPriority= */ headerView, @@ -1666,16 +1667,19 @@ public class ExpandableNotificationRow extends ActivatableNotificationView } } - public void setIsLowPriority(boolean isLowPriority) { - mIsLowPriority = isLowPriority; - mPrivateLayout.setIsLowPriority(isLowPriority); + /** + * Set if the row is minimized. + */ + public void setIsMinimized(boolean isMinimized) { + mIsMinimized = isMinimized; + mPrivateLayout.setIsLowPriority(isMinimized); if (mChildrenContainer != null) { - mChildrenContainer.setIsLowPriority(isLowPriority); + mChildrenContainer.setIsMinimized(isMinimized); } } - public boolean isLowPriority() { - return mIsLowPriority; + public boolean isMinimized() { + return mIsMinimized; } public void setUsesIncreasedCollapsedHeight(boolean use) { @@ -2052,7 +2056,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mChildrenContainerStub = findViewById(R.id.child_container_stub); mChildrenContainerStub.setOnInflateListener((stub, inflated) -> { mChildrenContainer = (NotificationChildrenContainer) inflated; - mChildrenContainer.setIsLowPriority(mIsLowPriority); + mChildrenContainer.setIsMinimized(mIsMinimized); mChildrenContainer.setContainingNotification(ExpandableNotificationRow.this); mChildrenContainer.onNotificationUpdated(); mChildrenContainer.setLogger(mChildrenContainerLogger); @@ -3443,7 +3447,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView private void onExpansionChanged(boolean userAction, boolean wasExpanded) { boolean nowExpanded = isExpanded(); - if (mIsSummaryWithChildren && (!mIsLowPriority || wasExpanded)) { + if (mIsSummaryWithChildren && (!mIsMinimized || wasExpanded)) { nowExpanded = mGroupExpansionManager.isGroupExpanded(mEntry); } if (nowExpanded != wasExpanded) { @@ -3500,7 +3504,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (!expandable) { if (mIsSummaryWithChildren) { expandable = true; - if (!mIsLowPriority || isExpanded()) { + if (!mIsMinimized || isExpanded()) { isExpanded = isGroupExpanded(); } } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java index f835cca1a60c..95c88053ff5e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java @@ -150,7 +150,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder entry, mConversationProcessor, row, - bindParams.isLowPriority, + bindParams.isMinimized, bindParams.usesIncreasedHeight, bindParams.usesIncreasedHeadsUpHeight, callback, @@ -178,7 +178,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder SmartReplyStateInflater smartRepliesInflater) { InflationProgress result = createRemoteViews(reInflateFlags, builder, - bindParams.isLowPriority, + bindParams.isMinimized, bindParams.usesIncreasedHeight, bindParams.usesIncreasedHeadsUpHeight, packageContext, @@ -215,6 +215,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder apply( mInflationExecutor, inflateSynchronously, + bindParams.isMinimized, result, reInflateFlags, mRemoteViewCache, @@ -365,7 +366,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder } private static InflationProgress createRemoteViews(@InflationFlag int reInflateFlags, - Notification.Builder builder, boolean isLowPriority, boolean usesIncreasedHeight, + Notification.Builder builder, boolean isMinimized, boolean usesIncreasedHeight, boolean usesIncreasedHeadsUpHeight, Context packageContext, ExpandableNotificationRow row, NotifLayoutInflaterFactory.Provider notifLayoutInflaterFactoryProvider, @@ -376,13 +377,13 @@ public class NotificationContentInflater implements NotificationRowContentBinder if ((reInflateFlags & FLAG_CONTENT_VIEW_CONTRACTED) != 0) { logger.logAsyncTaskProgress(entryForLogging, "creating contracted remote view"); - result.newContentView = createContentView(builder, isLowPriority, + result.newContentView = createContentView(builder, isMinimized, usesIncreasedHeight); } if ((reInflateFlags & FLAG_CONTENT_VIEW_EXPANDED) != 0) { logger.logAsyncTaskProgress(entryForLogging, "creating expanded remote view"); - result.newExpandedView = createExpandedView(builder, isLowPriority); + result.newExpandedView = createExpandedView(builder, isMinimized); } if ((reInflateFlags & FLAG_CONTENT_VIEW_HEADS_UP) != 0) { @@ -393,7 +394,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder if ((reInflateFlags & FLAG_CONTENT_VIEW_PUBLIC) != 0) { logger.logAsyncTaskProgress(entryForLogging, "creating public remote view"); - result.newPublicView = builder.makePublicContentView(isLowPriority); + result.newPublicView = builder.makePublicContentView(isMinimized); } if (AsyncGroupHeaderViewInflation.isEnabled()) { @@ -406,7 +407,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder if ((reInflateFlags & FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER) != 0) { logger.logAsyncTaskProgress(entryForLogging, "creating low-priority group summary remote view"); - result.mNewLowPriorityGroupHeaderView = + result.mNewMinimizedGroupHeaderView = builder.makeLowPriorityContentView(true /* useRegularSubtext */); } } @@ -444,6 +445,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder private static CancellationSignal apply( Executor inflationExecutor, boolean inflateSynchronously, + boolean isMinimized, InflationProgress result, @InflationFlag int reInflateFlags, NotifRemoteViewCache remoteViewCache, @@ -475,7 +477,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } }; logger.logAsyncTaskProgress(entry, "applying contracted view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, flag, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, result, + reInflateFlags, flag, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, privateLayout, privateLayout.getContractedChild(), privateLayout.getVisibleWrapper( @@ -502,7 +505,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } }; logger.logAsyncTaskProgress(entry, "applying expanded view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, result, + reInflateFlags, flag, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, privateLayout, privateLayout.getExpandedChild(), privateLayout.getVisibleWrapper(VISIBLE_TYPE_EXPANDED), runningInflations, @@ -529,7 +533,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } }; logger.logAsyncTaskProgress(entry, "applying heads up view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, + result, reInflateFlags, flag, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, privateLayout, privateLayout.getHeadsUpChild(), privateLayout.getVisibleWrapper(VISIBLE_TYPE_HEADSUP), runningInflations, @@ -555,7 +560,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } }; logger.logAsyncTaskProgress(entry, "applying public view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, flag, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, + result, reInflateFlags, flag, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, publicLayout, publicLayout.getContractedChild(), publicLayout.getVisibleWrapper(NotificationContentView.VISIBLE_TYPE_CONTRACTED), @@ -583,7 +589,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } }; logger.logAsyncTaskProgress(entry, "applying group header view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, + result, reInflateFlags, /* inflationId = */ FLAG_GROUP_SUMMARY_HEADER, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, /* parentLayout = */ childrenContainer, @@ -595,7 +602,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder if ((reInflateFlags & FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER) != 0) { boolean isNewView = !canReapplyRemoteView( - /* newView = */ result.mNewLowPriorityGroupHeaderView, + /* newView = */ result.mNewMinimizedGroupHeaderView, /* oldView = */ remoteViewCache.getCachedView( entry, FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER)); ApplyCallback applyCallback = new ApplyCallback() { @@ -603,29 +610,30 @@ public class NotificationContentInflater implements NotificationRowContentBinder public void setResultView(View v) { logger.logAsyncTaskProgress(entry, "low-priority group header view applied"); - result.mInflatedLowPriorityGroupHeaderView = (NotificationHeaderView) v; + result.mInflatedMinimizedGroupHeaderView = (NotificationHeaderView) v; } @Override public RemoteViews getRemoteView() { - return result.mNewLowPriorityGroupHeaderView; + return result.mNewMinimizedGroupHeaderView; } }; logger.logAsyncTaskProgress(entry, "applying low priority group header view"); - applyRemoteView(inflationExecutor, inflateSynchronously, result, reInflateFlags, + applyRemoteView(inflationExecutor, inflateSynchronously, isMinimized, + result, reInflateFlags, /* inflationId = */ FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER, remoteViewCache, entry, row, isNewView, remoteViewClickHandler, callback, /* parentLayout = */ childrenContainer, - /* existingView = */ childrenContainer.getNotificationHeaderLowPriority(), + /* existingView = */ childrenContainer.getMinimizedNotificationHeader(), /* existingWrapper = */ childrenContainer - .getLowPriorityViewWrapper(), + .getMinimizedGroupHeaderWrapper(), runningInflations, applyCallback, logger); } } // Let's try to finish, maybe nobody is even inflating anything - finishIfDone(result, reInflateFlags, remoteViewCache, runningInflations, callback, entry, - row, logger); + finishIfDone(result, isMinimized, reInflateFlags, remoteViewCache, runningInflations, + callback, entry, row, logger); CancellationSignal cancellationSignal = new CancellationSignal(); cancellationSignal.setOnCancelListener( () -> { @@ -641,6 +649,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder static void applyRemoteView( Executor inflationExecutor, boolean inflateSynchronously, + boolean isMinimized, final InflationProgress result, final @InflationFlag int reInflateFlags, @InflationFlag int inflationId, @@ -707,7 +716,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder existingWrapper.onReinflated(); } runningInflations.remove(inflationId); - finishIfDone(result, reInflateFlags, remoteViewCache, runningInflations, + finishIfDone(result, isMinimized, + reInflateFlags, remoteViewCache, runningInflations, callback, entry, row, logger); } @@ -838,6 +848,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder * @return true if the inflation was finished */ private static boolean finishIfDone(InflationProgress result, + boolean isMinimized, @InflationFlag int reInflateFlags, NotifRemoteViewCache remoteViewCache, HashMap<Integer, CancellationSignal> runningInflations, @Nullable InflationCallback endListener, NotificationEntry entry, @@ -944,7 +955,9 @@ public class NotificationContentInflater implements NotificationRowContentBinder if (AsyncGroupHeaderViewInflation.isEnabled()) { if ((reInflateFlags & FLAG_GROUP_SUMMARY_HEADER) != 0) { if (result.mInflatedGroupHeaderView != null) { - row.setIsLowPriority(false); + // We need to set if the row is minimized before setting the group header to + // make sure the setting of header view works correctly + row.setIsMinimized(isMinimized); row.setGroupHeader(/* headerView= */ result.mInflatedGroupHeaderView); remoteViewCache.putCachedView(entry, FLAG_GROUP_SUMMARY_HEADER, result.mNewGroupHeaderView); @@ -957,13 +970,14 @@ public class NotificationContentInflater implements NotificationRowContentBinder } if ((reInflateFlags & FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER) != 0) { - if (result.mInflatedLowPriorityGroupHeaderView != null) { - // New view case, set row to low priority - row.setIsLowPriority(true); - row.setLowPriorityGroupHeader( - /* headerView= */ result.mInflatedLowPriorityGroupHeaderView); + if (result.mInflatedMinimizedGroupHeaderView != null) { + // We need to set if the row is minimized before setting the group header to + // make sure the setting of header view works correctly + row.setIsMinimized(isMinimized); + row.setMinimizedGroupHeader( + /* headerView= */ result.mInflatedMinimizedGroupHeaderView); remoteViewCache.putCachedView(entry, FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER, - result.mNewLowPriorityGroupHeaderView); + result.mNewMinimizedGroupHeaderView); } else if (remoteViewCache.hasCachedView(entry, FLAG_LOW_PRIORITY_GROUP_SUMMARY_HEADER)) { // Re-inflation case. Only update if it's still cached (i.e. view has not @@ -984,12 +998,12 @@ public class NotificationContentInflater implements NotificationRowContentBinder } private static RemoteViews createExpandedView(Notification.Builder builder, - boolean isLowPriority) { + boolean isMinimized) { RemoteViews bigContentView = builder.createBigContentView(); if (bigContentView != null) { return bigContentView; } - if (isLowPriority) { + if (isMinimized) { RemoteViews contentView = builder.createContentView(); Notification.Builder.makeHeaderExpanded(contentView); return contentView; @@ -998,8 +1012,8 @@ public class NotificationContentInflater implements NotificationRowContentBinder } private static RemoteViews createContentView(Notification.Builder builder, - boolean isLowPriority, boolean useLarge) { - if (isLowPriority) { + boolean isMinimized, boolean useLarge) { + if (isMinimized) { return builder.makeLowPriorityContentView(false /* useRegularSubtext */); } return builder.createContentView(useLarge); @@ -1038,7 +1052,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder private final NotificationEntry mEntry; private final Context mContext; private final boolean mInflateSynchronously; - private final boolean mIsLowPriority; + private final boolean mIsMinimized; private final boolean mUsesIncreasedHeight; private final InflationCallback mCallback; private final boolean mUsesIncreasedHeadsUpHeight; @@ -1063,7 +1077,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder NotificationEntry entry, ConversationNotificationProcessor conversationProcessor, ExpandableNotificationRow row, - boolean isLowPriority, + boolean isMinimized, boolean usesIncreasedHeight, boolean usesIncreasedHeadsUpHeight, InflationCallback callback, @@ -1080,7 +1094,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder mRemoteViewCache = cache; mSmartRepliesInflater = smartRepliesInflater; mContext = mRow.getContext(); - mIsLowPriority = isLowPriority; + mIsMinimized = isMinimized; mUsesIncreasedHeight = usesIncreasedHeight; mUsesIncreasedHeadsUpHeight = usesIncreasedHeadsUpHeight; mRemoteViewClickHandler = remoteViewClickHandler; @@ -1150,7 +1164,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder mEntry, recoveredBuilder, mLogger); } InflationProgress inflationProgress = createRemoteViews(mReInflateFlags, - recoveredBuilder, mIsLowPriority, mUsesIncreasedHeight, + recoveredBuilder, mIsMinimized, mUsesIncreasedHeight, mUsesIncreasedHeadsUpHeight, packageContext, mRow, mNotifLayoutInflaterFactoryProvider, mLogger); @@ -1209,6 +1223,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder mCancellationSignal = apply( mInflationExecutor, mInflateSynchronously, + mIsMinimized, result, mReInflateFlags, mRemoteViewCache, @@ -1295,7 +1310,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder private RemoteViews newExpandedView; private RemoteViews newPublicView; private RemoteViews mNewGroupHeaderView; - private RemoteViews mNewLowPriorityGroupHeaderView; + private RemoteViews mNewMinimizedGroupHeaderView; @VisibleForTesting Context packageContext; @@ -1305,7 +1320,7 @@ public class NotificationContentInflater implements NotificationRowContentBinder private View inflatedExpandedView; private View inflatedPublicView; private NotificationHeaderView mInflatedGroupHeaderView; - private NotificationHeaderView mInflatedLowPriorityGroupHeaderView; + private NotificationHeaderView mInflatedMinimizedGroupHeaderView; private CharSequence headsUpStatusBarText; private CharSequence headsUpStatusBarTextPublic; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinder.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinder.java index b0fd47587782..33339a7fe025 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinder.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationRowContentBinder.java @@ -128,9 +128,9 @@ public interface NotificationRowContentBinder { class BindParams { /** - * Bind a low priority version of the content views. + * Bind a minimized version of the content views. */ - public boolean isLowPriority; + public boolean isMinimized; /** * Use increased height when binding contracted view. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java index 1494c275d061..2b62dc597161 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java @@ -42,6 +42,8 @@ public final class RowContentBindParams { /** * Set whether content should use a low priority version of its content views. + * The low priority here does not equal to the NotificationManager.IMPORTANCE_LOW, but + * represents that the notification is minimized (with the priority: IMPORTANCE_MIN). */ public void setUseLowPriority(boolean useLowPriority) { if (mUseLowPriority != useLowPriority) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindStage.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindStage.java index f4f8374d0a9f..cdeb9c6fa618 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindStage.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindStage.java @@ -73,7 +73,7 @@ public class RowContentBindStage extends BindStage<RowContentBindParams> { mBinder.unbindContent(entry, row, contentToUnbind); BindParams bindParams = new BindParams(); - bindParams.isLowPriority = params.useLowPriority(); + bindParams.isMinimized = params.useLowPriority(); bindParams.usesIncreasedHeight = params.useIncreasedHeight(); bindParams.usesIncreasedHeadsUpHeight = params.useIncreasedHeadsUpHeight(); boolean forceInflate = params.needsReinflation(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java index 28f874da0c74..a4f5780c637d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java @@ -112,12 +112,12 @@ public class NotificationChildrenContainer extends ViewGroup private NotificationHeaderView mNotificationHeader; private NotificationHeaderViewWrapper mNotificationHeaderWrapper; - private NotificationHeaderView mNotificationHeaderLowPriority; - private NotificationHeaderViewWrapper mNotificationHeaderWrapperLowPriority; + private NotificationHeaderView mMinimizedGroupHeader; + private NotificationHeaderViewWrapper mMinimizedGroupHeaderWrapper; private NotificationGroupingUtil mGroupingUtil; private ViewState mHeaderViewState; private int mClipBottomAmount; - private boolean mIsLowPriority; + private boolean mIsMinimized; private OnClickListener mHeaderClickListener; private ViewGroup mCurrentHeader; private boolean mIsConversation; @@ -221,10 +221,10 @@ public class NotificationChildrenContainer extends ViewGroup mNotificationHeader.layout(0, 0, mNotificationHeader.getMeasuredWidth(), mNotificationHeader.getMeasuredHeight()); } - if (mNotificationHeaderLowPriority != null) { - mNotificationHeaderLowPriority.layout(0, 0, - mNotificationHeaderLowPriority.getMeasuredWidth(), - mNotificationHeaderLowPriority.getMeasuredHeight()); + if (mMinimizedGroupHeader != null) { + mMinimizedGroupHeader.layout(0, 0, + mMinimizedGroupHeader.getMeasuredWidth(), + mMinimizedGroupHeader.getMeasuredHeight()); } } @@ -274,8 +274,8 @@ public class NotificationChildrenContainer extends ViewGroup if (mNotificationHeader != null) { mNotificationHeader.measure(widthMeasureSpec, headerHeightSpec); } - if (mNotificationHeaderLowPriority != null) { - mNotificationHeaderLowPriority.measure(widthMeasureSpec, headerHeightSpec); + if (mMinimizedGroupHeader != null) { + mMinimizedGroupHeader.measure(widthMeasureSpec, headerHeightSpec); } setMeasuredDimension(width, height); @@ -311,8 +311,8 @@ public class NotificationChildrenContainer extends ViewGroup if (mNotificationHeaderWrapper != null) { mNotificationHeaderWrapper.setNotificationWhen(whenMillis); } - if (mNotificationHeaderWrapperLowPriority != null) { - mNotificationHeaderWrapperLowPriority.setNotificationWhen(whenMillis); + if (mMinimizedGroupHeaderWrapper != null) { + mMinimizedGroupHeaderWrapper.setNotificationWhen(whenMillis); } } @@ -448,12 +448,12 @@ public class NotificationChildrenContainer extends ViewGroup } private void removeLowPriorityGroupHeader() { - if (mNotificationHeaderLowPriority == null) { + if (mMinimizedGroupHeader == null) { return; } - removeView(mNotificationHeaderLowPriority); - mNotificationHeaderLowPriority = null; - mNotificationHeaderWrapperLowPriority = null; + removeView(mMinimizedGroupHeader); + mMinimizedGroupHeader = null; + mMinimizedGroupHeaderWrapper = null; } /** @@ -511,20 +511,20 @@ public class NotificationChildrenContainer extends ViewGroup return; } - mNotificationHeaderLowPriority = headerViewLowPriority; - mNotificationHeaderLowPriority.findViewById(com.android.internal.R.id.expand_button) + mMinimizedGroupHeader = headerViewLowPriority; + mMinimizedGroupHeader.findViewById(com.android.internal.R.id.expand_button) .setVisibility(VISIBLE); - mNotificationHeaderLowPriority.setOnClickListener(onClickListener); - mNotificationHeaderWrapperLowPriority = + mMinimizedGroupHeader.setOnClickListener(onClickListener); + mMinimizedGroupHeaderWrapper = (NotificationHeaderViewWrapper) NotificationViewWrapper.wrap( getContext(), - mNotificationHeaderLowPriority, + mMinimizedGroupHeader, mContainingNotification); - mNotificationHeaderWrapperLowPriority.setOnRoundnessChangedListener(this::invalidate); - addView(mNotificationHeaderLowPriority, 0); + mMinimizedGroupHeaderWrapper.setOnRoundnessChangedListener(this::invalidate); + addView(mMinimizedGroupHeader, 0); invalidate(); - mNotificationHeaderWrapperLowPriority.onContentUpdated(mContainingNotification); + mMinimizedGroupHeaderWrapper.onContentUpdated(mContainingNotification); updateHeaderVisibility(false /* animate */); updateChildrenAppearance(); } @@ -539,35 +539,35 @@ public class NotificationChildrenContainer extends ViewGroup AsyncGroupHeaderViewInflation.assertInLegacyMode(); RemoteViews header; StatusBarNotification notification = mContainingNotification.getEntry().getSbn(); - if (mIsLowPriority) { + if (mIsMinimized) { if (builder == null) { builder = Notification.Builder.recoverBuilder(getContext(), notification.getNotification()); } header = builder.makeLowPriorityContentView(true /* useRegularSubtext */); - if (mNotificationHeaderLowPriority == null) { - mNotificationHeaderLowPriority = (NotificationHeaderView) header.apply(getContext(), + if (mMinimizedGroupHeader == null) { + mMinimizedGroupHeader = (NotificationHeaderView) header.apply(getContext(), this); - mNotificationHeaderLowPriority.findViewById(com.android.internal.R.id.expand_button) + mMinimizedGroupHeader.findViewById(com.android.internal.R.id.expand_button) .setVisibility(VISIBLE); - mNotificationHeaderLowPriority.setOnClickListener(mHeaderClickListener); - mNotificationHeaderWrapperLowPriority = + mMinimizedGroupHeader.setOnClickListener(mHeaderClickListener); + mMinimizedGroupHeaderWrapper = (NotificationHeaderViewWrapper) NotificationViewWrapper.wrap( getContext(), - mNotificationHeaderLowPriority, + mMinimizedGroupHeader, mContainingNotification); mNotificationHeaderWrapper.setOnRoundnessChangedListener(this::invalidate); - addView(mNotificationHeaderLowPriority, 0); + addView(mMinimizedGroupHeader, 0); invalidate(); } else { - header.reapply(getContext(), mNotificationHeaderLowPriority); + header.reapply(getContext(), mMinimizedGroupHeader); } - mNotificationHeaderWrapperLowPriority.onContentUpdated(mContainingNotification); - resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, calculateDesiredHeader()); + mMinimizedGroupHeaderWrapper.onContentUpdated(mContainingNotification); + resetHeaderVisibilityIfNeeded(mMinimizedGroupHeader, calculateDesiredHeader()); } else { - removeView(mNotificationHeaderLowPriority); - mNotificationHeaderLowPriority = null; - mNotificationHeaderWrapperLowPriority = null; + removeView(mMinimizedGroupHeader); + mMinimizedGroupHeader = null; + mMinimizedGroupHeaderWrapper = null; } } @@ -589,7 +589,7 @@ public class NotificationChildrenContainer extends ViewGroup public void updateGroupOverflow() { if (mShowGroupCountInExpander) { setExpandButtonNumber(mNotificationHeaderWrapper); - setExpandButtonNumber(mNotificationHeaderWrapperLowPriority); + setExpandButtonNumber(mMinimizedGroupHeaderWrapper); return; } int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true /* likeCollapsed */); @@ -683,7 +683,7 @@ public class NotificationChildrenContainer extends ViewGroup if (AsyncGroupHeaderViewInflation.isEnabled()) { return mHeaderHeight; } else { - return mNotificationHeaderLowPriority.getHeight(); + return mMinimizedGroupHeader.getHeight(); } } int intrinsicHeight = mNotificationHeaderMargin + mCurrentHeaderTranslation; @@ -898,7 +898,7 @@ public class NotificationChildrenContainer extends ViewGroup && !showingAsLowPriority()) { return NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED; } - if (mIsLowPriority + if (mIsMinimized || (!mContainingNotification.isOnKeyguard() && mContainingNotification.isExpanded()) || (mContainingNotification.isHeadsUpState() && mContainingNotification.canShowHeadsUp())) { @@ -1133,8 +1133,8 @@ public class NotificationChildrenContainer extends ViewGroup return mNotificationHeaderWrapper; } - public NotificationViewWrapper getLowPriorityViewWrapper() { - return mNotificationHeaderWrapperLowPriority; + public NotificationViewWrapper getMinimizedGroupHeaderWrapper() { + return mMinimizedGroupHeaderWrapper; } @VisibleForTesting @@ -1146,8 +1146,8 @@ public class NotificationChildrenContainer extends ViewGroup return mNotificationHeader; } - public NotificationHeaderView getNotificationHeaderLowPriority() { - return mNotificationHeaderLowPriority; + public NotificationHeaderView getMinimizedNotificationHeader() { + return mMinimizedGroupHeader; } private void updateHeaderVisibility(boolean animate) { @@ -1193,7 +1193,7 @@ public class NotificationChildrenContainer extends ViewGroup } resetHeaderVisibilityIfNeeded(mNotificationHeader, desiredHeader); - resetHeaderVisibilityIfNeeded(mNotificationHeaderLowPriority, desiredHeader); + resetHeaderVisibilityIfNeeded(mMinimizedGroupHeader, desiredHeader); mCurrentHeader = desiredHeader; } @@ -1215,7 +1215,7 @@ public class NotificationChildrenContainer extends ViewGroup private ViewGroup calculateDesiredHeader() { ViewGroup desiredHeader; if (showingAsLowPriority()) { - desiredHeader = mNotificationHeaderLowPriority; + desiredHeader = mMinimizedGroupHeader; } else { desiredHeader = mNotificationHeader; } @@ -1244,10 +1244,10 @@ public class NotificationChildrenContainer extends ViewGroup private void updateHeaderTransformation() { if (mUserLocked && showingAsLowPriority()) { float fraction = getGroupExpandFraction(); - mNotificationHeaderWrapper.transformFrom(mNotificationHeaderWrapperLowPriority, + mNotificationHeaderWrapper.transformFrom(mMinimizedGroupHeaderWrapper, fraction); mNotificationHeader.setVisibility(VISIBLE); - mNotificationHeaderWrapperLowPriority.transformTo(mNotificationHeaderWrapper, + mMinimizedGroupHeaderWrapper.transformTo(mNotificationHeaderWrapper, fraction); } @@ -1257,7 +1257,7 @@ public class NotificationChildrenContainer extends ViewGroup if (visibleHeader == mNotificationHeader) { return mNotificationHeaderWrapper; } - return mNotificationHeaderWrapperLowPriority; + return mMinimizedGroupHeaderWrapper; } /** @@ -1405,11 +1405,11 @@ public class NotificationChildrenContainer extends ViewGroup if (AsyncGroupHeaderViewInflation.isEnabled()) { return mHeaderHeight; } - if (mNotificationHeaderLowPriority == null) { + if (mMinimizedGroupHeader == null) { Log.e(TAG, "getMinHeight: low priority header is null", new Exception()); return 0; } - return mNotificationHeaderLowPriority.getHeight(); + return mMinimizedGroupHeader.getHeight(); } int minExpandHeight = mNotificationHeaderMargin + headerTranslation; int visibleChildren = 0; @@ -1443,7 +1443,7 @@ public class NotificationChildrenContainer extends ViewGroup } public boolean showingAsLowPriority() { - return mIsLowPriority && !mContainingNotification.isExpanded(); + return mIsMinimized && !mContainingNotification.isExpanded(); } public void reInflateViews(OnClickListener listener, StatusBarNotification notification) { @@ -1454,9 +1454,9 @@ public class NotificationChildrenContainer extends ViewGroup removeView(mNotificationHeader); mNotificationHeader = null; } - if (mNotificationHeaderLowPriority != null) { - removeView(mNotificationHeaderLowPriority); - mNotificationHeaderLowPriority = null; + if (mMinimizedGroupHeader != null) { + removeView(mMinimizedGroupHeader); + mMinimizedGroupHeader = null; } recreateNotificationHeader(listener, mIsConversation); } @@ -1534,8 +1534,11 @@ public class NotificationChildrenContainer extends ViewGroup updateChildrenClipping(); } - public void setIsLowPriority(boolean isLowPriority) { - mIsLowPriority = isLowPriority; + /** + * Set whether the children container is minimized. + */ + public void setIsMinimized(boolean isMinimized) { + mIsMinimized = isMinimized; if (mContainingNotification != null) { /* we're not yet set up yet otherwise */ if (!AsyncGroupHeaderViewInflation.isEnabled()) { recreateLowPriorityHeader(null /* existingBuilder */, mIsConversation); @@ -1552,13 +1555,13 @@ public class NotificationChildrenContainer extends ViewGroup */ public NotificationViewWrapper getVisibleWrapper() { if (showingAsLowPriority()) { - return mNotificationHeaderWrapperLowPriority; + return mMinimizedGroupHeaderWrapper; } return mNotificationHeaderWrapper; } public void onExpansionChanged() { - if (mIsLowPriority) { + if (mIsMinimized) { if (mUserLocked) { setUserLocked(mUserLocked); } @@ -1581,8 +1584,8 @@ public class NotificationChildrenContainer extends ViewGroup /* animate = */ false ); } - if (mNotificationHeaderWrapperLowPriority != null) { - mNotificationHeaderWrapperLowPriority.requestTopRoundness( + if (mMinimizedGroupHeaderWrapper != null) { + mMinimizedGroupHeaderWrapper.requestTopRoundness( /* value = */ getTopRoundness(), /* sourceType = */ FROM_PARENT, /* animate = */ false @@ -1615,8 +1618,8 @@ public class NotificationChildrenContainer extends ViewGroup if (mNotificationHeaderWrapper != null) { mNotificationHeaderWrapper.setFeedbackIcon(icon); } - if (mNotificationHeaderWrapperLowPriority != null) { - mNotificationHeaderWrapperLowPriority.setFeedbackIcon(icon); + if (mMinimizedGroupHeaderWrapper != null) { + mMinimizedGroupHeaderWrapper.setFeedbackIcon(icon); } } @@ -1624,8 +1627,8 @@ public class NotificationChildrenContainer extends ViewGroup if (mNotificationHeaderWrapper != null) { mNotificationHeaderWrapper.setRecentlyAudiblyAlerted(audiblyAlertedRecently); } - if (mNotificationHeaderWrapperLowPriority != null) { - mNotificationHeaderWrapperLowPriority.setRecentlyAudiblyAlerted(audiblyAlertedRecently); + if (mMinimizedGroupHeaderWrapper != null) { + mMinimizedGroupHeaderWrapper.setRecentlyAudiblyAlerted(audiblyAlertedRecently); } } @@ -1635,8 +1638,8 @@ public class NotificationChildrenContainer extends ViewGroup if (mNotificationHeaderWrapper != null) { mNotificationHeaderWrapper.setNotificationFaded(faded); } - if (mNotificationHeaderWrapperLowPriority != null) { - mNotificationHeaderWrapperLowPriority.setNotificationFaded(faded); + if (mMinimizedGroupHeaderWrapper != null) { + mMinimizedGroupHeaderWrapper.setNotificationFaded(faded); } for (ExpandableNotificationRow child : mAttachedChildren) { child.setNotificationFaded(faded); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java index 42a6924b95e1..4bc6f1b704f0 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java @@ -769,7 +769,7 @@ public class ExpandableNotificationRowTest extends SysuiTestCase { when(mockViewWrapper.getIcon()).thenReturn(mockIcon); NotificationViewWrapper mockLowPriorityViewWrapper = mock(NotificationViewWrapper.class); - when(mockContainer.getLowPriorityViewWrapper()).thenReturn(mockLowPriorityViewWrapper); + when(mockContainer.getMinimizedGroupHeaderWrapper()).thenReturn(mockLowPriorityViewWrapper); CachingIconView mockLowPriorityIcon = mock(CachingIconView.class); when(mockLowPriorityViewWrapper.getIcon()).thenReturn(mockLowPriorityIcon); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java index a0d10759ba56..8c225113677b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java @@ -231,6 +231,7 @@ public class NotificationContentInflaterTest extends SysuiTestCase { NotificationContentInflater.applyRemoteView( AsyncTask.SERIAL_EXECUTOR, false /* inflateSynchronously */, + /* isMinimized= */ false, result, FLAG_CONTENT_VIEW_EXPANDED, 0, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java index 76470dbe6d21..7064c89c92c6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java @@ -210,7 +210,7 @@ public class RowContentBindStageTest extends SysuiTestCase { anyBoolean(), any()); BindParams usedParams = bindParamsCaptor.getValue(); - assertTrue(usedParams.isLowPriority); + assertTrue(usedParams.isMinimized); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java index 1f38a73020b2..3b16f1416935 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java @@ -67,7 +67,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test public void testGetMaxAllowedVisibleChildren_lowPriority() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); Assert.assertEquals(mChildrenContainer.getMaxAllowedVisibleChildren(), NotificationChildrenContainer.NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED); } @@ -81,7 +81,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test public void testGetMaxAllowedVisibleChildren_lowPriority_expandedChildren() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); mChildrenContainer.setChildrenExpanded(true); Assert.assertEquals(mChildrenContainer.getMaxAllowedVisibleChildren(), NotificationChildrenContainer.NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED); @@ -89,7 +89,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test public void testGetMaxAllowedVisibleChildren_lowPriority_userLocked() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); mChildrenContainer.setUserLocked(true); Assert.assertEquals(mChildrenContainer.getMaxAllowedVisibleChildren(), NotificationChildrenContainer.NUMBER_OF_CHILDREN_WHEN_SYSTEM_EXPANDED); @@ -118,7 +118,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test public void testShowingAsLowPriority_lowPriority() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); Assert.assertTrue(mChildrenContainer.showingAsLowPriority()); } @@ -129,7 +129,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test public void testShowingAsLowPriority_lowPriority_expanded() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); mGroup.setExpandable(true); mGroup.setUserExpanded(true, false); Assert.assertFalse(mChildrenContainer.showingAsLowPriority()); @@ -140,7 +140,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { mGroup.setUserLocked(true); mGroup.setExpandable(true); mGroup.setUserExpanded(true); - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); Assert.assertEquals(mChildrenContainer.getMaxAllowedVisibleChildren(), NotificationChildrenContainer.NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED); } @@ -148,14 +148,14 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test @DisableFlags(AsyncGroupHeaderViewInflation.FLAG_NAME) public void testLowPriorityHeaderCleared() { - mGroup.setIsLowPriority(true); + mGroup.setIsMinimized(true); NotificationHeaderView lowPriorityHeaderView = - mChildrenContainer.getLowPriorityViewWrapper().getNotificationHeader(); + mChildrenContainer.getMinimizedGroupHeaderWrapper().getNotificationHeader(); Assert.assertEquals(View.VISIBLE, lowPriorityHeaderView.getVisibility()); Assert.assertSame(mChildrenContainer, lowPriorityHeaderView.getParent()); - mGroup.setIsLowPriority(false); + mGroup.setIsMinimized(false); assertNull(lowPriorityHeaderView.getParent()); - assertNull(mChildrenContainer.getLowPriorityViewWrapper()); + assertNull(mChildrenContainer.getMinimizedGroupHeaderWrapper()); } @Test @@ -169,7 +169,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test @EnableFlags(AsyncGroupHeaderViewInflation.FLAG_NAME) public void testSetLowPriorityWithAsyncInflation_noHeaderReInflation() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); assertNull("We don't inflate header from the main thread with Async " + "Inflation enabled", mChildrenContainer.getCurrentHeaderView()); } @@ -179,21 +179,21 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { public void setLowPriorityBeforeLowPriorityHeaderSet() { //Given: the children container does not have a low-priority header, and is not low-priority - assertNull(mChildrenContainer.getLowPriorityViewWrapper()); - mGroup.setIsLowPriority(false); + assertNull(mChildrenContainer.getMinimizedGroupHeaderWrapper()); + mGroup.setIsMinimized(false); //When: set the children container to be low-priority and set the low-priority header - mGroup.setIsLowPriority(true); - mGroup.setLowPriorityGroupHeader(createHeaderView(/* lowPriorityHeader= */ true)); + mGroup.setIsMinimized(true); + mGroup.setMinimizedGroupHeader(createHeaderView(/* lowPriorityHeader= */ true)); //Then: the low-priority group header should be visible NotificationHeaderView lowPriorityHeaderView = - mChildrenContainer.getLowPriorityViewWrapper().getNotificationHeader(); + mChildrenContainer.getMinimizedGroupHeaderWrapper().getNotificationHeader(); Assert.assertEquals(View.VISIBLE, lowPriorityHeaderView.getVisibility()); Assert.assertSame(mChildrenContainer, lowPriorityHeaderView.getParent()); //When: set the children container to be not low-priority and set the normal header - mGroup.setIsLowPriority(false); + mGroup.setIsMinimized(false); mGroup.setGroupHeader(createHeaderView(/* lowPriorityHeader= */ false)); //Then: the low-priority group header should not be visible , normal header should be @@ -211,9 +211,9 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { public void changeLowPriorityAfterHeaderSet() { //Given: the children container does not have headers, and is not low-priority - assertNull(mChildrenContainer.getLowPriorityViewWrapper()); + assertNull(mChildrenContainer.getMinimizedGroupHeaderWrapper()); assertNull(mChildrenContainer.getNotificationHeaderWrapper()); - mGroup.setIsLowPriority(false); + mGroup.setIsMinimized(false); //When: set the set the normal header mGroup.setGroupHeader(createHeaderView(/* lowPriorityHeader= */ false)); @@ -225,14 +225,14 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { Assert.assertSame(mChildrenContainer, headerView.getParent()); //When: set the set the row to be low priority, and set the low-priority header - mGroup.setIsLowPriority(true); - mGroup.setLowPriorityGroupHeader(createHeaderView(/* lowPriorityHeader= */ true)); + mGroup.setIsMinimized(true); + mGroup.setMinimizedGroupHeader(createHeaderView(/* lowPriorityHeader= */ true)); //Then: the header view should not be visible, the low-priority group header should be // visible Assert.assertEquals(View.INVISIBLE, headerView.getVisibility()); NotificationHeaderView lowPriorityHeaderView = - mChildrenContainer.getLowPriorityViewWrapper().getNotificationHeader(); + mChildrenContainer.getMinimizedGroupHeaderWrapper().getNotificationHeader(); Assert.assertEquals(View.VISIBLE, lowPriorityHeaderView.getVisibility()); } @@ -263,7 +263,7 @@ public class NotificationChildrenContainerTest extends SysuiTestCase { @Test @DisableFlags(AsyncGroupHeaderViewInflation.FLAG_NAME) public void applyRoundnessAndInvalidate_should_be_immediately_applied_on_headerLowPriority() { - mChildrenContainer.setIsLowPriority(true); + mChildrenContainer.setIsMinimized(true); NotificationHeaderViewWrapper header = mChildrenContainer.getNotificationHeaderWrapper(); Assert.assertEquals(0f, header.getTopRoundness(), 0.001f); |