From 290a93a5f5d90b85122416ff060aeaac9cd40130 Mon Sep 17 00:00:00 2001 From: Maciej Korzeniewski Date: Mon, 9 Dec 2024 07:40:33 +0200 Subject: [PATCH] Do not use blockingGet to save backup files #517 --- .../src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt | 8 ++++---- .../java/com/polar/sdk/impl/utils/PolarBackupManager.kt | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt b/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt index 579b63b2..0dbfb6f0 100644 --- a/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt +++ b/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt @@ -1963,6 +1963,10 @@ class BDBleApiImpl private constructor(context: Context, features: Set @@ -2048,10 +2052,6 @@ class BDBleApiImpl private constructor(context: Context, features: Set> { + BleLogger.d(TAG, "Backing up device") + return Single.fromCallable { + BleLogger.d(TAG, "Requesting backup content") + val builder = PftpRequest.PbPFtpOperation.newBuilder() builder.command = PftpRequest.PbPFtpOperation.Command.GET builder.path = ARABICA_SYS_FOLDER @@ -111,6 +115,8 @@ class PolarBackupManager(private val client: BlePsFtpClient) { }.onErrorReturn { BleLogger.e(TAG, "Failed to get backup content, error: $it") emptyList() + }.doOnSuccess { backupFiles -> + BleLogger.d(TAG, "Backup completed, files backed up: ${backupFiles.size}") } }