-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUMM-2076 Add the Configuration#setVitalsMonitorUpdateFrequency API
- Loading branch information
Showing
9 changed files
with
302 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...k-android/src/main/kotlin/com/datadog/android/core/configuration/VitalsUpdateFrequency.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.core.configuration | ||
|
||
/** | ||
* Defines the frequency at which mobile vitals monitor updates the data. | ||
*/ | ||
enum class VitalsUpdateFrequency( | ||
internal val periodInMs: Long | ||
) { | ||
|
||
/** Every 100 milliseconds. */ | ||
FREQUENT(100L), | ||
|
||
/** Every 500 milliseconds. This is the default frequency. */ | ||
AVERAGE(500L), | ||
|
||
/** Every 1000 milliseconds. */ | ||
RARE(1000L), | ||
|
||
/** No data will be sent for mobile vitals. */ | ||
NEVER(0) | ||
} |
106 changes: 106 additions & 0 deletions
106
.../src/main/kotlin/com/datadog/android/core/internal/thread/NoOpScheduledExecutorService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2016-Present Datadog, Inc. | ||
*/ | ||
|
||
package com.datadog.android.core.internal.thread | ||
|
||
import java.util.concurrent.Callable | ||
import java.util.concurrent.Future | ||
import java.util.concurrent.ScheduledExecutorService | ||
import java.util.concurrent.ScheduledFuture | ||
import java.util.concurrent.TimeUnit | ||
|
||
internal class NoOpScheduledExecutorService : ScheduledExecutorService { | ||
override fun execute(command: Runnable?) { | ||
// No-op | ||
} | ||
|
||
override fun shutdown() { | ||
// No-op | ||
} | ||
|
||
override fun shutdownNow(): MutableList<Runnable>? { | ||
return null | ||
} | ||
|
||
override fun isShutdown(): Boolean { | ||
return false | ||
} | ||
|
||
override fun isTerminated(): Boolean { | ||
return false | ||
} | ||
|
||
override fun awaitTermination(timeout: Long, unit: TimeUnit?): Boolean { | ||
return false | ||
} | ||
|
||
override fun <T : Any?> submit(task: Callable<T>?): Future<T>? { | ||
return null | ||
} | ||
|
||
override fun <T : Any?> submit(task: Runnable?, result: T): Future<T>? { | ||
return null | ||
} | ||
|
||
override fun submit(task: Runnable?): Future<*>? { | ||
return null | ||
} | ||
|
||
override fun <T : Any?> invokeAll(tasks: MutableCollection<out Callable<T>>?): | ||
MutableList<Future<T>>? { | ||
return null | ||
} | ||
|
||
override fun <T : Any?> invokeAll( | ||
tasks: MutableCollection<out Callable<T>>?, | ||
timeout: Long, | ||
unit: TimeUnit? | ||
): MutableList<Future<T>>? { | ||
return null | ||
} | ||
|
||
override fun <T : Any?> invokeAny(tasks: MutableCollection<out Callable<T>>?): T? { | ||
return null | ||
} | ||
|
||
override fun <T : Any?> invokeAny( | ||
tasks: MutableCollection<out Callable<T>>?, | ||
timeout: Long, | ||
unit: TimeUnit? | ||
): T? { | ||
return null | ||
} | ||
|
||
override fun schedule(command: Runnable?, delay: Long, unit: TimeUnit?): ScheduledFuture<*>? { | ||
return null | ||
} | ||
|
||
override fun <V : Any?> schedule( | ||
callable: Callable<V>?, | ||
delay: Long, | ||
unit: TimeUnit? | ||
): ScheduledFuture<V>? { | ||
return null | ||
} | ||
|
||
override fun scheduleAtFixedRate( | ||
command: Runnable?, | ||
initialDelay: Long, | ||
period: Long, | ||
unit: TimeUnit? | ||
): ScheduledFuture<*>? { | ||
return null | ||
} | ||
|
||
override fun scheduleWithFixedDelay( | ||
command: Runnable?, | ||
initialDelay: Long, | ||
delay: Long, | ||
unit: TimeUnit? | ||
): ScheduledFuture<*>? { | ||
return null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.