public void downloadApkFile(
     String url,
     String fileName,
     String pkg,
     int versionCode,
     String savePath,
     boolean autoResume,
     final RequestCallBack<File> callback)
     throws DbException {
   if (checkDownloaded(pkg, versionCode, savePath)) {
     PackageUtils.installApp(mContext, savePath);
     return;
   }
   String tmpApkPath = savePath + getMD5ApkTmpName(pkg, versionCode);
   String apkPath = savePath + getMD5ApkName(pkg, versionCode);
   final DownloadInfo downloadInfo = new DownloadInfo();
   downloadInfo.setDownloadUrl(url);
   downloadInfo.setAutoResume(autoResume);
   downloadInfo.setFileName(fileName);
   downloadInfo.setFileTmpPath(tmpApkPath);
   downloadInfo.setFileSavePath(apkPath);
   downloadInfo.setPkg(pkg);
   downloadInfo.setVersionCode(versionCode);
   downloadInfo.setAutoRenameTmp(true);
   HttpUtils http = new HttpUtils();
   http.configRequestThreadPoolSize(maxDownloadThread);
   HttpHandler<File> handler =
       http.download(url, tmpApkPath, autoResume, new ManagerCallBack(downloadInfo, callback));
   downloadInfo.setHandler(handler);
   downloadInfo.setState(handler.getState());
   downloadInfoList.add(downloadInfo);
   db.saveBindingId(downloadInfo);
 }
 public void addNewDownload(
     String url,
     String fileName,
     String target,
     boolean autoResume,
     boolean autoRename,
     final RequestCallBack<File> callback)
     throws Exception {
   final DownloadInfo downloadInfo = new DownloadInfo();
   downloadInfo.setDownloadUrl(url);
   downloadInfo.setAutoRename(autoRename);
   downloadInfo.setAutoResume(autoResume);
   downloadInfo.setFileName(fileName);
   downloadInfo.setFileSavePath(target);
   downloadInfo.setId(mCount.getAndIncrement());
   HttpUtils http = new HttpUtils();
   //        http.configRequestThreadPoolSize(maxDownloadThread);
   HttpHandler<File> handler =
       http.download(
           url, target, autoResume, autoRename, new ManagerCallBack(downloadInfo, callback));
   downloadInfo.setHandler(handler);
   downloadInfo.setState(handler.getState());
   downloadInfoList.add(downloadInfo);
   infoImpl.insert(downloadInfo);
 }