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

Commit 98e8f7ac authored by Winson Chung's avatar Winson Chung
Browse files

DO NOT MERGE. Ensure screen pinning UI appears immediately after setting changes.

Fixes an issue where the screen pinning UI in the Overview space would
not appear on the first load after changing the setting, this was because
the updated flag was not read before the tasks were preloaded prior to
entering the Overview space.

Bug: 18986736
Change-Id: I50dc9ff6d369fb3f2593f2bf2c1dc4608878820f
parent 2cc617b2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -642,12 +642,13 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta

    /** Starts the recents activity */
    void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) {
        RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
        RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);

        if (sInstanceLoadPlan == null) {
            // Create a new load plan if onPreloadRecents() was never triggered
            RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
            sInstanceLoadPlan = loader.createLoadPlan(mContext);
        }
        RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
        loader.preloadTasks(sInstanceLoadPlan, isTopTaskHome);
        TaskStack stack = sInstanceLoadPlan.getTaskStack();

+10 −8
Original line number Diff line number Diff line
@@ -361,12 +361,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // For the non-primary user, ensure that the SystemSericesProxy is initialized
        // For the non-primary user, ensure that the SystemServicesProxy and configuration is
        // initialized
        RecentsTaskLoader.initialize(this);

        // Initialize the loader and the configuration
        mConfig = RecentsConfiguration.reinitialize(this,
                RecentsTaskLoader.getInstance().getSystemServicesProxy());
        SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
        mConfig = RecentsConfiguration.reinitialize(this, ssp);

        // Initialize the widget host (the host id is static and does not change)
        mAppWidgetHost = new RecentsAppWidgetHost(this, Constants.Values.App.AppWidgetHostId);
@@ -421,9 +420,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        super.onNewIntent(intent);
        setIntent(intent);

        // Reinitialize the configuration
        RecentsConfiguration.reinitialize(this, RecentsTaskLoader.getInstance().getSystemServicesProxy());

        // Clear any debug rects
        if (mDebugOverlay != null) {
            mDebugOverlay.clear();
@@ -450,6 +446,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

        // Update the recent tasks
        updateRecentsTasks(getIntent());

        // If this is a new instance from a configuration change, then we have to manually trigger
        // the enter animation state
        if (mConfig.launchedHasConfigurationChanged) {
            onEnterAnimationTriggered();
        }
    }

    @Override
+3 −1
Original line number Diff line number Diff line
@@ -252,6 +252,8 @@ public class TaskStack {
            if (group.getTaskCount() == 0) {
                removeGroup(group);
            }
            // Update the lock-to-app state
            t.lockToThisTask = false;
            if (mCb != null) {
                // Notify that a task has been removed
                mCb.onStackTaskRemoved(this, t, null);
+1 −1
Original line number Diff line number Diff line
@@ -542,7 +542,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
        loader.deleteTaskData(t, false);

        // Remove the old task from activity manager
        RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id);
        loader.getSystemServicesProxy().removeTask(t.key.id);
    }

    @Override