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

Commit b036dbb6 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "executing onOverviewXXX actions in UI thread" into ub-launcher3-master

parents 08bdb7c0 7d8d1319
Loading
Loading
Loading
Loading
+33 −23
Original line number Diff line number Diff line
@@ -73,9 +73,11 @@ public class OverviewCommandHelper extends InternalStateHandler {
    }

    public void onOverviewToggle() {
        getLauncher().runOnUiThread(() -> {
                    if (DEBUG_START_FALLBACK_ACTIVITY) {
                        mContext.startActivity(new Intent(mContext, RecentsActivity.class)
                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK));
                                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent
                                        .FLAG_ACTIVITY_CLEAR_TASK));
                        return;
                    }

@@ -89,8 +91,11 @@ public class OverviewCommandHelper extends InternalStateHandler {
                        openRecents();
                    }
                }
        );
    }

    public void onOverviewShown() {
        getLauncher().runOnUiThread(() -> {
                    if (isOverviewAlmostVisible()) {
                        final RecentsView rv = getLauncher().getOverviewPanel();
                        rv.snapToTaskAfterNext();
@@ -98,11 +103,16 @@ public class OverviewCommandHelper extends InternalStateHandler {
                        openRecents();
                    }
                }
        );
    }

    public void onOverviewHidden() {
        getLauncher().runOnUiThread(() -> {
                    final RecentsView rv = getLauncher().getOverviewPanel();
                    rv.launchNextTask();
                }
        );
    }

    private void startNonLauncherTask(int backStackCount) {
        for (RecentTaskInfo rti : mAM.getRecentTasks(backStackCount, UserHandle.myUserId())) {