[components] Add check to ensure Glean is only initialized on the main process.
commitf033ec8f416671216212f3eae1185aa2faa2ab24
authorTravis Long <tlong@mozilla.com>
Mon, 10 Jun 2019 13:09:51 +0000 (10 08:09 -0500)
committerTravis Long <tlong@mozilla.com>
Mon, 10 Jun 2019 14:07:35 +0000 (10 09:07 -0500)
tree02d76f0efc7186329505078ee19e3eb3eb812543
parentcfcec95e0f34f08a00463b73d46fdfed6d30a86a
[components] Add check to ensure Glean is only initialized on the main process.

Trying to initialize Glean on a process other than the main process results in an error when Glean tries to use WorkManager because WorkManager is only initialized on the main process.  This checks whether initialize is being called by the main process and returns if it isn't.
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/Glean.kt