Program: 196495
Project: 196495
Buggy source:
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  SystemServicesProxy ssp=mSystemServicesProxy;
  List<ActivityManager.RecentTaskInfo> recentTasks=ssp.getRecentTasks(3,UserHandle.CURRENT.getIdentifier(),isTopTaskHome);
  boolean useThumbnailTransition=!isTopTaskHome;
  boolean hasRecentTasks=!recentTasks.isEmpty();
  if (useThumbnailTransition) {
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask,isTopTaskHome);
    if (opts != null) {
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL);
    }
 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);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,null);
    }
  }
  mLastToggleTime=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  SystemServicesProxy ssp=mSystemServicesProxy;
  List<ActivityManager.RecentTaskInfo> recentTasks=ssp.getRecentTasks(3,UserHandle.CURRENT.getIdentifier(),isTopTaskHome);
  boolean useThumbnailTransition=!isTopTaskHome;
  boolean hasRecentTasks=!recentTasks.isEmpty();
  if (useThumbnailTransition) {
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask,isTopTaskHome);
    if (opts != null) {
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL);
    }
 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);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_HOME);
    }
  }
  mLastToggleTime=System.currentTimeMillis();
}