Fix missing animation when launch activity from notification.

The remote animaton is controlled by notification shade, if we set
the notification shade set to invisible, although the animator is
still running, but surface won't update.
Extending the visibility time until the animation finish can
solve this problem.

Fixes: 154815513
Test: atest SystemUITests
Test: Follow the issue description.
Change-Id: I68c3ff7fa11ecaef6b3d61226acb7eaa1f15f9aa
This commit is contained in:
wilsonshih
2020-05-06 17:44:37 +08:00
committed by Wei Sheng Shih
parent 4942963c5e
commit 2065eb7d28
4 changed files with 18 additions and 4 deletions

View File

@@ -321,7 +321,8 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
|| state.mPanelVisible || state.mKeyguardFadingAway || state.mBouncerShowing
|| state.mHeadsUpShowing
|| state.mScrimsVisibility != ScrimController.TRANSPARENT)
|| state.mBackgroundBlurRadius > 0;
|| state.mBackgroundBlurRadius > 0
|| state.mLaunchingActivity;
}
private void applyFitsSystemWindows(State state) {
@@ -485,6 +486,11 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
apply(mCurrentState);
}
void setLaunchingActivity(boolean launching) {
mCurrentState.mLaunchingActivity = launching;
apply(mCurrentState);
}
public void setScrimsVisibility(int scrimsVisibility) {
mCurrentState.mScrimsVisibility = scrimsVisibility;
apply(mCurrentState);
@@ -645,6 +651,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable,
boolean mForceCollapsed;
boolean mForceDozeBrightness;
boolean mForceUserActivity;
boolean mLaunchingActivity;
boolean mBackdropShowing;
boolean mWallpaperSupportsAmbientMode;
boolean mNotTouchable;

View File

@@ -93,6 +93,7 @@ public class NotificationShadeWindowViewController {
private PhoneStatusBarView mStatusBarView;
private PhoneStatusBarTransitions mBarTransitions;
private StatusBar mService;
private NotificationShadeWindowController mNotificationShadeWindowController;
private DragDownHelper mDragDownHelper;
private boolean mDoubleTapEnabled;
private boolean mSingleTapEnabled;
@@ -430,10 +431,14 @@ public class NotificationShadeWindowViewController {
public void setExpandAnimationPending(boolean pending) {
mExpandAnimationPending = pending;
mNotificationShadeWindowController
.setLaunchingActivity(mExpandAnimationPending | mExpandAnimationRunning);
}
public void setExpandAnimationRunning(boolean running) {
mExpandAnimationRunning = running;
mNotificationShadeWindowController
.setLaunchingActivity(mExpandAnimationPending | mExpandAnimationRunning);
}
public void cancelExpandHelper() {
@@ -456,8 +461,9 @@ public class NotificationShadeWindowViewController {
}
}
public void setService(StatusBar statusBar) {
public void setService(StatusBar statusBar, NotificationShadeWindowController controller) {
mService = statusBar;
mNotificationShadeWindowController = controller;
}
@VisibleForTesting

View File

@@ -1001,7 +1001,7 @@ public class StatusBar extends SystemUI implements DemoMode,
updateTheme();
inflateStatusBarWindow();
mNotificationShadeWindowViewController.setService(this);
mNotificationShadeWindowViewController.setService(this, mNotificationShadeWindowController);
mNotificationShadeWindowView.setOnTouchListener(getStatusBarWindowTouchListener());
// TODO: Deal with the ugliness that comes from having some of the statusbar broken out

View File

@@ -83,6 +83,7 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase {
@Mock private NotificationStackScrollLayout mNotificationStackScrollLayout;
@Mock private NotificationShadeDepthController mNotificationShadeDepthController;
@Mock private SuperStatusBarViewFactory mStatusBarViewFactory;
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
@Before
public void setUp() {
@@ -121,7 +122,7 @@ public class NotificationShadeWindowViewTest extends SysuiTestCase {
mNotificationPanelViewController,
mStatusBarViewFactory);
mController.setupExpandedStatusBar();
mController.setService(mStatusBar);
mController.setService(mStatusBar, mNotificationShadeWindowController);
mController.setDragDownHelper(mDragDownHelper);
}