public TaskStackView(Context context, TaskStack stack) {
   super(context);
   mConfig = RecentsConfiguration.getInstance();
   mStack = stack;
   mStack.setCallbacks(this);
   mViewPool = new ViewPool<TaskView, Task>(context, this);
   mInflater = LayoutInflater.from(context);
   mLayoutAlgorithm = new TaskStackViewLayoutAlgorithm(mConfig);
   mFilterAlgorithm = new TaskStackViewFilterAlgorithm(mConfig, this, mViewPool);
   mStackScroller = new TaskStackViewScroller(context, mConfig, mLayoutAlgorithm);
   mStackScroller.setCallbacks(this);
   mTouchHandler = new TaskStackViewTouchHandler(context, this, mConfig, mStackScroller);
   mUIDozeTrigger =
       new DozeTrigger(
           mConfig.taskBarDismissDozeDelaySeconds,
           new Runnable() {
             @Override
             public void run() {
               // Show the task bar dismiss buttons
               int childCount = getChildCount();
               for (int i = 0; i < childCount; i++) {
                 TaskView tv = (TaskView) getChildAt(i);
                 tv.startNoUserInteractionAnimation();
               }
             }
           });
 }
    /** Preloads the next task */
    public void run() {
      // Temporarily skip this if multi stack is enabled
      if (mConfig.multiStackEnabled) return;

      RecentsConfiguration config = RecentsConfiguration.getInstance();
      if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
        RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
        SystemServicesProxy ssp = loader.getSystemServicesProxy();
        ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getTopMostTask();

        // Load the next task only if we aren't svelte
        RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
        loader.preloadTasks(plan, true /* isTopTaskHome */);
        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
        // previous one.
        if (runningTaskInfo != null) {
          launchOpts.runningTaskId = runningTaskInfo.id;
        }
        launchOpts.numVisibleTasks = 2;
        launchOpts.numVisibleTaskThumbnails = 2;
        launchOpts.onlyLoadForCache = true;
        launchOpts.onlyLoadPausedActivities = true;
        loader.loadTasks(mContext, plan, launchOpts);
      }
    }
 public TaskView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
   super(context, attrs, defStyleAttr, defStyleRes);
   mConfig = RecentsConfiguration.getInstance();
   mMaxDimScale = mConfig.taskStackMaxDim / 255f;
   mClipViewInStack = true;
   mViewBounds = new AnimateableViewBounds(this, mConfig.taskViewRoundedCornerRadiusPx);
   setTaskProgress(getTaskProgress());
   setDim(getDim());
   if (mConfig.fakeShadows) {
     setBackground(new FakeShadowDrawable(context.getResources(), mConfig));
   }
   setOutlineProvider(mViewBounds);
 }
 public RecentsView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
   super(context, attrs, defStyleAttr, defStyleRes);
   mConfig = RecentsConfiguration.getInstance();
   mInflater = LayoutInflater.from(context);
 }