This repository was archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathTelemetryAction.kt
More file actions
98 lines (91 loc) · 2.11 KB
/
Copy pathTelemetryAction.kt
File metadata and controls
98 lines (91 loc) · 2.11 KB
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
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package mozilla.lockbox.action
import mozilla.lockbox.flux.Action
import org.mozilla.telemetry.event.TelemetryEvent
interface TelemetryAction : Action {
val eventMethod: TelemetryEventMethod
val eventObject: TelemetryEventObject
val value: String?
get() = null
val extras: Map<String, Any>?
get() = null
fun createEvent(category: String = "action"): TelemetryEvent {
val evt = TelemetryEvent.create(
category,
eventMethod.name,
eventObject.name,
value
)
extras?.forEach { ex -> evt.extra(ex.key, ex.value.toString()) }
return evt
}
}
enum class TelemetryEventMethod {
tap,
startup,
foreground,
background,
setting_changed,
show,
autofill_locked,
lock,
unlock,
reset,
sync_start,
sync_end,
sync_error,
list_update,
list_update_error,
touch,
update_credentials,
delete,
edit,
autofill_single,
autofill_multiple,
autofill_cancel,
autofill_error,
autofill_filter,
autofill_add,
}
enum class TelemetryEventObject {
app,
entry_list,
entry_detail,
learn_more,
reveal_password,
entry_copy_username_button,
entry_copy_password_button,
onboarding_fingerprint,
onboarding_autofill,
settings_list,
settings_autolock_time,
settings_autolock,
settings_reset,
settings_record_usage_data,
settings_use_local_service,
settings_account,
settings_faq,
settings_provide_feedback,
settings_system,
settings_fingerprint,
settings_fingerprint_pending_auth,
settings_item_list_order,
settings_autofill,
login_welcome,
login_fxa,
login_onboarding_confirmation,
autofill,
lock_screen,
open_in_browser,
filter,
back,
dialog,
datastore,
delete_credential,
edit_entry_detail,
update_credential
}