From 20aa317514484508e1db26702a6da02908cbafaa Mon Sep 17 00:00:00 2001 From: Gustavo Pagani Date: Thu, 18 Jan 2024 17:16:59 +0000 Subject: [PATCH] Fix implementation of installOnNode for phones. --- .../datalayer/phone/PhoneDataLayerAppHelper.kt | 15 --------------- .../datalayer/watch/WearDataLayerAppHelper.kt | 2 ++ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/datalayer/phone/src/main/java/com/google/android/horologist/datalayer/phone/PhoneDataLayerAppHelper.kt b/datalayer/phone/src/main/java/com/google/android/horologist/datalayer/phone/PhoneDataLayerAppHelper.kt index cff52e3a45..68da62ae2a 100644 --- a/datalayer/phone/src/main/java/com/google/android/horologist/datalayer/phone/PhoneDataLayerAppHelper.kt +++ b/datalayer/phone/src/main/java/com/google/android/horologist/datalayer/phone/PhoneDataLayerAppHelper.kt @@ -27,7 +27,6 @@ import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.data.AppHelperResultCode import com.google.android.horologist.data.WearDataLayerRegistry import com.google.android.horologist.data.apphelper.DataLayerAppHelper -import kotlinx.coroutines.flow.first import kotlinx.coroutines.tasks.await /** @@ -47,20 +46,6 @@ public class PhoneDataLayerAppHelper( .addCategory(Intent.CATEGORY_BROWSABLE) .setData(Uri.parse(playStoreUri)) - val availabilityStatus = remoteActivityHelper.availabilityStatus.first() - - // As per documentation, calls should be made when status is either STATUS_AVAILABLE - // or STATUS_UNKNOWN. - when (availabilityStatus) { - RemoteActivityHelper.STATUS_UNAVAILABLE -> { - return AppHelperResultCode.APP_HELPER_RESULT_UNAVAILABLE - } - - RemoteActivityHelper.STATUS_TEMPORARILY_UNAVAILABLE -> { - return AppHelperResultCode.APP_HELPER_RESULT_TEMPORARILY_UNAVAILABLE - } - } - try { remoteActivityHelper.startRemoteActivity(intent, nodeId).await() } catch (e: RemoteActivityHelper.RemoteIntentException) { diff --git a/datalayer/watch/src/main/java/com/google/android/horologist/datalayer/watch/WearDataLayerAppHelper.kt b/datalayer/watch/src/main/java/com/google/android/horologist/datalayer/watch/WearDataLayerAppHelper.kt index fecb69e317..ea9d03960a 100644 --- a/datalayer/watch/src/main/java/com/google/android/horologist/datalayer/watch/WearDataLayerAppHelper.kt +++ b/datalayer/watch/src/main/java/com/google/android/horologist/datalayer/watch/WearDataLayerAppHelper.kt @@ -105,6 +105,8 @@ public class WearDataLayerAppHelper( val availabilityStatus = remoteActivityHelper.availabilityStatus.first() + // As per documentation, calls should be made when status is either STATUS_AVAILABLE + // or STATUS_UNKNOWN. when (availabilityStatus) { RemoteActivityHelper.STATUS_UNAVAILABLE -> { return AppHelperResultCode.APP_HELPER_RESULT_UNAVAILABLE