public boolean handleFileUpdated(DownloadsDB db,int index,String filename,long fileSize){
  DownloadInfo di=db.getDownloadInfoByFileName(filename);
  if (null != di) {
    String oldFile=di.mFileName;
    if (null != oldFile) {
      if (filename.equals(oldFile)) {
        return false;
      }
      String deleteFile=Helpers.generateSaveFileName(this,oldFile);
      File f=new File(deleteFile);
      if (f.exists())       f.delete();
    }
  }
  return !Helpers.doesFileExist(this,filename,fileSize,true);
}

public boolean handleFileUpdated ( DownloadsDB db , int index , String filename , long fileSize ) { DownloadInfo di = db . getDownloadInfoByFileName ( filename ) ; if ( null != di ) { String oldFile = di . mFileName ; if ( null != oldFile ) { if ( filename . equals ( oldFile ) ) { return false ; } String deleteFile = Helpers . generateSaveFileName ( this , oldFile ) ; File f = new File ( deleteFile ) ; if ( f . exists ( ) ) f . delete ( ) ; } } return ! Helpers . doesFileExist ( this , filename , fileSize , true ) ; }
the apk has been updated and a filename has been sent down from the market call . if the file has the same name as the previous file , we do nothing as the file is guaranteed to be the same . if the file does not have the same name , we download it if it hasn ' t already been delivered by market .
