diff options
5 files changed, 9 insertions, 24 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index d36fae199072..c88303a09d1d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -1801,15 +1801,6 @@ public class NotificationPanelViewController extends PanelViewController { return !mQsTouchAboveFalsingThreshold; } - /** - * Percentage of panel expansion offset, caused by pulling down on a heads-up. - */ - @Override - public void setMinFraction(float minFraction) { - mMinFraction = minFraction; - mDepthController.setPanelPullDownMinFraction(mMinFraction); - } - private float computeQsExpansionFraction() { if (mQSAnimatingHiddenFromCollapsed) { // When hiding QS from collapsed state, the expansion can sometimes temporarily @@ -3337,8 +3328,14 @@ public class NotificationPanelViewController extends PanelViewController { return mBarState == KEYGUARD; } + /** + * Sets the minimum fraction for the panel expansion offset. This may be non-zero in certain + * cases, such as if there's a heads-up notification. + */ public void setPanelScrimMinFraction(float minFraction) { mBar.onPanelMinFractionChanged(minFraction); + mMinFraction = minFraction; + mDepthController.setPanelPullDownMinFraction(mMinFraction); } public void clearNotificationEffects() { 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 430edfdd9d19..1f1090d7168b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone; import static java.lang.Float.isNaN; import static java.lang.annotation.RetentionPolicy.SOURCE; -import android.annotation.CallSuper; import android.annotation.IntDef; import android.content.Context; import android.os.Bundle; @@ -149,10 +148,7 @@ public abstract class PanelBar extends FrameLayout { /** * Percentage of panel expansion offset, caused by pulling down on a heads-up. */ - @CallSuper - public void onPanelMinFractionChanged(float minFraction) { - mPanel.setMinFraction(minFraction); - } + abstract void onPanelMinFractionChanged(float minFraction); /** * @param frac the fraction from the expansion in [0, 1] diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index 54adac098a33..768567b8b474 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -343,13 +343,6 @@ public abstract class PanelViewController { protected abstract float getOpeningHeight(); /** - * Minimum fraction from where expansion should start. This is set when pulling down on a - * heads-up notification. - * @param minFraction Fraction from 0 to 1. - */ - public abstract void setMinFraction(float minFraction); - - /** * @return whether the swiping direction is upwards and above a 45 degree angle compared to the * horizontal direction */ 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 815f6fe85022..1cca4777da0a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -272,7 +272,6 @@ public class PhoneStatusBarView extends PanelBar { if (isNaN(minFraction)) { throw new IllegalArgumentException("minFraction cannot be NaN"); } - super.onPanelMinFractionChanged(minFraction); if (mMinFraction != minFraction) { mMinFraction = minFraction; updateScrimFraction(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java index f7423bb7951d..e286ea986fde 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java @@ -469,8 +469,8 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { } @Test - public void testSetMinFraction() { - mNotificationPanelViewController.setMinFraction(0.5f); + public void testSetPanelScrimMinFraction() { + mNotificationPanelViewController.setPanelScrimMinFraction(0.5f); verify(mNotificationShadeDepthController).setPanelPullDownMinFraction(eq(0.5f)); } |