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

Commit 2b9c1d38 authored by Winson's avatar Winson
Browse files

Removing multiwindow debug flag.

- Also removing unused code for dismissing recents.

Change-Id: I6dcfbdb43cd08f4adfa362d4bf2247c0172fb92a
parent be7607af
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -116,9 +116,8 @@ public class Recents extends SystemUI

        /** Preloads the next task */
        public void run() {
            // Temporarily skip this if multi stack is enabled
            if (mConfig.multiWindowEnabled) return;

            // TODO: Temporarily skip this if multi stack is enabled
            /*
            RecentsConfiguration config = RecentsConfiguration.getInstance();
            if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
                RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
@@ -127,7 +126,7 @@ public class Recents extends SystemUI

                // Load the next task only if we aren't svelte
                RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
                loader.preloadTasks(plan, true /* isTopTaskHome */);
                loader.preloadTasks(plan, true);
                RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
                // This callback is made when a new activity is launched and the old one is paused
                // so ignore the current activity and try and preload the thumbnail for the
@@ -141,6 +140,7 @@ public class Recents extends SystemUI
                launchOpts.onlyLoadPausedActivities = true;
                loader.loadTasks(mContext, plan, launchOpts);
            }
            */
        }
    }

+18 −26
Original line number Diff line number Diff line
@@ -111,23 +111,12 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView

        @Override
        public void run() {
            // Finish Recents
            if (mLaunchIntent != null) {
            try {
                    if (mLaunchOpts != null) {
                startActivityAsUser(mLaunchIntent, mLaunchOpts.toBundle(), UserHandle.CURRENT);
                    } else {
                        startActivityAsUser(mLaunchIntent, UserHandle.CURRENT);
                    }
            } catch (Exception e) {
                Console.logError(RecentsActivity.this,
                        getString(R.string.recents_launch_error_message, "Home"));
            }
            } else {
                finish();
                overridePendingTransition(R.anim.recents_to_launcher_enter,
                        R.anim.recents_to_launcher_exit);
            }
        }
    }

@@ -144,7 +133,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
                    dismissRecentsToFocusedTaskOrHome(false);
                } else if (intent.getBooleanExtra(Recents.EXTRA_TRIGGERED_FROM_HOME_KEY, false)) {
                    // Otherwise, dismiss Recents to Home
                    dismissRecentsToHomeRaw(true);
                    dismissRecentsToHome(true);
                } else {
                    // Do nothing
                }
@@ -170,7 +159,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
            String action = intent.getAction();
            if (action.equals(Intent.ACTION_SCREEN_OFF)) {
                // When the screen turns off, dismiss Recents to Home
                dismissRecentsToHome(false);
                dismissRecentsToHomeIfVisible(false);
            } else if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
                // When the search activity changes, update the search widget view
                SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
@@ -286,25 +275,28 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
            if (mRecentsView.launchFocusedTask()) return true;
            // If we launched from Home, then return to Home
            if (launchState.launchedFromHome) {
                dismissRecentsToHomeRaw(true);
                dismissRecentsToHome(true);
                return true;
            }
            // Otherwise, try and return to the Task that Recents was launched from
            if (mRecentsView.launchPreviousTask()) return true;
            // If none of the other cases apply, then just go Home
            dismissRecentsToHomeRaw(true);
            dismissRecentsToHome(true);
            return true;
        }
        return false;
    }

    /** Dismisses Recents directly to Home. */
    void dismissRecentsToHomeRaw(boolean animated) {
    /**
     * Dismisses Recents directly to Home without checking whether it is currently visible.
     */
    void dismissRecentsToHome(boolean animated) {
        if (animated) {
            ReferenceCountedTrigger exitTrigger = new ReferenceCountedTrigger(this,
                    null, mFinishLaunchHomeRunnable, null);
            mRecentsView.startExitToHomeAnimation(
                    new ViewAnimation.TaskViewExitContext(exitTrigger));
            mScrimViews.startExitRecentsAnimation();
        } else {
            mFinishLaunchHomeRunnable.run();
        }
@@ -317,11 +309,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    }

    /** Dismisses Recents directly to Home if we currently aren't transitioning. */
    boolean dismissRecentsToHome(boolean animated) {
    boolean dismissRecentsToHomeIfVisible(boolean animated) {
        SystemServicesProxy ssp = RecentsTaskLoader.getInstance().getSystemServicesProxy();
        if (ssp.isRecentsTopMost(ssp.getTopMostTask(), null)) {
            // Return to Home
            dismissRecentsToHomeRaw(animated);
            dismissRecentsToHome(animated);
            return true;
        }
        return false;
@@ -421,7 +413,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    protected void onStop() {
        super.onStop();
        MetricsLogger.hidden(this, MetricsLogger.OVERVIEW_ACTIVITY);
        RecentsActivityLaunchState launchState = mConfig.getLaunchState();
        RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
        SystemServicesProxy ssp = loader.getSystemServicesProxy();
        Recents.notifyVisibilityChanged(this, ssp, false);
@@ -438,6 +429,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
        // Workaround for b/22542869, if the RecentsActivity is started again, but without going
        // through SystemUI, we need to reset the config launch flags to ensure that we do not
        // wait on the system to send a signal that was never queued.
        RecentsActivityLaunchState launchState = mConfig.getLaunchState();
        launchState.launchedFromHome = false;
        launchState.launchedFromSearchHome = false;
        launchState.launchedFromAppWithThumbnail = false;
@@ -560,7 +552,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
    @Override
    public void onTaskLaunchFailed() {
        // Return to Home
        dismissRecentsToHomeRaw(true);
        dismissRecentsToHome(true);
    }

    @Override
+0 −2
Original line number Diff line number Diff line
@@ -78,7 +78,6 @@ public class RecentsConfiguration {
    public int searchBarSpaceHeightPx;

    /** Dev options and global settings */
    public boolean multiWindowEnabled;
    public boolean lockToAppEnabled;

    /** Private constructor */
@@ -115,7 +114,6 @@ public class RecentsConfiguration {
        // settings or via multi window
        lockToAppEnabled = ssp.getSystemSetting(context,
                Settings.System.LOCK_TO_APP_ENABLED) != 0;
        multiWindowEnabled = "true".equals(ssp.getSystemProperty("persist.sys.debug.multi_window"));
        hasDockedTasks = ssp.hasDockedTask();

        // Recompute some values based on the given state, since we can not rely on the resource
+3 −5
Original line number Diff line number Diff line
@@ -235,13 +235,11 @@ public class RecentsResizeTaskDialog extends DialogFragment {

        // In debug mode, we force all task to be resizeable regardless of the
        // current app configuration.
        if (RecentsConfiguration.getInstance().multiWindowEnabled) {
        for (int i = additionalTasks; i >= 0; --i) {
            if (mTasks[i] != null) {
                mSsp.setTaskResizeable(mTasks[i].key.id);
            }
        }
        }

        // Show tasks as they might not be currently visible - beginning with the oldest so that
        // the focus ends on the selected one.
+1 −3
Original line number Diff line number Diff line
@@ -1296,9 +1296,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        RecentsTaskLoader.getInstance().loadTaskData(task);

        // If the doze trigger has already fired, then update the state for this task view
        if (mUIDozeTrigger.hasTriggered() || mConfig.multiWindowEnabled) {
        tv.setNoUserInteractionState();
        }

        // If we've finished the start animation, then ensure we always enable the focus animations
        if (mStartEnterAnimationCompleted) {
Loading