-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix build when metrics disabled (#989)
**Background** Android Project can't be build with disabled metrics due to it's inject in SingleActivity #988 **Changes** - Add NoOp for AndroiMetricsApi **Test plan** - Assemble project with disabled metrics
- Loading branch information
1 parent
ee075be
commit c879b21
Showing
2 changed files
with
21 additions
and
0 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
19 changes: 19 additions & 0 deletions
19
...tics/metric/noop/src/main/java/com/flipperdevices/metric/noop/NoopMetricAndroidApiImpl.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,19 @@ | ||
package com.flipperdevices.metric.noop | ||
|
||
import com.flipperdevices.core.di.AppGraph | ||
import com.flipperdevices.metric.api.MetricAndroidApi | ||
import com.flipperdevices.metric.api.MetricApi | ||
import com.flipperdevices.metric.api.events.ComplexEvent | ||
import com.flipperdevices.metric.api.events.SessionState | ||
import com.flipperdevices.metric.api.events.SimpleEvent | ||
import com.squareup.anvil.annotations.ContributesBinding | ||
import javax.inject.Inject | ||
|
||
@ContributesBinding(AppGraph::class, MetricAndroidApi::class) | ||
class NoopMetricAndroidApiImpl @Inject constructor() : MetricApi, MetricAndroidApi { | ||
override fun reportSessionState(state: SessionState) = Unit | ||
|
||
override fun reportSimpleEvent(simpleEvent: SimpleEvent, arg: String?) = Unit | ||
|
||
override fun reportComplexEvent(complexEvent: ComplexEvent) = Unit | ||
} |