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

Commit f970db03 authored by wilsonshih's avatar wilsonshih
Browse files

Post pilferPointers callback to UiThread's executor

Avoid unsynchronized issue.

Flag: EXEMPT bugfix
Bug: 365896106
Test: verify EdgeBackGestureHandler#pilferPointers execute at main
thread.

Change-Id: I44610fc5b4c8e86d0fd58de58f89fe826a9cf256
parent fa07bc40
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1335,14 +1335,16 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
    public void setBackAnimation(@Nullable BackAnimation backAnimation) {
        mBackAnimation = backAnimation;
        if (backAnimation != null) {
            backAnimation.setPilferPointerCallback(this::pilferPointers);
            final Executor uiThreadExecutor = mUiThreadContext.getExecutor();
            backAnimation.setPilferPointerCallback(
                    () -> uiThreadExecutor.execute(this::pilferPointers));
            backAnimation.setTopUiRequestCallback(
                    (requestTopUi, tag) -> mUiThreadContext.getExecutor().execute(() ->
                    (requestTopUi, tag) -> uiThreadExecutor.execute(() ->
                            mNotificationShadeWindowController.setRequestTopUi(requestTopUi, tag)));
            updateBackAnimationThresholds();
            if (mLightBarControllerProvider.get() != null) {
                mBackAnimation.setStatusBarCustomizer((appearance) ->
                        mUiThreadContext.getExecutor().execute(() ->
                        uiThreadExecutor.execute(() ->
                            mLightBarControllerProvider.get()
                                    .customizeStatusBarAppearance(appearance)));
            }