Commit 9b243c4c authored by maxiaoliang's avatar maxiaoliang

修改更新

parent 013d5b1e
...@@ -99,23 +99,25 @@ class UpdateVersionManager : UpdateVersionContract.View, View.OnClickListener { ...@@ -99,23 +99,25 @@ class UpdateVersionManager : UpdateVersionContract.View, View.OnClickListener {
override fun onDownloadComplete(path: String) { override fun onDownloadComplete(path: String) {
mPresenter.unsubscribe() mPresenter.unsubscribe()
mDownloadDialog?.dismiss() mDownloadDialog?.dismiss()
Log.e("MXL","下载完成") // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // var hasInstallPermission = isHasInstallPermissionWithO(mActivity)
var hasInstallPermission = isHasInstallPermissionWithO(mActivity) // if (!hasInstallPermission) {
if (!hasInstallPermission) { // startInstallPermissionSettingActivity(mActivity)
startInstallPermissionSettingActivity(mActivity) // } else {
} else { // val dManager =
val dManager = // AppContext.get().getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
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()) var downloadFileUri = dManager.getUriForDownloadedFile(path.toLong())
OpenFiles.openFile(getRealFilePath(AppContext.get(), downloadFileUri)) 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))
}
} }
......
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