Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Rename platform device trash file info

Priyanshu Dangare43ee7757f77d
diff --git a/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/devicetrash/DeviceTrashChannelAdapter.kt b/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/devicetrash/DeviceTrashChannelAdapter.kt
deleted file mode 100644
index 2e3013bf9b..0000000000
--- a/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/devicetrash/DeviceTrashChannelAdapter.kt
+++ /dev/null
@@ -1,44 +0,0 @@
-package io.ente.photos.platform.devicetrash
-
-import android.os.Handler
-import android.os.Looper
-import io.flutter.plugin.common.MethodChannel
-import java.util.concurrent.Executors
-
-class DeviceTrashChannelAdapter(private val service: DeviceTrashService) {
- private val mainHandler = Handler(Looper.getMainLooper())
- private val executor = Executors.newSingleThreadExecutor()
-
- @Volatile
- private var closed = false
-
- fun getFiles(result: MethodChannel.Result) {
- executor.execute {
- try {
- val files = service.getFiles().map { it.toChannelTuple() }
- mainHandler.post {
- if (!closed) result.success(files)
- }
- } catch (error: Exception) {
- mainHandler.post {
- if (!closed) {
- result.error(
- "media_store_query_failed",
- error.message,
- null,
- )
- }
- }
- }
- }
- }
-
- fun close() {
- closed = true
- mainHandler.removeCallbacksAndMessages(null)
- executor.shutdownNow()
- }
-
- private fun DeviceTrashFile.toChannelTuple(): List<Any> =
- listOf(localID, deleteBy, deviceFolder)
-}