Commit 9b243c4c authored by maxiaoliang's avatar maxiaoliang

修改更新

parent 013d5b1e
......@@ -99,23 +99,25 @@ class UpdateVersionManager : UpdateVersionContract.View, View.OnClickListener {
override fun onDownloadComplete(path: String) {
mPresenter.unsubscribe()
mDownloadDialog?.dismiss()
Log.e("MXL","下载完成")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
var hasInstallPermission = isHasInstallPermissionWithO(mActivity)
if (!hasInstallPermission) {
startInstallPermissionSettingActivity(mActivity)
} else {
val dManager =
AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri))
}
} else {
val dManager =
AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri))
}
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// var hasInstallPermission = isHasInstallPermissionWithO(mActivity)
// if (!hasInstallPermission) {
// startInstallPermissionSettingActivity(mActivity)
// } else {
// val dManager =
// AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
// var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
// OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri))
// }
// } else {
// val dManager =
// AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
// var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
// OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri))
// }
val dManager = AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment