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

Commit fbc01a0b authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Fix transient task bar not automatically stashed in app when...

Fix transient task bar not automatically stashed in app when ENABLE_TASKBAR_NO_RECREATION is enabled

Currently the task bar root layout consumes all the events and does not pass the events to drag layer, without explictly routing those events

Fixes: 303910224
Test: go to an app, swipe home, and then go back to the app. Make sure the task bar is stashed
Change-Id: I6f5e481c267dad25544118134ff95b0cb9bb1a45
parent 9633e5b7
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.os.Trace;
import android.provider.Settings;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.WindowManager;
import android.widget.FrameLayout;

@@ -211,7 +212,18 @@ public class TaskbarManager {
        mContext = service.createWindowContext(display, TYPE_NAVIGATION_BAR_PANEL, null);
        if (ENABLE_TASKBAR_NO_RECREATION.get()) {
            mWindowManager = mContext.getSystemService(WindowManager.class);
            mTaskbarRootLayout = new FrameLayout(mContext);
            mTaskbarRootLayout = new FrameLayout(mContext) {
                @Override
                public boolean dispatchTouchEvent(MotionEvent ev) {
                    // The motion events can be outside the view bounds of task bar, and hence
                    // manually dispatching them to the drag layer here.
                    if (mTaskbarActivityContext != null
                            && mTaskbarActivityContext.getDragLayer().isAttachedToWindow()) {
                        return mTaskbarActivityContext.getDragLayer().dispatchTouchEvent(ev);
                    }
                    return super.dispatchTouchEvent(ev);
                }
            };
        }
        mNavButtonController = new TaskbarNavButtonController(service,
                SystemUiProxy.INSTANCE.get(mContext), new Handler(),