summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-04-07 03:45:58 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-04-07 03:45:58 +0000
commit5f2835ac929cf03672bed8c43dd38bfa3e6f0371 (patch)
treeac6ce309680ca39a4ecde04152c5be40b8460670
parentce13187071687ea39aa67a69bb0745bf0f2e8fab (diff)
parenta5c827c13165146010abf099395d119ee4748f11 (diff)
downloadbase-5f2835ac929cf03672bed8c43dd38bfa3e6f0371.tar.gz
Merge cherrypicks of [10961387, 10961388, 10961389, 10962537, 10961893, 10961547, 10961390, 10964051, 10964032] into qt-d4-release
Change-Id: I57258305cea57c1865ae804ecf9b9d34b1368342
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java5
4 files changed, 14 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java
index dd200da56d20..b26cb25981f1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpTouchHelper.java
@@ -111,8 +111,9 @@ public class HeadsUpTouchHelper implements Gefingerpoken {
mInitialTouchY = y;
int startHeight = (int) (mPickedChild.getActualHeight()
+ mPickedChild.getTranslationY());
- mPanel.setPanelScrimMinFraction((float) startHeight
- / mPanel.getMaxPanelHeight());
+ float maxPanelHeight = mPanel.getMaxPanelHeight();
+ mPanel.setPanelScrimMinFraction(maxPanelHeight > 0f
+ ? (float) startHeight / maxPanelHeight : 0f);
mPanel.startExpandMotion(x, y, true /* startTracking */, startHeight);
mPanel.startExpandingFromPeek();
// This call needs to be after the expansion start otherwise we will get a
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 6bc0cf6e0a3d..2a5044463ea2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -2074,7 +2074,7 @@ public class NotificationPanelView extends PanelView implements
} else {
maxHeight = calculatePanelHeightShade();
}
- maxHeight = Math.max(maxHeight, min);
+ maxHeight = Math.max(min, maxHeight);
return maxHeight;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
index 063d00b806c2..21a966759439 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java
@@ -16,6 +16,8 @@
package com.android.systemui.statusbar.phone;
+import static java.lang.Float.isNaN;
+
import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
@@ -160,6 +162,9 @@ public abstract class PanelBar extends FrameLayout {
* fraction as the panel also might be expanded if the fraction is 0
*/
public void panelExpansionChanged(float frac, boolean expanded) {
+ if (isNaN(frac)) {
+ throw new IllegalArgumentException("frac cannot be NaN");
+ }
boolean fullyClosed = true;
boolean fullyOpened = false;
if (SPEW) LOG("panelExpansionChanged: start state=%d", mState);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index 2835201df243..3d705da65f2b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -21,6 +21,8 @@ import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static com.android.systemui.ScreenDecorations.DisplayCutoutView.boundsFromDirection;
import static com.android.systemui.SysUiServiceProvider.getComponent;
+import static java.lang.Float.isNaN;
+
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.Configuration;
@@ -265,6 +267,9 @@ public class PhoneStatusBarView extends PanelBar {
@Override
public void panelScrimMinFractionChanged(float minFraction) {
+ if (isNaN(minFraction)) {
+ throw new IllegalArgumentException("minFraction cannot be NaN");
+ }
if (mMinFraction != minFraction) {
mMinFraction = minFraction;
updateScrimFraction();