Commit 5d67674f authored by Michael Droettboom's avatar Michael Droettboom
Browse files

1540844: Add RestrictTo(LIBRARY) annotation to public-not-public glean API

parent 10f84c8e
......@@ -6,6 +6,7 @@ package mozilla.components.service.glean.debug
import android.app.Activity
import android.os.Bundle
import android.support.annotation.RestrictTo
import mozilla.components.service.glean.Glean
import mozilla.components.support.base.log.logger.Logger
......@@ -19,6 +20,7 @@ import mozilla.components.support.base.log.logger.Logger
* See the adb developer docs for more info:
* https://developer.android.com/studio/command-line/adb#am
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
class GleanDebugActivity : Activity() {
private val logger = Logger("glean/GleanDebugActivity")
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.BooleansStorageEngine
......@@ -17,6 +18,7 @@ import mozilla.components.support.base.log.logger.Logger
*
* The boolean API only exposes the [set] method.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class BooleanMetricType(
override val disabled: Boolean,
override val category: String,
......@@ -34,6 +36,7 @@ data class BooleanMetricType(
*
* @param value This is a user defined boolean value.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
fun set(value: Boolean) {
if (!shouldRecord(logger)) {
return
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import mozilla.components.service.glean.Glean
import mozilla.components.support.base.log.logger.Logger
......@@ -29,6 +30,7 @@ enum class Lifetime {
* This defines the common set of data shared across all the different
* metric types.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
interface CommonMetricData {
val disabled: Boolean
val category: String
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.CountersStorageEngine
......@@ -18,6 +19,7 @@ import mozilla.components.support.base.log.logger.Logger
* The counter API only exposes the [add] method, which takes care of validating the input
* data and making sure that limits are enforced.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class CounterMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.DatetimesStorageEngine
......@@ -18,6 +19,7 @@ import java.util.Date
* Instances of this class type are automatically generated by the parsers at build time,
* allowing developers to record values that were previously registered in the metrics.yaml file.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class DatetimeMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -5,6 +5,7 @@
package mozilla.components.service.glean.private
import android.os.SystemClock
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.EventsStorageEngine
......@@ -16,6 +17,7 @@ import mozilla.components.support.base.log.logger.Logger
* that an [EventMetricType] can accept.
*/
@Suppress("EmptyClassBlock")
@RestrictTo(RestrictTo.Scope.LIBRARY)
enum class NoExtraKeys(val value: Int) {
// deliberately empty
}
......@@ -29,6 +31,7 @@ enum class NoExtraKeys(val value: Int) {
* The Events API only exposes the [record] method, which takes care of validating the input
* data and making sure that limits are enforced.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class EventMetricType<ExtraKeysEnum : Enum<ExtraKeysEnum>>(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import mozilla.components.service.glean.storages.StorageEngine
import mozilla.components.service.glean.storages.StorageEngineManager
import mozilla.components.service.glean.error.ErrorRecording.ErrorType
......@@ -22,7 +23,7 @@ import mozilla.components.support.base.log.logger.Logger
* The |StorageEngineManager.collect| method knows how to pull these special values back out of the
* individual storage engines and rearrange them correctly in the ping.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class LabeledMetricType<T>(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.StringListsStorageEngine
......@@ -18,6 +19,7 @@ import mozilla.components.support.base.log.logger.Logger
* The string list API exposes the [add] and [set] methods, which take care of validating the input
* data and making sure that limits are enforced.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class StringListMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.StringsStorageEngine
......@@ -18,6 +19,7 @@ import mozilla.components.support.base.log.logger.Logger
* The string API only exposes the [set] method, which takes care of validating the input
* data and making sure that limits are enforced.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class StringMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.storages.TimespansStorageEngine
import mozilla.components.support.base.log.logger.Logger
......@@ -16,6 +17,7 @@ import mozilla.components.support.base.log.logger.Logger
*
* The timespans API exposes the [start], [stopAndSum] and [cancel] methods.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class TimespanMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import mozilla.components.service.glean.storages.TimingDistributionData
......@@ -19,6 +20,7 @@ import mozilla.components.support.base.log.logger.Logger
* The string list API exposes the [accumulate] method, which interacts with the storage engine to
* accumulate to the correct bucket.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class TimingDistributionMetricType(
override val disabled: Boolean,
override val category: String,
......
......@@ -4,6 +4,7 @@
package mozilla.components.service.glean.private
import android.support.annotation.RestrictTo
import android.support.annotation.VisibleForTesting
import mozilla.components.service.glean.Dispatchers
import java.util.UUID
......@@ -19,6 +20,7 @@ import mozilla.components.support.base.log.logger.Logger
*
* The uuid API exposes the [generateAndSet] and [set] methods.
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
data class UuidMetricType(
override val disabled: Boolean,
override val category: String,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment