Merge "Hide manage & clear affordances on transition to KG" into tm-dev

This commit is contained in:
Beverly Tai
2022-04-04 18:15:24 +00:00
committed by Android (Google) Code Review
4 changed files with 34 additions and 4 deletions

View File

@@ -93,6 +93,12 @@ public interface StatusBarStateController {
default void onStateChanged(int newState) {
}
/**
* Callback to be notified about upcoming state changes. Typically, is immediately followed
* by #onStateChanged, unless there was an intentional delay in updating the state changed.
*/
default void onUpcomingStateChanged(int upcomingState) {}
/**
* Callback to be notified when Dozing changes. Dozing is stored separately from state.
*/

View File

@@ -205,7 +205,7 @@ public class StatusBarStateControllerImpl implements
}
mLastState = mState;
mState = state;
mUpcomingState = state;
updateUpcomingState(mState);
mUiEventLogger.log(StatusBarStateEvent.fromState(mState));
Trace.instantForTrack(Trace.TRACE_TAG_APP, "UI Events", "StatusBarState " + tag);
for (RankedListener rl : new ArrayList<>(mListeners)) {
@@ -223,8 +223,18 @@ public class StatusBarStateControllerImpl implements
@Override
public void setUpcomingState(int nextState) {
mUpcomingState = nextState;
recordHistoricalState(mUpcomingState /* newState */, mState /* lastState */, true);
recordHistoricalState(nextState /* newState */, mState /* lastState */, true);
updateUpcomingState(nextState);
}
private void updateUpcomingState(int upcomingState) {
if (mUpcomingState != upcomingState) {
mUpcomingState = upcomingState;
for (RankedListener rl : new ArrayList<>(mListeners)) {
rl.mListener.onUpcomingStateChanged(mUpcomingState);
}
}
}
@Override

View File

@@ -427,6 +427,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
private boolean mInHeadsUpPinnedMode;
private boolean mHeadsUpAnimatingAway;
private int mStatusBarState;
private int mUpcomingStatusBarState;
private int mCachedBackgroundColor;
private boolean mHeadsUpGoingAwayAnimationsAllowed = true;
private Runnable mReflingAndAnimateScroll = () -> {
@@ -690,7 +691,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
mController.hasActiveClearableNotifications(ROWS_ALL);
boolean showFooterView = (showDismissView || mController.getVisibleNotificationCount() > 0)
&& mIsCurrentUserSetup // see: b/193149550
&& mStatusBarState != StatusBarState.KEYGUARD
&& !onKeyguard()
&& mUpcomingStatusBarState != StatusBarState.KEYGUARD
// quick settings don't affect notifications when not in full screen
&& (mQsExpansionFraction != 1 || !mQsFullScreen)
&& !mScreenOffAnimationController.shouldHideNotificationsFooter()
@@ -4960,6 +4962,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
updateDismissBehavior();
}
void setUpcomingStatusBarState(int upcomingStatusBarState) {
mUpcomingStatusBarState = upcomingStatusBarState;
if (mUpcomingStatusBarState != mStatusBarState) {
updateFooter();
}
}
void onStatePostChange(boolean fromShadeLocked) {
boolean onKeyguard = onKeyguard();

View File

@@ -309,6 +309,11 @@ public class NotificationStackScrollLayoutController {
mView.setStatusBarState(mBarState);
}
@Override
public void onUpcomingStateChanged(int newState) {
mView.setUpcomingStatusBarState(newState);
}
@Override
public void onStatePostChange() {
mView.updateSensitiveness(mStatusBarStateController.goingToFullShade(),