Merge "Fixed an issue where notification dismissals wouldn't animate" into sc-dev
This commit is contained in:
@@ -158,14 +158,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
final int N = activeNotifications.size();
|
final int N = activeNotifications.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
NotificationEntry ent = activeNotifications.get(i);
|
NotificationEntry ent = activeNotifications.get(i);
|
||||||
final boolean isBubbleNotificationSuppressedFromShade = mBubblesOptional.isPresent()
|
if (shouldSuppressActiveNotification(ent)) {
|
||||||
&& mBubblesOptional.get().isBubbleNotificationSuppressedFromShade(
|
|
||||||
ent.getKey(), ent.getSbn().getGroupKey());
|
|
||||||
if (ent.isRowDismissed() || ent.isRowRemoved()
|
|
||||||
|| isBubbleNotificationSuppressedFromShade
|
|
||||||
|| mFgsSectionController.hasEntry(ent)) {
|
|
||||||
// we don't want to update removed notifications because they could
|
|
||||||
// temporarily become children if they were isolated before.
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,9 +247,11 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (ExpandableNotificationRow viewToRemove : viewsToRemove) {
|
for (ExpandableNotificationRow viewToRemove : viewsToRemove) {
|
||||||
if (mEntryManager.getPendingOrActiveNotif(viewToRemove.getEntry().getKey()) != null) {
|
NotificationEntry entry = viewToRemove.getEntry();
|
||||||
|
if (mEntryManager.getPendingOrActiveNotif(entry.getKey()) != null
|
||||||
|
&& !shouldSuppressActiveNotification(entry)) {
|
||||||
// we are only transferring this notification to its parent, don't generate an
|
// we are only transferring this notification to its parent, don't generate an
|
||||||
// animation
|
// animation. If the notification is suppressed, this isn't a transfer.
|
||||||
mListContainer.setChildTransferInProgress(true);
|
mListContainer.setChildTransferInProgress(true);
|
||||||
}
|
}
|
||||||
if (viewToRemove.isSummaryWithChildren()) {
|
if (viewToRemove.isSummaryWithChildren()) {
|
||||||
@@ -325,6 +320,23 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
|||||||
endUpdate();
|
endUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should a notification entry from the active list be suppressed and not show?
|
||||||
|
*/
|
||||||
|
private boolean shouldSuppressActiveNotification(NotificationEntry ent) {
|
||||||
|
final boolean isBubbleNotificationSuppressedFromShade = mBubblesOptional.isPresent()
|
||||||
|
&& mBubblesOptional.get().isBubbleNotificationSuppressedFromShade(
|
||||||
|
ent.getKey(), ent.getSbn().getGroupKey());
|
||||||
|
if (ent.isRowDismissed() || ent.isRowRemoved()
|
||||||
|
|| isBubbleNotificationSuppressedFromShade
|
||||||
|
|| mFgsSectionController.hasEntry(ent)) {
|
||||||
|
// we want to suppress removed notifications because they could
|
||||||
|
// temporarily become children if they were isolated before.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void addNotificationChildrenAndSort() {
|
private void addNotificationChildrenAndSort() {
|
||||||
// Let's now add all notification children which are missing
|
// Let's now add all notification children which are missing
|
||||||
boolean orderChanged = false;
|
boolean orderChanged = false;
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ public class RemoteInputController {
|
|||||||
public void removeRemoteInput(NotificationEntry entry, Object token) {
|
public void removeRemoteInput(NotificationEntry entry, Object token) {
|
||||||
Objects.requireNonNull(entry);
|
Objects.requireNonNull(entry);
|
||||||
if (entry.mRemoteEditImeVisible) return;
|
if (entry.mRemoteEditImeVisible) return;
|
||||||
|
// If the view is being removed, this may be called even though we're not active
|
||||||
|
if (!isRemoteInputActive(entry)) return;
|
||||||
|
|
||||||
pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token);
|
pruneWeakThenRemoveAndContains(null /* contains */, entry /* remove */, token);
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
false /* default */);
|
false /* default */);
|
||||||
// TODO(b/187291379) disable again before release
|
// TODO(b/187291379) disable again before release
|
||||||
private static final boolean DEBUG_REMOVE_ANIMATION = SystemProperties.getBoolean(
|
private static final boolean DEBUG_REMOVE_ANIMATION = SystemProperties.getBoolean(
|
||||||
"persist.debug.nssl.dismiss", true /* default */);
|
"persist.debug.nssl.dismiss", false /* default */);
|
||||||
|
|
||||||
private static final float RUBBER_BAND_FACTOR_NORMAL = 0.35f;
|
private static final float RUBBER_BAND_FACTOR_NORMAL = 0.35f;
|
||||||
private static final float RUBBER_BAND_FACTOR_AFTER_EXPAND = 0.15f;
|
private static final float RUBBER_BAND_FACTOR_AFTER_EXPAND = 0.15f;
|
||||||
@@ -3205,6 +3205,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
ignoreChildren);
|
ignoreChildren);
|
||||||
mAnimationEvents.add(event);
|
mAnimationEvents.add(event);
|
||||||
mSwipedOutViews.remove(child);
|
mSwipedOutViews.remove(child);
|
||||||
|
if (DEBUG_REMOVE_ANIMATION) {
|
||||||
|
String key = "";
|
||||||
|
if (child instanceof ExpandableNotificationRow) {
|
||||||
|
key = ((ExpandableNotificationRow) child).getEntry().getKey();
|
||||||
|
}
|
||||||
|
Log.d(TAG, "created Remove Event - SwipedOut: " + childWasSwipedOut + " " + key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mChildrenToRemoveAnimated.clear();
|
mChildrenToRemoveAnimated.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user