Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
30c5b41d
Commit
30c5b41d
authored
Feb 13, 2020
by
Jonathan Almeida
Browse files
Closes #5929: Emit facts during migration
parent
feddd369
Changes
4
Hide whitespace changes
Inline
Side-by-side
components/support/migration/src/main/java/mozilla/components/support/migration/AbstractMigrationService.kt
View file @
30c5b41d
...
...
@@ -83,6 +83,8 @@ abstract class AbstractMigrationService : Service() {
private
fun
shutdown
()
{
store
.
dispatch
(
MigrationAction
.
Completed
)
emitCompletedFact
()
stopForeground
(
true
)
showMigrationCompleteNotification
()
...
...
components/support/migration/src/main/java/mozilla/components/support/migration/FennecMigrator.kt
View file @
30c5b41d
...
...
@@ -551,6 +551,8 @@ class FennecMigrator private constructor(
store
.
dispatch
(
MigrationAction
.
Started
).
join
()
}
ContextCompat
.
startForegroundService
(
context
,
Intent
(
context
,
service
))
emitStartedFact
()
}
private
fun
getMigrationsToRun
():
List
<
VersionedMigration
>
{
...
...
components/support/migration/src/main/java/mozilla/components/support/migration/MigrationFacts.kt
0 → 100644
View file @
30c5b41d
/* 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.components.support.migration
import
mozilla.components.support.base.Component
import
mozilla.components.support.base.facts.Action
import
mozilla.components.support.base.facts.Fact
import
mozilla.components.support.base.facts.collect
/**
* Facts emitted for telemetry related to migration.
*/
class
MigrationFacts
{
/**
* Items that specify which portion of the migration was invoked.
*/
object
Items
{
const
val
MIGRATION_COMPLETED
=
"migration_completed"
const
val
MIGRATION_STARTED
=
"migration_started"
}
}
private
fun
emitMigrationFact
(
action
:
Action
,
item
:
String
)
{
Fact
(
Component
.
SUPPORT_MIGRATION
,
action
,
item
).
collect
()
}
internal
fun
emitCompletedFact
()
=
emitMigrationFact
(
Action
.
INTERACTION
,
MigrationFacts
.
Items
.
MIGRATION_COMPLETED
)
internal
fun
emitStartedFact
()
=
emitMigrationFact
(
Action
.
INTERACTION
,
MigrationFacts
.
Items
.
MIGRATION_STARTED
)
docs/changelog.md
View file @
30c5b41d
...
...
@@ -72,6 +72,9 @@ permalink: /changelog/
*
**feature-awesomebar**
*
Added
`showDescription`
parameter (default to
`true`
) to
`SearchSuggestionProvider`
constructors to add the possibility of removing search suggestion description.
*
**support-migration**
*
Emit facts during migration.
# 31.0.0
*
[
Commits
](
https://github.com/mozilla-mobile/android-components/compare/v30.0.0...v31.0.0
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment