fix: 处理存储空间满了后的闪退问题

This commit is contained in:
chenjuntao
2023-06-20 15:25:54 +08:00
parent 51f5ea1cd9
commit 6749d94c34
2 changed files with 11 additions and 4 deletions

View File

@ -815,10 +815,19 @@ object VHelper {
val downloadEntity = getVDownloadEntity(gameId = gameId, packageName = packageName)
if (downloadEntity != null) {
// 去掉更新标记
downloadEntity.isUpdate = false
mVGameDao.insert(VGameEntity.from(downloadEntity))
mInstallingVaPathSet.remove(downloadEntity.path)
try {
mVGameDao.insert(VGameEntity.from(downloadEntity))
} catch (e: SQLiteFullException) {
ToastUtils.toast("存储空间不足,安装失败")
return@runOnIoThread
}
if (result.status == 0) {
updateInstalledList()
@ -836,8 +845,6 @@ object VHelper {
ToastUtils.toast("安装出现异常, ${result.status}")
}
mInstallingVaPathSet.remove(downloadEntity.path)
mPackageInstalledLiveData.postValue(result.packageName)
VBackupHelper.backupDBToExternalStorage(HaloApp.getInstance())