Skip to content

Commit

Permalink
Remove AppInstallationStatusNodeType.UNKNOWN (google#2073)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizgrp authored and kul3r4 committed Feb 29, 2024
1 parent bce638a commit 268fad5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion datalayer/core/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ package com.google.android.horologist.data.apphelper {
method public static com.google.android.horologist.data.apphelper.AppInstallationStatusNodeType valueOf(String value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException;
method public static com.google.android.horologist.data.apphelper.AppInstallationStatusNodeType[] values();
enum_constant public static final com.google.android.horologist.data.apphelper.AppInstallationStatusNodeType PHONE;
enum_constant public static final com.google.android.horologist.data.apphelper.AppInstallationStatusNodeType UNKNOWN;
enum_constant public static final com.google.android.horologist.data.apphelper.AppInstallationStatusNodeType WATCH;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ public sealed class AppInstallationStatus {
public enum class AppInstallationStatusNodeType {
WATCH,
PHONE,

/**
* This case should not happen, but it's here in order to keep the node listed even in a
* scenario where there were issues retrieving the capability of the node.
*/
UNKNOWN,
}

public val AppHelperNodeStatus.appInstalled: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ abstract class DataLayerAppHelper(
val appInstallationStatus = if (allInstalledNodes.contains(it.id)) {
val nodeType = when (it.id) {
in installedPhoneNodes -> AppInstallationStatusNodeType.PHONE
in installedWatchNodes -> AppInstallationStatusNodeType.WATCH
else -> AppInstallationStatusNodeType.UNKNOWN
else -> AppInstallationStatusNodeType.WATCH
}
AppInstallationStatus.Installed(nodeType = nodeType)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class NodesActionViewModel
when (status.nodeType) {
AppInstallationStatusNodeType.WATCH -> NodeTypeUiModel.WATCH
AppInstallationStatusNodeType.PHONE -> NodeTypeUiModel.PHONE
AppInstallationStatusNodeType.UNKNOWN -> NodeTypeUiModel.UNKNOWN
}
}
AppInstallationStatus.NotInstalled -> NodeTypeUiModel.UNKNOWN
Expand Down

0 comments on commit 268fad5

Please sign in to comment.