• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash-android / 10078382463

24 Jul 2024 02:16PM CUT coverage: 80.724% (+4.2%) from 76.546%
10078382463

Pull #66

github

web-flow
Merge 5528c7c11 into 812f882d3
Pull Request #66: chore: several test cases in 3 commits

202 of 280 branches covered (72.14%)

Branch coverage included in aggregate %.

7 of 7 new or added lines in 2 files covered. (100.0%)

623 of 742 relevant lines covered (83.96%)

5.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/unleashandroidsdk/src/main/java/io/getunleash/android/Unleash.kt
1
package io.getunleash.android
2

3
import io.getunleash.android.data.UnleashContext
4
import io.getunleash.android.data.Variant
5
import io.getunleash.android.events.UnleashListener
6
import java.io.Closeable
7

8
val disabledVariant = Variant("disabled")
13✔
9

10
interface Unleash: Closeable {
11
    fun isEnabled(toggleName: String, defaultValue: Boolean = false): Boolean
10✔
12

13
    fun getVariant(toggleName: String, defaultValue: Variant = disabledVariant): Variant
10✔
14

15
    /**
16
     * Set context and trigger a fetch of the latest toggles immediately and block until the fetch is complete or failed.
17
     */
18
    fun setContext(context: UnleashContext)
19

20
    /**
21
     * Set context and trigger a fetch of the latest toggles asynchronously
22
     */
23
    fun setContextWithTimeout(context: UnleashContext, timeout: Long = 5000)
×
24

25
    /**
26
     * Set context and trigger a fetch of the latest toggles asynchronously
27
     */
28
    fun setContextAsync(context: UnleashContext)
29

30
    fun addUnleashEventListener(listener: UnleashListener)
31

32
    /**
33
     * This function forces a refresh of the toggles from the server and wait until the refresh is complete or failed.
34
     * Usually, this is done automatically in the background, but you can call this function to force a refresh.
35
     */
36
    fun refreshTogglesNow()
37

38
    /**
39
     * This function forces a refresh of the toggles from the server asynchronously using the IO dispatcher.
40
     * Usually, this is done automatically in the background, but you can call this function to force a refresh.
41
     */
42
    fun refreshTogglesNowAsync()
43

44
    /**
45
     * This function forces send metrics to the server and wait until the send is complete or failed.
46
     * Usually, this is done automatically in the background, but you can call this function to force a send.
47
     */
48
    fun sendMetricsNow()
49

50
    /**
51
     * This function forces send metrics to the server asynchronously using the IO dispatcher.
52
     * Usually, this is done automatically in the background, but you can call this function to force a send.
53
     */
54
    fun sendMetricsNowAsync()
55

56
    fun isReady(): Boolean
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc