Mark the constructor of HealthEvent.Type @RestrictTo
Relnote: N/A
Test: ./gradlew :health:health-services-client:test
Bug: 314216477
Fix: 314216477
Change-Id: I335ed272112c55b7c8cd31f5bba289c96359efd3
diff --git a/health/health-services-client/src/main/java/androidx/health/services/client/data/HealthEvent.kt b/health/health-services-client/src/main/java/androidx/health/services/client/data/HealthEvent.kt
index bcf82b4..5c2b868 100644
--- a/health/health-services-client/src/main/java/androidx/health/services/client/data/HealthEvent.kt
+++ b/health/health-services-client/src/main/java/androidx/health/services/client/data/HealthEvent.kt
@@ -16,6 +16,8 @@
package androidx.health.services.client.data
+import androidx.annotation.RestrictTo
+import androidx.annotation.RestrictTo.Scope
import androidx.health.services.client.proto.DataProto
import androidx.health.services.client.proto.DataProto.HealthEvent.MetricsEntry
import java.time.Instant
@@ -33,7 +35,13 @@
) {
/** Health event types. */
- public class Type private constructor(public val id: Int, public val name: String) {
+ public class Type @RestrictTo(Scope.LIBRARY) constructor(
+ /** Returns a unique identifier for the [Type], as an `int`. */
+ public val id: Int,
+
+ /** Returns a human readable name to represent this [Type]. */
+ public val name: String
+ ) {
override fun equals(other: Any?): Boolean {
if (this === other) return true