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

Commit 02ee885a authored by Rakesh Iyer's avatar Rakesh Iyer
Browse files

Delay the launch of the persistent task.

Looking at ActivityStarter, it seems like there is code to show
recents if the docked application is started from the home stack
and that ends up looking janky for us because we immediately switch
to the application we want to launch.

To avoid this, we defer the call to launch the docked stack until
after we get notified of a task launch on the fullscreen application
stack and avoid showing recents.

Change-Id: I92ba8aca3c29112f8c9520145aa00f6b58a1d31c
parent 0b7bceb7
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ class CarNavigationBarController {
        }
    }

    public void taskChanged(String packageName) {
    public void taskChanged(String packageName, int stackId) {
        // If the package name belongs to a filter, then highlight appropriate button in
        // the navigation bar.
        if (mFacetPackageMap.containsKey(packageName)) {
@@ -117,6 +117,12 @@ class CarNavigationBarController {
        if (category != null) {
            setCurrentFacet(mFacetCategoryMap.get(category));
        }

        // Set up the persistent docked task if needed.
        if (mPersistentTaskIntent != null && !mStatusBar.hasDockedTask()
                && stackId != StackId.HOME_STACK_ID) {
            mStatusBar.startActivityOnStack(mPersistentTaskIntent, StackId.DOCKED_STACK_ID);
        }
    }

    public void onPackageChange(String packageName) {
@@ -334,14 +340,8 @@ class CarNavigationBarController {
            stackId = StackId.HOME_STACK_ID;
        }

        if (mPersistentTaskIntent != null && !mStatusBar.hasDockedTask()
                && stackId != StackId.HOME_STACK_ID) {
            mStatusBar.startActivityOnStack(mPersistentTaskIntent, StackId.DOCKED_STACK_ID);
        }

        setCurrentFacet(index);
        mStatusBar.startActivityOnStack(intent, stackId);

    }

    private void onFacetLongClicked(int index) {
+2 −1
Original line number Diff line number Diff line
@@ -212,7 +212,8 @@ public class CarStatusBar extends PhoneStatusBar implements
            SystemServicesProxy ssp = Recents.getSystemServices();
            ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getRunningTask();
            if (runningTaskInfo != null && runningTaskInfo.baseActivity != null) {
                mController.taskChanged(runningTaskInfo.baseActivity.getPackageName());
                mController.taskChanged(runningTaskInfo.baseActivity.getPackageName(),
                        runningTaskInfo.stackId);
            }
        }
    }