Program: 92685
Project: 92685
Buggy source:
private void updateWidget(Context context,AppWidgetManager manager,int widgetId,Bundle options){
  int max_height=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT));
  int min_height=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT));
  int max_width=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH));
  int min_width=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH));
  Log.d("String_Node_Str",String.format("String_Node_Str",max_height,min_height,max_width,min_width));
  RemoteViews remoteViews=new RemoteViews(context.getPackageName(),R.layout.widget_graph);
  Context appContext=context.getApplicationContext();
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(appContext);
  Long habitId=prefs.getLong(getWidgetPrefKey(widgetId),-1L);
  if (habitId < 0)   return;
  Habit habit=Habit.get(habitId);
  HabitHistoryView widgetView=new HabitHistoryView(context,null);
  widgetView.setHabit(habit);
  widgetView.setDrawingCacheEnabled(true);
  widgetView.measure(max_width,max_height);
  widgetView.layout(0,0,max_width,max_height);
  int width=widgetView.getMeasuredWidth();
  int height=widgetView.getMeasuredHeight();
  Log.d("String_Node_Str",String.format("String_Node_Str",width,height));
  height-=DialogHelper.dpToPixels(context,12f);
  widgetView.measure(width,height);
  widgetView.layout(0,0,width,height);
  widgetView.buildDrawingCache(true);
  Bitmap drawingCache=widgetView.getDrawingCache();
  remoteViews.setTextViewText(R.id.tvName,habit.name);
  remoteViews.setImageViewBitmap(R.id.imageView,drawingCache);
  remoteViews.setOnClickPendingIntent(R.id.imageView,HabitBroadcastReceiver.buildCheckIntent(context,habit,null));
  manager.updateAppWidget(widgetId,remoteViews);
}

Fixed version (ground truth):
private void updateWidget(Context context,AppWidgetManager manager,int widgetId,Bundle options){
  int max_height=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT));
  int min_height=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT));
  int max_width=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH));
  int min_width=(int)DialogHelper.dpToPixels(context,options.getInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH));
  Log.d("String_Node_Str",String.format("String_Node_Str",max_height,min_height,max_width,min_width));
  RemoteViews remoteViews=new RemoteViews(context.getPackageName(),R.layout.widget_graph);
  Context appContext=context.getApplicationContext();
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(appContext);
  Long habitId=prefs.getLong(getWidgetPrefKey(widgetId),-1L);
  if (habitId < 0)   return;
  Habit habit=Habit.get(habitId);
  HabitScoreView widgetView=new HabitScoreView(context,null);
  widgetView.setIsBackgroundTransparent(true);
  widgetView.setHabit(habit);
  widgetView.setDrawingCacheEnabled(true);
  widgetView.measure(max_width,max_height);
  widgetView.layout(0,0,max_width,max_height);
  int width=widgetView.getMeasuredWidth();
  int height=widgetView.getMeasuredHeight();
  Log.d("String_Node_Str",String.format("String_Node_Str",width,height));
  height-=DialogHelper.dpToPixels(context,12f);
  widgetView.measure(width,height);
  widgetView.layout(0,0,width,height);
  widgetView.buildDrawingCache(true);
  Bitmap drawingCache=widgetView.getDrawingCache();
  remoteViews.setTextViewText(R.id.tvName,habit.name);
  remoteViews.setImageViewBitmap(R.id.imageView,drawingCache);
  remoteViews.setOnClickPendingIntent(R.id.imageView,HabitBroadcastReceiver.buildCheckIntent(context,habit,null));
  manager.updateAppWidget(widgetId,remoteViews);
}