From ecd461018662e3e08fa891c8ed87463cf4b2f981 Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Mon, 2 Dec 2024 11:17:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8D=95=E6=8A=93=E7=A3=81=E7=9B=98?= =?UTF-8?q?=E5=B7=B2=E6=BB=A1=E6=97=B6=E4=B8=8B=E8=BD=BD=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=80=A0=E6=88=90=E7=9A=84=E9=97=AA=E9=80=80?= =?UTF-8?q?=20https://sentry.shanqu.cc/organizations/lightgame/issues/4188?= =?UTF-8?q?01/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/download/simple/DownloadMessageHandler.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/gh/download/simple/DownloadMessageHandler.kt b/app/src/main/java/com/gh/download/simple/DownloadMessageHandler.kt index 6a655b60a8..90eb63df69 100644 --- a/app/src/main/java/com/gh/download/simple/DownloadMessageHandler.kt +++ b/app/src/main/java/com/gh/download/simple/DownloadMessageHandler.kt @@ -2,6 +2,7 @@ package com.gh.download.simple import android.annotation.SuppressLint import android.database.sqlite.SQLiteException +import android.database.sqlite.SQLiteFullException import com.gh.gamecenter.core.utils.ToastUtils import com.lg.download.* import com.lg.download.listener.InnerDownloadListener @@ -264,8 +265,15 @@ object DownloadMessageHandler : InnerDownloadListener { } fun insertDownloadToDatabase(downloadEntity: SimpleDownloadEntity) { - mDownloadDao.insertDownloadEntity(downloadEntity) - updateDownloadList() + try { + mDownloadDao.insertDownloadEntity(downloadEntity) + updateDownloadList() + } catch (e: SQLiteException) { + if (e is SQLiteFullException) { + ToastUtils.showToast("磁盘已满,请清理空间后获得更好的体验") + } + e.printStackTrace() + } } fun updateDownloadToDatabase(