From b4500ef4d70ed1afc1b828906c853dd6cba17cde Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 8 Aug 2024 15:26:14 +0530 Subject: [PATCH] [mob][photos] Workaround for android 10 free up space issue Workaround for deletedIDs being empty on android 10 --- mobile/lib/utils/delete_file_util.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mobile/lib/utils/delete_file_util.dart b/mobile/lib/utils/delete_file_util.dart index 545ea9c27a..2121a748b9 100644 --- a/mobile/lib/utils/delete_file_util.dart +++ b/mobile/lib/utils/delete_file_util.dart @@ -373,8 +373,14 @@ Future deleteLocalFiles( ); return true; } else { - showToast(context, S.of(context).couldNotFreeUpSpace); - return false; + //On android 10, even if files were deleted, deletedIDs is empty. + //This is a workaround so that users are not shown an error message on + //android 10 + if (!await isAndroidSDKVersionLowerThan(android11SDKINT)) { + showToast(context, S.of(context).couldNotFreeUpSpace); + return false; + } + return true; } }