From 04f4b9804f10e4724bac22d40bf01711ff708533 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 26 Sep 2024 17:49:58 +0530 Subject: Revert "refactor: use `Closeable#use` extension where applicable" This reverts commit 69513bf24613d4ba540bcdeaffe04dc9330a65a4. --- .../java/app/passwordstore/util/services/PasswordExportService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt b/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt index c74c3f0e..854071f2 100644 --- a/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt +++ b/app/src/main/java/app/passwordstore/util/services/PasswordExportService.kt @@ -89,7 +89,10 @@ class PasswordExportService : Service() { val destOutputStream = contentResolver.openOutputStream(targetPasswordFile.uri) if (destOutputStream != null && sourceInputStream != null) { - sourceInputStream.use { source -> destOutputStream.use { dest -> source.copyTo(dest) } } + sourceInputStream.copyTo(destOutputStream, 1024) + + sourceInputStream.close() + destOutputStream.close() } } } -- cgit v1.2.3