Fixing duplicate status bars in unfolded mode

The issue was caused by incorrect alpha calculation - getLockscreenShadeDragProgress should account for special case of going directly to expanded QS on lockscreen, when "dragProgress" is not updated.
Also putting keyguard status bar refresh close to split shade header refresh, otherwise keyguard status bar alpha wouldn't update often enough and animation would look like it's stuck.

Bug: 212544026
Test: in folded mode lockscreen pull down shade from the top to expanded QS -> unfold and see only one status bar
Change-Id: I3e8c66589270469cfc1484963d0a53c7273d07c1
This commit is contained in:
Michal Brzezinski
2021-12-30 11:27:53 +01:00
parent 0eebf348e4
commit d23d6bb38a
2 changed files with 4 additions and 19 deletions

View File

@@ -2438,7 +2438,7 @@ public class NotificationPanelViewController extends PanelViewController {
mSplitShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction);
mSplitShadeHeaderController.setQsExpandedFraction(qsExpansionFraction);
mSplitShadeHeaderController.setShadeExpanded(mQsVisible);
mKeyguardStatusBarViewController.updateViewState();
if (mCommunalViewController != null) {
mCommunalViewController.updateQsExpansion(qsExpansionFraction);
@@ -4733,8 +4733,6 @@ public class NotificationPanelViewController extends PanelViewController {
public interface NotificationPanelViewStateProvider {
/** Returns the expanded height of the panel view. */
float getPanelViewExpandedHeight();
/** Returns the fraction of QS that's expanded. */
float getQsExpansionFraction();
/**
* Returns true if heads up should be visible.
*
@@ -4754,11 +4752,6 @@ public class NotificationPanelViewController extends PanelViewController {
return getExpandedHeight();
}
@Override
public float getQsExpansionFraction() {
return computeQsExpansionFraction();
}
@Override
public boolean shouldHeadsUpBeVisible() {
return mHeadsUpAppearanceController.shouldBeVisible();
@@ -4766,7 +4759,9 @@ public class NotificationPanelViewController extends PanelViewController {
@Override
public float getLockscreenShadeDragProgress() {
return mLockscreenShadeTransitionController.getQSDragProgress();
return mTransitioningToFullShadeProgress > 0
? mLockscreenShadeTransitionController.getQSDragProgress()
: computeQsExpansionFraction();
}
};

View File

@@ -354,7 +354,6 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
TestNotificationPanelViewStateProvider() {}
private float mPanelViewExpandedHeight = 100f;
private float mQsExpansionFraction = 0f;
private boolean mShouldHeadsUpBeVisible = false;
private float mLockscreenShadeDragProgress = 0f;
@@ -363,11 +362,6 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
return mPanelViewExpandedHeight;
}
@Override
public float getQsExpansionFraction() {
return mQsExpansionFraction;
}
@Override
public boolean shouldHeadsUpBeVisible() {
return mShouldHeadsUpBeVisible;
@@ -382,10 +376,6 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
this.mPanelViewExpandedHeight = panelViewExpandedHeight;
}
public void setQsExpansionFraction(float qsExpansionFraction) {
this.mQsExpansionFraction = qsExpansionFraction;
}
public void setShouldHeadsUpBeVisible(boolean shouldHeadsUpBeVisible) {
this.mShouldHeadsUpBeVisible = shouldHeadsUpBeVisible;
}