private long calculateUpdateTime(CalendarAppWidgetModel model,long now,String timeZone){
  long minUpdateTime=getNextMidnightTimeMillis(timeZone);
  for (  EventInfo event : model.mEventInfos) {
    final long start;
    final long end;
    start=event.start;
    end=event.end;
    if (now < start) {
      minUpdateTime=Math.min(minUpdateTime,start);
    }
 else     if (now < end) {
      minUpdateTime=Math.min(minUpdateTime,end);
    }
  }
  return minUpdateTime;
}

private long calculateUpdateTime ( CalendarAppWidgetModel model , long now , String timeZone ) { long minUpdateTime = getNextMidnightTimeMillis ( timeZone ) ; for ( EventInfo event : model . mEventInfos ) { final long start ; final long end ; start = event . start ; end = event . end ; if ( now < start ) { minUpdateTime = Math . min ( minUpdateTime , start ) ; } else if ( now < end ) { minUpdateTime = Math . min ( minUpdateTime , end ) ; } } return minUpdateTime ; }
calculates and returns the next time we should push widget updates .
