use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by ResurrectionRemix.
the class PhoneStatusBar method handleGroupSummaryRemoved.
/**
* Ensures that the group children are cancelled immediately when the group summary is cancelled
* instead of waiting for the notification manager to send all cancels. Otherwise this could
* lead to flickers.
*
* This also ensures that the animation looks nice and only consists of a single disappear
* animation instead of multiple.
*
* @param key the key of the notification was removed
* @param ranking the current ranking
*/
private void handleGroupSummaryRemoved(String key, RankingMap ranking) {
Entry entry = mNotificationData.get(key);
if (entry != null && entry.row != null && entry.row.isSummaryWithChildren()) {
if (entry.notification.getOverrideGroupKey() != null && !entry.row.isDismissed()) {
// always cancelled. We only remove them if they were dismissed by the user.
return;
}
List<ExpandableNotificationRow> notificationChildren = entry.row.getNotificationChildren();
ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>();
for (int i = 0; i < notificationChildren.size(); i++) {
ExpandableNotificationRow row = notificationChildren.get(i);
if ((row.getStatusBarNotification().getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
// the child is a forground service notification which we can't remove!
continue;
}
toRemove.add(row);
toRemove.get(i).setKeepInParent(true);
// we need to set this state earlier as otherwise we might generate some weird
// animations
toRemove.get(i).setRemoved();
}
for (int i = 0; i < toRemove.size(); i++) {
removeNotification(toRemove.get(i).getStatusBarNotification().getKey(), ranking);
// we need to ensure that the view is actually properly removed from the viewstate
// as this won't happen anymore when kept in the parent.
mStackScroller.removeViewStateForView(toRemove.get(i));
}
}
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by ResurrectionRemix.
the class BaseStatusBar method removeNotificationViews.
protected StatusBarNotification removeNotificationViews(String key, RankingMap ranking) {
NotificationData.Entry entry = mNotificationData.remove(key, ranking);
if (entry == null) {
Log.w(TAG, "removeNotification for unknown key: " + key);
return null;
}
updateNotifications();
return entry.notification;
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by crdroidandroid.
the class BaseStatusBar method onDensityOrFontScaleChanged.
protected void onDensityOrFontScaleChanged() {
ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications();
for (int i = 0; i < activeNotifications.size(); i++) {
Entry entry = activeNotifications.get(i);
boolean exposedGuts = entry.row.getGuts() == mNotificationGutsExposed;
entry.row.reInflateViews();
if (exposedGuts) {
mNotificationGutsExposed = entry.row.getGuts();
bindGuts(entry.row);
}
inflateViews(entry, mStackScroller);
}
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by crdroidandroid.
the class BaseStatusBar method updateRowStates.
/**
* Updates expanded, dimmed and locked states of notification rows.
*/
protected void updateRowStates() {
mKeyguardIconOverflowContainer.getIconsView().removeAllViews();
final int N = mStackScroller.getChildCount();
int visibleNotifications = 0;
boolean onKeyguard = mState == StatusBarState.KEYGUARD;
int maxNotifications = 0;
if (onKeyguard) {
maxNotifications = getMaxKeyguardNotifications(true);
}
Stack<ExpandableNotificationRow> stack = new Stack<>();
for (int i = N - 1; i >= 0; i--) {
View child = mStackScroller.getChildAt(i);
if (!(child instanceof ExpandableNotificationRow)) {
continue;
}
stack.push((ExpandableNotificationRow) child);
}
while (!stack.isEmpty()) {
ExpandableNotificationRow row = stack.pop();
NotificationData.Entry entry = row.getEntry();
boolean childNotification = mGroupManager.isChildInGroupWithSummary(entry.notification);
if (onKeyguard) {
row.setOnKeyguard(true);
} else {
row.setOnKeyguard(false);
row.setSystemExpanded(visibleNotifications == 0 && !childNotification);
}
boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(entry.notification) && !entry.row.isRemoved();
boolean childWithVisibleSummary = childNotification && mGroupManager.getGroupSummary(entry.notification).getVisibility() == View.VISIBLE;
boolean showOnKeyguard = shouldShowOnKeyguard(entry.notification);
if (suppressedSummary || (isLockscreenPublicMode() && !mShowLockscreenNotifications) || (onKeyguard && !childWithVisibleSummary && (visibleNotifications >= maxNotifications || !showOnKeyguard))) {
entry.row.setVisibility(View.GONE);
if (onKeyguard && showOnKeyguard && !childNotification && !suppressedSummary) {
mKeyguardIconOverflowContainer.getIconsView().addNotification(entry);
}
} else {
boolean wasGone = entry.row.getVisibility() == View.GONE;
if (wasGone) {
entry.row.setVisibility(View.VISIBLE);
}
if (!childNotification && !entry.row.isRemoved()) {
if (wasGone) {
// notify the scroller of a child addition
mStackScroller.generateAddAnimation(entry.row, !showOnKeyguard);
}
visibleNotifications++;
}
}
if (row.isSummaryWithChildren()) {
List<ExpandableNotificationRow> notificationChildren = row.getNotificationChildren();
int size = notificationChildren.size();
for (int i = size - 1; i >= 0; i--) {
stack.push(notificationChildren.get(i));
}
}
}
mStackScroller.updateOverflowContainerVisibility(onKeyguard && mKeyguardIconOverflowContainer.getIconsView().getChildCount() > 0);
mStackScroller.changeViewPosition(mDismissView, mStackScroller.getChildCount() - 1);
mStackScroller.changeViewPosition(mEmptyShadeView, mStackScroller.getChildCount() - 2);
mStackScroller.changeViewPosition(mKeyguardIconOverflowContainer, mStackScroller.getChildCount() - 3);
if (onKeyguard) {
hideWeatherPanelIfNecessary(visibleNotifications, getMaxKeyguardNotifications(true));
}
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by crdroidandroid.
the class BaseStatusBar method removeNotificationViews.
protected StatusBarNotification removeNotificationViews(String key, RankingMap ranking) {
NotificationData.Entry entry = mNotificationData.remove(key, ranking);
if (entry == null) {
Log.w(TAG, "removeNotification for unknown key: " + key);
return null;
}
updateNotifications();
return entry.notification;
}
Aggregations