forked from mozilla-mobile/android-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tarik Eshaq
committed
Jul 23, 2020
1 parent
8e856ef
commit 2a55e46
Showing
17 changed files
with
102 additions
and
31 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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ plugins { | |
} | ||
|
||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
|
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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
17 changes: 17 additions & 0 deletions
17
components/service/glean/src/main/java/mozilla/components/service/glean/Experiments.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,17 @@ | ||
package mozilla.components.service.glean | ||
|
||
import android.content.Context | ||
import kotlinx.coroutines.* | ||
import mozilla.telemetry.glean.Experiments as ExperimentsCore | ||
|
||
object Experiments { | ||
private var inner: ExperimentsCore = ExperimentsCore | ||
private val job = SupervisorJob() | ||
private val scope = CoroutineScope(Dispatchers.IO) + job | ||
fun initialize(applicationContext: Context, dbPath: String) { | ||
inner.initialize(applicationContext, dbPath) | ||
} | ||
fun getBranch(experimentName: String): String { | ||
return inner.getBranch(experimentName) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
components/service/glean/src/main/java/mozilla/components/service/glean/HttpConfig.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,24 @@ | ||
package mozilla.components.service.glean | ||
|
||
|
||
import mozilla.components.concept.fetch.Client | ||
import mozilla.telemetry.glean.RustHttpConfig as HttpConfig | ||
|
||
/** | ||
* An object allowing configuring the HTTP client used by Rust code. | ||
*/ | ||
object RustHttpConfig { | ||
|
||
/** | ||
* Set the HTTP client to be used by all Rust code. | ||
* | ||
* The `Lazy`'s value is not read until the first request is made. | ||
* | ||
* This must be called | ||
* - after initializing a megazord for users using a custom megazord build. | ||
* - before any other calls into application-services rust code which make HTTP requests. | ||
*/ | ||
fun setClient(c: Lazy<Client>) { | ||
HttpConfig.setClient(c) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "https://maven.mozilla.org/maven2" | ||
} | ||
|
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ import org.yaml.snakeyaml.Yaml | |
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
|