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

Commit c3c2b28c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unused recents freeform task code."

parents 7376615c 247f1d41
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ public class Recents extends SystemUI

    @Override
    public void start() {
        sDebugFlags = new RecentsDebugFlags(mContext);
        sDebugFlags = new RecentsDebugFlags();
        sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
        sConfiguration = new RecentsConfiguration(mContext);
        sTaskLoader = new RecentsTaskLoader(mContext);
+0 −5
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
import com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent;
import com.android.systemui.recents.events.ui.StackViewScrolledEvent;
import com.android.systemui.recents.events.ui.TaskViewDismissedEvent;
import com.android.systemui.recents.events.ui.UpdateFreeformTaskViewVisibilityEvent;
import com.android.systemui.recents.events.ui.UserInteractionEvent;
import com.android.systemui.recents.events.ui.focus.DismissFocusedTaskViewEvent;
import com.android.systemui.recents.events.ui.focus.FocusNextTaskViewEvent;
@@ -714,15 +713,11 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
    }

    public final void onBusEvent(EnterRecentsWindowLastAnimationFrameEvent event) {
        EventBus.getDefault().send(new UpdateFreeformTaskViewVisibilityEvent(true));
        mRecentsView.getViewTreeObserver().addOnPreDrawListener(this);
        mRecentsView.invalidate();
    }

    public final void onBusEvent(ExitRecentsWindowFirstAnimationFrameEvent event) {
        if (mRecentsView.isLastTaskLaunchedFreeform()) {
            EventBus.getDefault().send(new UpdateFreeformTaskViewVisibilityEvent(false));
        }
        mRecentsView.getViewTreeObserver().addOnPreDrawListener(this);
        mRecentsView.invalidate();
    }
+2 −16
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import com.android.systemui.tuner.TunerService;
/**
 * Tunable debug flags
 */
public class RecentsDebugFlags implements TunerService.Tunable {
public class RecentsDebugFlags {

    public static class Static {
        // Enables debug drawing for the transition thumbnail
@@ -50,21 +50,12 @@ public class RecentsDebugFlags implements TunerService.Tunable {
        public static final int MockTaskCount = 100;
    }

    /**
     * We read the prefs once when we start the activity, then update them as the tuner changes
     * the flags.
     */
    public RecentsDebugFlags(Context context) {
        // Register all our flags, this will also call onTuningChanged() for each key, which will
        // initialize the current state of each flag
    }

    /**
     * @return whether we are enabling fast toggling.
     */
    public boolean isFastToggleRecentsEnabled() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (ssp.hasFreeformWorkspaceSupport() || ssp.isTouchExplorationEnabled()) {
        if (ssp.isTouchExplorationEnabled()) {
            return false;
        }
        return Static.EnableFastToggleTimeout;
@@ -76,9 +67,4 @@ public class RecentsDebugFlags implements TunerService.Tunable {
    public boolean isPagingEnabled() {
        return Static.EnablePaging;
    }

    @Override
    public void onTuningChanged(String key, String newValue) {
        EventBus.getDefault().send(new DebugFlagsChangedEvent());
    }
}
+25 −58
Original line number Diff line number Diff line
@@ -746,8 +746,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
            stackLayout.getTaskStackBounds(displayRect, windowRect, systemInsets.top,
                    systemInsets.left, systemInsets.right, mTmpBounds);
            stackLayout.reset();
            stackLayout.initialize(displayRect, windowRect, mTmpBounds,
                    TaskStackLayoutAlgorithm.StackState.getStackStateForStack(stack));
            stackLayout.initialize(displayRect, windowRect, mTmpBounds);
        }
    }

@@ -866,38 +865,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
            getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo runningTask,
                    Rect windowOverrideRect) {
        final boolean isLowRamDevice = Recents.getConfiguration().isLowRamDevice;
        if (runningTask != null
                && runningTask.configuration.windowConfiguration.getWindowingMode()
                == WINDOWING_MODE_FREEFORM) {
            ArrayList<AppTransitionAnimationSpec> specs = new ArrayList<>();
            ArrayList<Task> tasks = mDummyStackView.getStack().getStackTasks();
            TaskStackLayoutAlgorithm stackLayout = mDummyStackView.getStackAlgorithm();
            TaskStackViewScroller stackScroller = mDummyStackView.getScroller();

            mDummyStackView.updateLayoutAlgorithm(true /* boundScroll */);
            mDummyStackView.updateToInitialState();

            for (int i = tasks.size() - 1; i >= 0; i--) {
                Task task = tasks.get(i);
                if (task.isFreeformTask()) {
                    mTmpTransform = stackLayout.getStackTransformScreenCoordinates(task,
                            stackScroller.getStackScroll(), mTmpTransform, null,
                            windowOverrideRect);
                    GraphicBuffer thumbnail = drawThumbnailTransitionBitmap(task, mTmpTransform);
                    Rect toTaskRect = new Rect();
                    mTmpTransform.rect.round(toTaskRect);
                    specs.add(new AppTransitionAnimationSpec(task.key.id, thumbnail, toTaskRect));
                }
            }
            AppTransitionAnimationSpec[] specsArray = new AppTransitionAnimationSpec[specs.size()];
            specs.toArray(specsArray);

            // For low end ram devices, wait for transition flag is reset when Recents entrance
            // animation is complete instead of when the transition animation starts
            return new Pair<>(ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
                    specsArray, mHandler, isLowRamDevice ? null : mResetToggleFlagListener, this),
                    null);
        } else {
        // Update the destination rect
        Task toTask = new Task();
        TaskViewTransform toTransform = getThumbnailTransitionTransform(mDummyStackView, toTask,
@@ -921,7 +889,6 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
                mHandler, future.getFuture(), isLowRamDevice ? null : mResetToggleFlagListener,
                false /* scaleUp */), future);
    }
    }

    /**
     * Returns the transition rect for the given task id.
@@ -935,7 +902,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
            runningTaskOut.copyFrom(launchTask);
        } else {
            // If no task is specified or we can not find the task just use the front most one
            launchTask = stack.getStackFrontMostTask(true /* includeFreeform */);
            launchTask = stack.getStackFrontMostTask();
            runningTaskOut.copyFrom(launchTask);
        }

+0 −31
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.recents.events.ui;

import com.android.systemui.recents.events.EventBus;

/**
 * This is sent to update the visibility of all visible freeform task views.
 */
public class UpdateFreeformTaskViewVisibilityEvent extends EventBus.Event {

    public final boolean visible;

    public UpdateFreeformTaskViewVisibilityEvent(boolean visible) {
        this.visible = visible;
    }
}
Loading