Program: 195951
Project: 195951
Buggy source:
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  if (sInstanceLoadPlan == null) {
    RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
    sInstanceLoadPlan=loader.createLoadPlan(mContext);
  }
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.preloadTasks(sInstanceLoadPlan,isTopTaskHome);
  TaskStack stack=sInstanceLoadPlan.getTaskStack();
  mDummyStackView.updateMinMaxScrollForStack(stack,mTriggeredFromAltTab,isTopTaskHome);
  TaskStackViewLayoutAlgorithm.VisibilityReport stackVr=mDummyStackView.computeStackVisibilityReport();
  boolean hasRecentTasks=stack.getTaskCount() > 0;
  boolean useThumbnailTransition=!isTopTaskHome && hasRecentTasks;
  if (useThumbnailTransition) {
    RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
    launchOpts.runningTaskId=topTask.id;
    launchOpts.loadThumbnails=false;
    loader.loadTasks(mContext,sInstanceLoadPlan,launchOpts);
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask,stack,mDummyStackView);
    if (opts != null) {
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL,stackVr);
    }
 else {
      useThumbnailTransition=false;
    }
  }
  if (!useThumbnailTransition) {
    if (hasRecentTasks) {
      String homeActivityPackage=mSystemServicesProxy.getHomeActivityPackageName();
      AppWidgetProviderInfo searchWidget=null;
      String searchWidgetPackage=null;
      if (mConfig.hasSearchBarAppWidget()) {
        searchWidget=mSystemServicesProxy.getAppWidgetInfo(mConfig.searchBarAppWidgetId);
      }
 else {
        searchWidget=mSystemServicesProxy.resolveSearchAppWidget();
      }
      if (searchWidget != null && searchWidget.provider != null) {
        searchWidgetPackage=searchWidget.provider.getPackageName();
      }
      boolean fromSearchHome=false;
      if (homeActivityPackage != null && searchWidgetPackage != null && homeActivityPackage.equals(searchWidgetPackage)) {
        fromSearchHome=true;
      }
      ActivityOptions opts=getHomeTransitionActivityOptions(fromSearchHome);
      startAlternateRecentsActivity(topTask,opts,fromSearchHome ? EXTRA_FROM_SEARCH_HOME : EXTRA_FROM_HOME,stackVr);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_HOME,stackVr);
    }
  }
  mLastToggleTime=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  if (sInstanceLoadPlan == null) {
    RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
    sInstanceLoadPlan=loader.createLoadPlan(mContext);
  }
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.preloadTasks(sInstanceLoadPlan,isTopTaskHome);
  TaskStack stack=sInstanceLoadPlan.getTaskStack();
  mDummyStackView.updateMinMaxScrollForStack(stack,mTriggeredFromAltTab,isTopTaskHome);
  TaskStackViewLayoutAlgorithm.VisibilityReport stackVr=mDummyStackView.computeStackVisibilityReport();
  boolean hasRecentTasks=stack.getTaskCount() > 0;
  boolean useThumbnailTransition=!isTopTaskHome && hasRecentTasks;
  if (useThumbnailTransition) {
    RecentsTaskLoadPlan.Options launchOpts=new RecentsTaskLoadPlan.Options();
    launchOpts.runningTaskId=topTask.id;
    launchOpts.loadThumbnails=false;
    launchOpts.onlyLoadForCache=true;
    loader.loadTasks(mContext,sInstanceLoadPlan,launchOpts);
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask,stack,mDummyStackView);
    if (opts != null) {
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL,stackVr);
    }
 else {
      useThumbnailTransition=false;
    }
  }
  if (!useThumbnailTransition) {
    if (hasRecentTasks) {
      String homeActivityPackage=mSystemServicesProxy.getHomeActivityPackageName();
      AppWidgetProviderInfo searchWidget=null;
      String searchWidgetPackage=null;
      if (mConfig.hasSearchBarAppWidget()) {
        searchWidget=mSystemServicesProxy.getAppWidgetInfo(mConfig.searchBarAppWidgetId);
      }
 else {
        searchWidget=mSystemServicesProxy.resolveSearchAppWidget();
      }
      if (searchWidget != null && searchWidget.provider != null) {
        searchWidgetPackage=searchWidget.provider.getPackageName();
      }
      boolean fromSearchHome=false;
      if (homeActivityPackage != null && searchWidgetPackage != null && homeActivityPackage.equals(searchWidgetPackage)) {
        fromSearchHome=true;
      }
      ActivityOptions opts=getHomeTransitionActivityOptions(fromSearchHome);
      startAlternateRecentsActivity(topTask,opts,fromSearchHome ? EXTRA_FROM_SEARCH_HOME : EXTRA_FROM_HOME,stackVr);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_HOME,stackVr);
    }
  }
  mLastToggleTime=System.currentTimeMillis();
}