summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ioana Alexandru <aioana@google.com> 2022-10-10 08:57:29 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-10-10 08:57:29 +0000
commitd076b96d7329c9c7058dc8ba5b7c001fb2eeaa6a (patch)
treeac1b1d85a500d8768993ab8b593391614f2d7db0
parent65d64a2dc61e682ac9c8c855a3eff183edb32941 (diff)
parent2ba952ac0cc509e23aac3cec34a6181f01c1e165 (diff)
Merge "Avoid dividing 0 by 0 in StackScrollAlgorithm." into tm-qpr-dev am: 2ba952ac0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20069093 Change-Id: I2e54221654a7b61e34a5c05ce6b2758a1f792842 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index eeed07014c11..32591ce733b9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -884,6 +884,9 @@ public class StackScrollAlgorithm {
childViewState.zTranslation = baseZ;
} else {
float factor = (notificationEnd - shelfStart) / shelfHeight;
+ if (Float.isNaN(factor)) { // Avoid problems when the above is 0/0.
+ factor = 1.0f;
+ }
factor = Math.min(factor, 1.0f);
childViewState.zTranslation = baseZ + factor * zDistanceBetweenElements;
}