Hide manage & clear affordances on transition to KG
We don't want to show the footer view that contains the "Manage" and "Clear all" affordances in the notification shade when the device is transitioning to the keyguard. Test: manual Fixes: 219680200 Change-Id: I1611589759e67d134ab957eee57ae865cfb64856
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
@@ -4959,6 +4961,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();
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user