Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +19 −5 Original line number Diff line number Diff line Loading @@ -334,6 +334,7 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mKeyguardUserSwitcherEnabled; private boolean mDozing; private boolean mDozingOnDown; private boolean mBouncerShowing; private int mBarState; private float mInitialHeightOnTouch; private float mInitialTouchX; Loading Loading @@ -404,7 +405,7 @@ public class NotificationPanelViewController extends PanelViewController { private Runnable mHeadsUpExistenceChangedRunnable = () -> { setHeadsUpAnimatingAway(false); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); }; // TODO (b/162832756): once migrated to the new pipeline, delete legacy group manager private NotificationGroupManagerLegacy mGroupManager; Loading Loading @@ -3231,11 +3232,19 @@ public class NotificationPanelViewController extends PanelViewController { public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { mHeadsUpAnimatingAway = headsUpAnimatingAway; mNotificationStackScrollLayoutController.setHeadsUpAnimatingAway(headsUpAnimatingAway); updateHeadsUpVisibility(); updateVisibility(); } private void updateHeadsUpVisibility() { ((PhoneStatusBarView) mBar).setHeadsUpVisible(mHeadsUpAnimatingAway || mHeadsUpPinnedMode); /** Set whether the bouncer is showing. */ public void setBouncerShowing(boolean bouncerShowing) { mBouncerShowing = bouncerShowing; updateVisibility(); } @Override protected boolean shouldPanelBeVisible() { boolean headsUpVisible = mHeadsUpAnimatingAway || mHeadsUpPinnedMode; return headsUpVisible || isExpanded() || mBouncerShowing; } @Override Loading Loading @@ -3645,6 +3654,11 @@ public class NotificationPanelViewController extends PanelViewController { } } /** */ public void setImportantForAccessibility(int mode) { mView.setImportantForAccessibility(mode); } /** * Do not let the user drag the shade up and down for the current touch session. * This is necessary to avoid shade expansion while/after the bouncer is dismissed. Loading Loading @@ -4219,7 +4233,7 @@ public class NotificationPanelViewController extends PanelViewController { } updateGestureExclusionRect(); mHeadsUpPinnedMode = inPinnedMode; updateHeadsUpVisibility(); updateVisibility(); mKeyguardStatusBarViewController.updateForHeadsUp(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +0 −31 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ public abstract class PanelBar extends FrameLayout { private static final boolean SPEW = false; private static final String PANEL_BAR_SUPER_PARCELABLE = "panel_bar_super_parcelable"; private static final String STATE = "state"; private boolean mBouncerShowing; private boolean mExpanded; protected float mPanelFraction; public static final void LOG(String fmt, Object... args) { Loading Loading @@ -99,33 +97,6 @@ public abstract class PanelBar extends FrameLayout { pv.setBar(this); } public void setBouncerShowing(boolean showing) { mBouncerShowing = showing; int important = showing ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO; setImportantForAccessibility(important); updateVisibility(); if (mPanel != null) mPanel.getView().setImportantForAccessibility(important); } public float getExpansionFraction() { return mPanelFraction; } public boolean isExpanded() { return mExpanded; } protected void updateVisibility() { mPanel.getView().setVisibility(shouldPanelBeVisible() ? VISIBLE : INVISIBLE); } protected boolean shouldPanelBeVisible() { return mExpanded || mBouncerShowing; } public boolean panelEnabled() { return true; } Loading Loading @@ -183,9 +154,7 @@ public abstract class PanelBar extends FrameLayout { boolean fullyClosed = true; boolean fullyOpened = false; if (SPEW) LOG("panelExpansionChanged: start state=%d, f=%.1f", mState, frac); mExpanded = expanded; mPanelFraction = frac; updateVisibility(); // adjust any other panels that may be partially visible if (expanded) { if (mState == STATE_CLOSED) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +37 −14 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.systemui.statusbar.phone; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE; import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK; import static com.android.systemui.classifier.Classifier.GENERIC; Loading Loading @@ -315,7 +318,7 @@ public abstract class PanelViewController { } private void startOpening(MotionEvent event) { notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); maybeVibrateOnOpening(); //TODO: keyguard opens QS a different way; log that too? Loading Loading @@ -447,7 +450,7 @@ public abstract class PanelViewController { protected void onTrackingStopped(boolean expand) { mTracking = false; mBar.onTrackingStopped(expand); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } protected void onTrackingStarted() { Loading @@ -455,7 +458,7 @@ public abstract class PanelViewController { mTracking = true; mBar.onTrackingStarted(); notifyExpandingStarted(); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } /** Loading Loading @@ -685,7 +688,7 @@ public abstract class PanelViewController { } else { cancelJankMonitoring(CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } protected abstract boolean shouldUseDismissingAnimation(); Loading Loading @@ -760,7 +763,7 @@ public abstract class PanelViewController { mExpandedFraction = Math.min(1f, maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight); onHeightUpdated(mExpandedHeight); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } /** Loading Loading @@ -878,7 +881,7 @@ public abstract class PanelViewController { if (mExpanding) { notifyExpandingFinished(); } notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); // Wait for window manager to pickup the change, so we know the maximum height of the panel // then. Loading Loading @@ -916,7 +919,7 @@ public abstract class PanelViewController { } if (mInstantExpanding) { mInstantExpanding = false; notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } } Loading Loading @@ -1022,7 +1025,7 @@ public abstract class PanelViewController { public void onAnimationEnd(Animator animation) { setAnimator(null); onAnimationFinished.run(); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } }); animator.start(); Loading Loading @@ -1059,19 +1062,39 @@ public abstract class PanelViewController { return animator; } protected void notifyBarPanelExpansionChanged() { /** Update the visibility of {@link PanelView} if necessary. */ public void updateVisibility() { mView.setVisibility(shouldPanelBeVisible() ? VISIBLE : INVISIBLE); } /** Returns true if {@link PanelView} should be visible. */ abstract boolean shouldPanelBeVisible(); /** * Updates the panel expansion and {@link PanelView} visibility if necessary. * * TODO(b/200063118): Could public calls to this method be replaced with calls to * {@link #updateVisibility()}? That would allow us to make this method private. */ public void updatePanelExpansionAndVisibility() { if (mBar != null) { mBar.panelExpansionChanged( mExpandedFraction, mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null && !mIsSpringBackAnimation); mBar.panelExpansionChanged(mExpandedFraction, isExpanded()); } updateVisibility(); for (int i = 0; i < mExpansionListeners.size(); i++) { mExpansionListeners.get(i).onPanelExpansionChanged(mExpandedFraction, mTracking); } } public boolean isExpanded() { return mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null && !mIsSpringBackAnimation; } public void addExpansionListener(PanelExpansionListener panelExpansionListener) { mExpansionListeners.add(panelExpansionListener); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +0 −10 Original line number Diff line number Diff line Loading @@ -402,16 +402,6 @@ public class PhoneStatusBarView extends PanelBar { getPaddingBottom()); } public void setHeadsUpVisible(boolean headsUpVisible) { mHeadsUpVisible = headsUpVisible; updateVisibility(); } @Override protected boolean shouldPanelBeVisible() { return mHeadsUpVisible || super.shouldPanelBeVisible(); } /** An interface that will provide whether panel is enabled. */ interface PanelEnabledProvider { /** Returns true if the panel is enabled and false otherwise. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ class PhoneStatusBarViewController( } } fun setImportantForAccessibility(mode: Int) { mView.importantForAccessibility = mode } private class StatusBarViewsCenterProvider : UnfoldMoveFromCenterAnimator.ViewCenterProvider { override fun getViewCenter(view: View, outPoint: Point) = when (view.id) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +19 −5 Original line number Diff line number Diff line Loading @@ -334,6 +334,7 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mKeyguardUserSwitcherEnabled; private boolean mDozing; private boolean mDozingOnDown; private boolean mBouncerShowing; private int mBarState; private float mInitialHeightOnTouch; private float mInitialTouchX; Loading Loading @@ -404,7 +405,7 @@ public class NotificationPanelViewController extends PanelViewController { private Runnable mHeadsUpExistenceChangedRunnable = () -> { setHeadsUpAnimatingAway(false); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); }; // TODO (b/162832756): once migrated to the new pipeline, delete legacy group manager private NotificationGroupManagerLegacy mGroupManager; Loading Loading @@ -3231,11 +3232,19 @@ public class NotificationPanelViewController extends PanelViewController { public void setHeadsUpAnimatingAway(boolean headsUpAnimatingAway) { mHeadsUpAnimatingAway = headsUpAnimatingAway; mNotificationStackScrollLayoutController.setHeadsUpAnimatingAway(headsUpAnimatingAway); updateHeadsUpVisibility(); updateVisibility(); } private void updateHeadsUpVisibility() { ((PhoneStatusBarView) mBar).setHeadsUpVisible(mHeadsUpAnimatingAway || mHeadsUpPinnedMode); /** Set whether the bouncer is showing. */ public void setBouncerShowing(boolean bouncerShowing) { mBouncerShowing = bouncerShowing; updateVisibility(); } @Override protected boolean shouldPanelBeVisible() { boolean headsUpVisible = mHeadsUpAnimatingAway || mHeadsUpPinnedMode; return headsUpVisible || isExpanded() || mBouncerShowing; } @Override Loading Loading @@ -3645,6 +3654,11 @@ public class NotificationPanelViewController extends PanelViewController { } } /** */ public void setImportantForAccessibility(int mode) { mView.setImportantForAccessibility(mode); } /** * Do not let the user drag the shade up and down for the current touch session. * This is necessary to avoid shade expansion while/after the bouncer is dismissed. Loading Loading @@ -4219,7 +4233,7 @@ public class NotificationPanelViewController extends PanelViewController { } updateGestureExclusionRect(); mHeadsUpPinnedMode = inPinnedMode; updateHeadsUpVisibility(); updateVisibility(); mKeyguardStatusBarViewController.updateForHeadsUp(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +0 −31 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ public abstract class PanelBar extends FrameLayout { private static final boolean SPEW = false; private static final String PANEL_BAR_SUPER_PARCELABLE = "panel_bar_super_parcelable"; private static final String STATE = "state"; private boolean mBouncerShowing; private boolean mExpanded; protected float mPanelFraction; public static final void LOG(String fmt, Object... args) { Loading Loading @@ -99,33 +97,6 @@ public abstract class PanelBar extends FrameLayout { pv.setBar(this); } public void setBouncerShowing(boolean showing) { mBouncerShowing = showing; int important = showing ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO; setImportantForAccessibility(important); updateVisibility(); if (mPanel != null) mPanel.getView().setImportantForAccessibility(important); } public float getExpansionFraction() { return mPanelFraction; } public boolean isExpanded() { return mExpanded; } protected void updateVisibility() { mPanel.getView().setVisibility(shouldPanelBeVisible() ? VISIBLE : INVISIBLE); } protected boolean shouldPanelBeVisible() { return mExpanded || mBouncerShowing; } public boolean panelEnabled() { return true; } Loading Loading @@ -183,9 +154,7 @@ public abstract class PanelBar extends FrameLayout { boolean fullyClosed = true; boolean fullyOpened = false; if (SPEW) LOG("panelExpansionChanged: start state=%d, f=%.1f", mState, frac); mExpanded = expanded; mPanelFraction = frac; updateVisibility(); // adjust any other panels that may be partially visible if (expanded) { if (mState == STATE_CLOSED) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +37 −14 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.systemui.statusbar.phone; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE; import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK; import static com.android.systemui.classifier.Classifier.GENERIC; Loading Loading @@ -315,7 +318,7 @@ public abstract class PanelViewController { } private void startOpening(MotionEvent event) { notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); maybeVibrateOnOpening(); //TODO: keyguard opens QS a different way; log that too? Loading Loading @@ -447,7 +450,7 @@ public abstract class PanelViewController { protected void onTrackingStopped(boolean expand) { mTracking = false; mBar.onTrackingStopped(expand); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } protected void onTrackingStarted() { Loading @@ -455,7 +458,7 @@ public abstract class PanelViewController { mTracking = true; mBar.onTrackingStarted(); notifyExpandingStarted(); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } /** Loading Loading @@ -685,7 +688,7 @@ public abstract class PanelViewController { } else { cancelJankMonitoring(CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE); } notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } protected abstract boolean shouldUseDismissingAnimation(); Loading Loading @@ -760,7 +763,7 @@ public abstract class PanelViewController { mExpandedFraction = Math.min(1f, maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight); onHeightUpdated(mExpandedHeight); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } /** Loading Loading @@ -878,7 +881,7 @@ public abstract class PanelViewController { if (mExpanding) { notifyExpandingFinished(); } notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); // Wait for window manager to pickup the change, so we know the maximum height of the panel // then. Loading Loading @@ -916,7 +919,7 @@ public abstract class PanelViewController { } if (mInstantExpanding) { mInstantExpanding = false; notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } } Loading Loading @@ -1022,7 +1025,7 @@ public abstract class PanelViewController { public void onAnimationEnd(Animator animation) { setAnimator(null); onAnimationFinished.run(); notifyBarPanelExpansionChanged(); updatePanelExpansionAndVisibility(); } }); animator.start(); Loading Loading @@ -1059,19 +1062,39 @@ public abstract class PanelViewController { return animator; } protected void notifyBarPanelExpansionChanged() { /** Update the visibility of {@link PanelView} if necessary. */ public void updateVisibility() { mView.setVisibility(shouldPanelBeVisible() ? VISIBLE : INVISIBLE); } /** Returns true if {@link PanelView} should be visible. */ abstract boolean shouldPanelBeVisible(); /** * Updates the panel expansion and {@link PanelView} visibility if necessary. * * TODO(b/200063118): Could public calls to this method be replaced with calls to * {@link #updateVisibility()}? That would allow us to make this method private. */ public void updatePanelExpansionAndVisibility() { if (mBar != null) { mBar.panelExpansionChanged( mExpandedFraction, mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null && !mIsSpringBackAnimation); mBar.panelExpansionChanged(mExpandedFraction, isExpanded()); } updateVisibility(); for (int i = 0; i < mExpansionListeners.size(); i++) { mExpansionListeners.get(i).onPanelExpansionChanged(mExpandedFraction, mTracking); } } public boolean isExpanded() { return mExpandedFraction > 0f || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null && !mIsSpringBackAnimation; } public void addExpansionListener(PanelExpansionListener panelExpansionListener) { mExpansionListeners.add(panelExpansionListener); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +0 −10 Original line number Diff line number Diff line Loading @@ -402,16 +402,6 @@ public class PhoneStatusBarView extends PanelBar { getPaddingBottom()); } public void setHeadsUpVisible(boolean headsUpVisible) { mHeadsUpVisible = headsUpVisible; updateVisibility(); } @Override protected boolean shouldPanelBeVisible() { return mHeadsUpVisible || super.shouldPanelBeVisible(); } /** An interface that will provide whether panel is enabled. */ interface PanelEnabledProvider { /** Returns true if the panel is enabled and false otherwise. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt +4 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ class PhoneStatusBarViewController( } } fun setImportantForAccessibility(mode: Int) { mView.importantForAccessibility = mode } private class StatusBarViewsCenterProvider : UnfoldMoveFromCenterAnimator.ViewCenterProvider { override fun getViewCenter(view: View, outPoint: Point) = when (view.id) { Loading