-
Notifications
You must be signed in to change notification settings - Fork 7
/
FakeBreadcrumbService.kt
99 lines (80 loc) · 2.48 KB
/
FakeBreadcrumbService.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package io.embrace.android.embracesdk
import android.util.Pair
import io.embrace.android.embracesdk.capture.crumbs.BreadcrumbService
import io.embrace.android.embracesdk.payload.Breadcrumbs
import io.embrace.android.embracesdk.payload.PushNotificationBreadcrumb
import io.embrace.android.embracesdk.payload.TapBreadcrumb
internal class FakeBreadcrumbService : BreadcrumbService {
val logViewCalls = mutableListOf<String?>()
val pushNotifications = mutableListOf<PushNotificationBreadcrumb>()
var flushCount: Int = 0
override fun getBreadcrumbs(): Breadcrumbs {
return Breadcrumbs()
}
override fun flushBreadcrumbs(): Breadcrumbs {
flushCount++
return Breadcrumbs()
}
override fun logView(screen: String?, timestamp: Long) {
}
override fun forceLogView(screen: String?, timestamp: Long) {
logViewCalls.add(screen)
}
override fun replaceFirstSessionView(screen: String, timestamp: Long) {
}
override fun startView(name: String?): Boolean {
return false
}
override fun endView(name: String?): Boolean {
return false
}
override fun logTap(
point: Pair<Float?, Float?>,
element: String,
timestamp: Long,
type: TapBreadcrumb.TapBreadcrumbType
) {
}
override fun logCustom(message: String, timestamp: Long) {
}
override fun logRnAction(
name: String,
startTime: Long,
endTime: Long,
properties: Map<String?, Any?>,
bytesSent: Int,
output: String
) {
}
override fun logWebView(url: String?, startTime: Long) {
}
var viewBreadcrumbScreenName: String? = null
override fun getLastViewBreadcrumbScreenName(): String? {
return viewBreadcrumbScreenName
}
override fun logPushNotification(
title: String?,
body: String?,
topic: String?,
id: String?,
notificationPriority: Int?,
messageDeliveredPriority: Int,
type: PushNotificationBreadcrumb.NotificationType
) {
pushNotifications.add(
PushNotificationBreadcrumb(
title,
body,
topic,
id,
notificationPriority,
type.type,
0L
)
)
}
val firstViewBreadcrumbCalls = mutableListOf<Long>()
override fun addFirstViewBreadcrumbForSession(startTime: Long) {
firstViewBreadcrumbCalls.add(startTime)
}
}