Skip to content

Commit

Permalink
Add surfacesInfo property to WearDataLayerAppHelper (#1880)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizgrp authored Dec 15, 2023
1 parent 2052438 commit 0b30929
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datalayer/watch/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.google.android.horologist.datalayer.watch {

@com.google.android.horologist.annotations.ExperimentalHorologistApi public final class WearDataLayerAppHelper extends com.google.android.horologist.data.apphelper.DataLayerAppHelper {
ctor public WearDataLayerAppHelper(android.content.Context context, com.google.android.horologist.data.WearDataLayerRegistry registry, kotlinx.coroutines.CoroutineScope scope, optional String? appStoreUri);
method public kotlinx.coroutines.flow.Flow<com.google.android.horologist.data.SurfacesInfo> getSurfacesInfo();
method public suspend Object? installOnNode(String node, kotlin.coroutines.Continuation<? super kotlin.Unit>);
method public suspend Object? markActivityLaunchedOnce(kotlin.coroutines.Continuation<? super kotlin.Unit>);
method public suspend Object? markComplicationAsActivated(String complicationName, int complicationInstanceId, androidx.wear.watchface.complications.data.ComplicationType complicationType, kotlin.coroutines.Continuation<? super kotlin.Unit>);
Expand All @@ -12,6 +13,7 @@ package com.google.android.horologist.datalayer.watch {
method public suspend Object? markTileAsInstalled(String tileName, kotlin.coroutines.Continuation<? super kotlin.Unit>);
method public suspend Object? markTileAsRemoved(String tileName, kotlin.coroutines.Continuation<? super kotlin.Unit>);
method @CheckResult public suspend Object? startCompanion(String node, kotlin.coroutines.Continuation<? super com.google.android.horologist.data.AppHelperResultCode>);
property public final kotlinx.coroutines.flow.Flow<com.google.android.horologist.data.SurfacesInfo> surfacesInfo;
}

public final class WearDataLayerAppHelperKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.wear.watchface.complications.data.ComplicationType
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.data.AppHelperResultCode
import com.google.android.horologist.data.ComplicationInfo
import com.google.android.horologist.data.SurfacesInfo
import com.google.android.horologist.data.TileInfo
import com.google.android.horologist.data.UsageStatus
import com.google.android.horologist.data.WearDataLayerRegistry
Expand All @@ -39,6 +40,7 @@ import com.google.android.horologist.data.tileInfo
import com.google.android.horologist.data.usageInfo
import com.google.protobuf.Timestamp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.guava.await
import kotlinx.coroutines.tasks.await

Expand All @@ -64,6 +66,11 @@ public class WearDataLayerAppHelper(
)
}

/**
* Return the [SurfacesInfo] of this node.
*/
public val surfacesInfo: Flow<SurfacesInfo> = surfacesInfoDataStore.data

override suspend fun installOnNode(node: String) {
checkIsForegroundOrThrow()
if (appStoreUri != null &&
Expand Down

0 comments on commit 0b30929

Please sign in to comment.