Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 409561e0 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Revert^2 Fix missing animation when launch activity from notification"...

Merge "Revert^2 Fix missing animation when launch activity from notification" into rvc-dev am: e7f5bd07

Change-Id: I8ca753d6c9c490b4fac3c5bca2484a520f39711c
parents 925c09cd e7f5bd07
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;
+13 −3
Original line number Diff line number Diff line
@@ -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;
@@ -429,11 +430,19 @@ public class NotificationShadeWindowViewController {
    }

    public void setExpandAnimationPending(boolean pending) {
        if (mExpandAnimationPending != pending) {
            mExpandAnimationPending = pending;
            mNotificationShadeWindowController
                    .setLaunchingActivity(mExpandAnimationPending | mExpandAnimationRunning);
        }
    }

    public void setExpandAnimationRunning(boolean running) {
        if (mExpandAnimationRunning != running) {
            mExpandAnimationRunning = running;
            mNotificationShadeWindowController
                    .setLaunchingActivity(mExpandAnimationPending | mExpandAnimationRunning);
        }
    }

    public void cancelExpandHelper() {
@@ -456,8 +465,9 @@ public class NotificationShadeWindowViewController {
        }
    }

    public void setService(StatusBar statusBar) {
    public void setService(StatusBar statusBar, NotificationShadeWindowController controller) {
        mService = statusBar;
        mNotificationShadeWindowController = controller;
    }

    @VisibleForTesting
+1 −1
Original line number Diff line number Diff line
@@ -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
+5 −2
Original line number Diff line number Diff line
@@ -429,7 +429,9 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
            }
            int launchResult = intent.sendAndReturnResult(mContext, 0, fillInIntent, null,
                    null, null, getActivityOptions(adapter));
            mMainThreadHandler.post(() -> {
                mActivityLaunchAnimator.setLaunchResult(launchResult, isActivityIntent);
            });
        } catch (RemoteException | PendingIntent.CanceledException e) {
            // the stack trace isn't very helpful here.
            // Just log the exception message.
@@ -449,10 +451,11 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
                                mActivityLaunchAnimator.getLaunchAnimation(
                                        row, mStatusBar.isOccluded())),
                                new UserHandle(UserHandle.getUserId(appUid)));
                mActivityLaunchAnimator.setLaunchResult(launchResult, true /* isActivityIntent */);

                // Putting it back on the main thread, since we're touching views
                mMainThreadHandler.post(() -> {
                    mActivityLaunchAnimator.setLaunchResult(launchResult,
                            true /* isActivityIntent */);
                    removeHUN(row);
                });
                if (shouldCollapse()) {
+2 −1
Original line number Diff line number Diff line
@@ -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);

    }