Browse Source

Simplify build variants to just: debug, nightly, beta and release.

Co-authored-by: Johan Lorenzo <jlorenzo@mozilla.com>
master
Sebastian Kaspari 1 year ago
parent
commit
c93a29f89a
100 changed files with 149 additions and 386 deletions
  1. +23
    -18
      README.md
  2. +30
    -91
      app/build.gradle
  3. +0
    -0
      app/src/beta/res/drawable-hdpi/fenix_search_widget.png
  4. +0
    -0
      app/src/beta/res/drawable-hdpi/ic_logo_wordmark_normal.png
  5. +0
    -0
      app/src/beta/res/drawable-hdpi/ic_logo_wordmark_private.png
  6. +0
    -0
      app/src/beta/res/drawable-mdpi/ic_logo_wordmark_normal.png
  7. +0
    -0
      app/src/beta/res/drawable-mdpi/ic_logo_wordmark_private.png
  8. +0
    -0
      app/src/beta/res/drawable-xhdpi/ic_logo_wordmark_normal.png
  9. +0
    -0
      app/src/beta/res/drawable-xhdpi/ic_logo_wordmark_private.png
  10. +0
    -0
      app/src/beta/res/drawable-xxhdpi/ic_logo_wordmark_normal.png
  11. +0
    -0
      app/src/beta/res/drawable-xxhdpi/ic_logo_wordmark_private.png
  12. +0
    -0
      app/src/beta/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png
  13. +0
    -0
      app/src/beta/res/drawable-xxxhdpi/ic_logo_wordmark_private.png
  14. +0
    -0
      app/src/beta/res/drawable/ic_launcher_foreground.xml
  15. +0
    -0
      app/src/beta/res/mipmap-hdpi/ic_launcher.png
  16. +0
    -0
      app/src/beta/res/mipmap-hdpi/ic_launcher_round.png
  17. +0
    -0
      app/src/beta/res/mipmap-mdpi/ic_launcher.png
  18. +0
    -0
      app/src/beta/res/mipmap-mdpi/ic_launcher_round.png
  19. +0
    -0
      app/src/beta/res/mipmap-xhdpi/ic_launcher.png
  20. +0
    -0
      app/src/beta/res/mipmap-xhdpi/ic_launcher_round.png
  21. +0
    -0
      app/src/beta/res/mipmap-xxhdpi/ic_launcher.png
  22. +0
    -0
      app/src/beta/res/mipmap-xxhdpi/ic_launcher_round.png
  23. +0
    -0
      app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png
  24. +0
    -0
      app/src/beta/res/mipmap-xxxhdpi/ic_launcher_round.png
  25. +0
    -0
      app/src/beta/res/values/colors.xml
  26. +0
    -0
      app/src/beta/res/values/static_strings.xml
  27. +0
    -0
      app/src/beta/res/xml/shortcuts.xml
  28. +0
    -66
      app/src/fenixBeta/res/drawable/ic_launcher_foreground.xml
  29. BIN
      app/src/fenixBeta/res/ic_launcher-web.png
  30. BIN
      app/src/fenixBeta/res/mipmap-hdpi/ic_launcher.png
  31. BIN
      app/src/fenixBeta/res/mipmap-hdpi/ic_launcher_round.png
  32. BIN
      app/src/fenixBeta/res/mipmap-mdpi/ic_launcher.png
  33. BIN
      app/src/fenixBeta/res/mipmap-mdpi/ic_launcher_round.png
  34. BIN
      app/src/fenixBeta/res/mipmap-xhdpi/ic_launcher.png
  35. BIN
      app/src/fenixBeta/res/mipmap-xhdpi/ic_launcher_round.png
  36. BIN
      app/src/fenixBeta/res/mipmap-xxhdpi/ic_launcher.png
  37. BIN
      app/src/fenixBeta/res/mipmap-xxhdpi/ic_launcher_round.png
  38. BIN
      app/src/fenixBeta/res/mipmap-xxxhdpi/ic_launcher.png
  39. BIN
      app/src/fenixBeta/res/mipmap-xxxhdpi/ic_launcher_round.png
  40. +0
    -29
      app/src/fenixBeta/res/xml/shortcuts.xml
  41. +0
    -25
      app/src/fenixNightly/res/drawable/ic_launcher_foreground.xml
  42. BIN
      app/src/fenixNightly/res/ic_launcher-web.png
  43. BIN
      app/src/fenixNightly/res/mipmap-hdpi/ic_launcher.png
  44. BIN
      app/src/fenixNightly/res/mipmap-hdpi/ic_launcher_round.png
  45. BIN
      app/src/fenixNightly/res/mipmap-mdpi/ic_launcher.png
  46. BIN
      app/src/fenixNightly/res/mipmap-mdpi/ic_launcher_round.png
  47. BIN
      app/src/fenixNightly/res/mipmap-xhdpi/ic_launcher.png
  48. BIN
      app/src/fenixNightly/res/mipmap-xhdpi/ic_launcher_round.png
  49. BIN
      app/src/fenixNightly/res/mipmap-xxhdpi/ic_launcher.png
  50. BIN
      app/src/fenixNightly/res/mipmap-xxhdpi/ic_launcher_round.png
  51. BIN
      app/src/fenixNightly/res/mipmap-xxxhdpi/ic_launcher.png
  52. BIN
      app/src/fenixNightly/res/mipmap-xxxhdpi/ic_launcher_round.png
  53. +0
    -29
      app/src/fenixNightly/res/xml/shortcuts.xml
  54. +0
    -18
      app/src/fenixProduction/AndroidManifest.xml
  55. +0
    -7
      app/src/fenixProduction/res/values/colors.xml
  56. +0
    -8
      app/src/fenixProduction/res/values/static_strings.xml
  57. +0
    -8
      app/src/fennecNightly/res/mipmap-anydpi-v26/ic_launcher.xml
  58. +0
    -8
      app/src/fennecNightly/res/mipmap-anydpi-v26/ic_launcher_round.xml
  59. BIN
      app/src/fennecNightly/res/mipmap-hdpi/ic_launcher.png
  60. BIN
      app/src/fennecNightly/res/mipmap-hdpi/ic_launcher_foreground_fennec_nightly.png
  61. BIN
      app/src/fennecNightly/res/mipmap-hdpi/ic_launcher_round.png
  62. BIN
      app/src/fennecNightly/res/mipmap-mdpi/ic_launcher.png
  63. BIN
      app/src/fennecNightly/res/mipmap-mdpi/ic_launcher_foreground_fennec_nightly.png
  64. BIN
      app/src/fennecNightly/res/mipmap-mdpi/ic_launcher_round.png
  65. BIN
      app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher.png
  66. BIN
      app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher_foreground_fennec_nightly.png
  67. BIN
      app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher_round.png
  68. BIN
      app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher.png
  69. BIN
      app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher_foreground_fennec_nightly.png
  70. BIN
      app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher_round.png
  71. BIN
      app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher.png
  72. BIN
      app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher_foreground_fennec_nightly.png
  73. BIN
      app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher_round.png
  74. +0
    -7
      app/src/fennecNightly/res/values/colors.xml
  75. +0
    -8
      app/src/fennecNightly/res/values/static_strings.xml
  76. +0
    -28
      app/src/fennecNightly/res/xml/shortcuts.xml
  77. +72
    -0
      app/src/geckoRelease/java/org/mozilla/fenix/engine/GeckoProvider.kt
  78. +21
    -33
      app/src/main/java/org/mozilla/fenix/Config.kt
  79. +3
    -3
      app/src/main/java/org/mozilla/fenix/components/Analytics.kt
  80. +0
    -0
      app/src/nightly/AndroidManifest.xml
  81. +0
    -0
      app/src/nightly/res/drawable-hdpi/ic_logo_wordmark_normal.png
  82. +0
    -0
      app/src/nightly/res/drawable-hdpi/ic_logo_wordmark_private.png
  83. +0
    -0
      app/src/nightly/res/drawable-mdpi/ic_logo_wordmark_normal.png
  84. +0
    -0
      app/src/nightly/res/drawable-mdpi/ic_logo_wordmark_private.png
  85. +0
    -0
      app/src/nightly/res/drawable-xhdpi/ic_logo_wordmark_normal.png
  86. +0
    -0
      app/src/nightly/res/drawable-xhdpi/ic_logo_wordmark_private.png
  87. +0
    -0
      app/src/nightly/res/drawable-xxhdpi/ic_logo_wordmark_normal.png
  88. +0
    -0
      app/src/nightly/res/drawable-xxhdpi/ic_logo_wordmark_private.png
  89. +0
    -0
      app/src/nightly/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png
  90. +0
    -0
      app/src/nightly/res/drawable-xxxhdpi/ic_logo_wordmark_private.png
  91. +0
    -0
      app/src/nightly/res/drawable/ic_launcher_foreground.xml
  92. +0
    -0
      app/src/nightly/res/ic_launcher-web.png
  93. +0
    -0
      app/src/nightly/res/mipmap-hdpi/ic_launcher.png
  94. +0
    -0
      app/src/nightly/res/mipmap-hdpi/ic_launcher_round.png
  95. +0
    -0
      app/src/nightly/res/mipmap-mdpi/ic_launcher.png
  96. +0
    -0
      app/src/nightly/res/mipmap-mdpi/ic_launcher_round.png
  97. +0
    -0
      app/src/nightly/res/mipmap-xhdpi/ic_launcher.png
  98. +0
    -0
      app/src/nightly/res/mipmap-xhdpi/ic_launcher_round.png
  99. +0
    -0
      app/src/nightly/res/mipmap-xxhdpi/ic_launcher.png
  100. +0
    -0
      app/src/nightly/res/mipmap-xxhdpi/ic_launcher_round.png

+ 23
- 18
README.md View File

@@ -81,10 +81,9 @@ Pre-requisites:
2. **Import** the project into Android Studio **or** build on the command line:

```shell
./gradlew clean app:assembleGeckoBetaDebug
./gradlew clean app:assembleDebug
```

Use app:assembleGeckoNightlyDebug to build with the Gecko Nightly version instead.
If this errors out, make sure that you have an `ANDROID_SDK_ROOT` environment
variable pointing to the right path.

@@ -94,39 +93,29 @@ Pre-requisites:
We have a lot of build variants. Each variant is composed of two flavors. One flavor is the version of Gecko to use and the other describes
which app id and settings to use. Here is a description of what each means:

- **geckoBeta** (recommended) uses the Beta variant of the Gecko rendering engine, which corresponds to the next version of Gecko which will go to production
- **geckoNightly** uses the Nightly variant of the Gecko rendering engine, which is the version which will arrive after beta and is less stable

<br />
<br />

- **debug** uses debug symbols and debug signing, adds tools like LeakCanary for troubleshooting, and does not strip unused or wasteful code
- **fenixNightly** is a release build with nightly signing which uses the org.mozilla.fenix.nightly app id for nightly releases to Google Play
- **fenixBeta** is a release build with beta signing which uses the org.mozilla.fenix.beta app id for beta releases to Google Play
- **fenixProduction** is a release build with release signing which uses the org.mozilla.fenix app id for production releases to Google Play
- **fennecProduction** is an experimental build with release signing which uses the org.mozilla.firefox app id and supports upgrading the older Firefox. **WARNING** Pre-production versions of this may result in data loss.
- **forPerformanceTest**: see "Performance Build Variants" below.
- **nightly** uses the Nightly variant of the Gecko rendering engine, which is the version which will arrive after beta and is less stable
- **beta** (recommended) uses the Beta variant of the Gecko rendering engine, which corresponds to the next version of Gecko which will go to production
- **release** is a release build with release signing which uses the org.mozilla.firefox app id for production releases to Google Play

#### Performance Build Variants
For accurate performance measurements, read this section!

If you want to analyze performance during **local development** (note: there is a non-trivial performance impact - see caveats):
- Recommendation: use a `forPerformanceTest` variant with local Leanplum, Adjust, & Sentry API tokens: contact the front-end perf group for access to them
- Rationale: `forPerformanceTest` is a release variant with `debuggable` set to true. There are numerous performance-impacting differences between debug and release variants so we need a release variant. To profile, we also need debuggable, which is disabled on other release variants. If API tokens are not provided, the SDKs may change their behavior in non-trivial ways.
- Recommendation: use a debuggable variant (see "local.properties helpers" below) with local Leanplum, Adjust, & Sentry API tokens: contact the front-end perf group for access to them
- Rationale: There are numerous performance-impacting differences between debug and release variants so we need a release variant. To profile, we also need debuggable, which is disabled by default for release variants. If API tokens are not provided, the SDKs may change their behavior in non-trivial ways.
- Caveats:
- debuggable has a non-trivial & variable impact on performance but is needed to take profiles.
- Random experiment opt-in & feature flags may impact performance (see [perf-frontend-issues#45](https://github.com/mozilla-mobile/perf-frontend-issues/issues/45) for mitigation).
- This is slower to build than debug builds because it does additional tasks (e.g. minification) similar to other release builds

Nightly `forPerformanceTest` variants with API tokens already added [are also available from Taskcluster](https://firefox-ci-tc.services.mozilla.com/tasks/index/project.mobile.fenix.v2.performance-test/).

If you want to run **performance tests/benchmarks** in automation or locally:
- Recommendation: production builds. If debuggable is required, use recommendation above but note the caveat above. If your needs are not met, please contact the front-end perf group to identify a new solution.
- Rationale: like the rationale above, we need release variants so the choice is based on the debuggable flag.

For additional context on these recommendations, see [the perf build variant analysis](https://docs.google.com/document/d/1aW-m0HYncTDDiRz_2x6EjcYkjBpL9SHhhYix13Vil30/edit#).

Before you can install any release variants including `forPerformanceTest`, **you will need to sign them:** see [Automatically signing release builds](#automatically-sign-release-builds) for details.
Before you can install any release variants, **you will need to sign them:** see [Automatically signing release builds](#automatically-sign-release-builds) for details.

## Pre-push hooks
To reduce review turn-around time, we'd like all pushes to run tests locally. We'd
@@ -181,6 +170,22 @@ With this line, release build variants will automatically be signed with your de

This is helpful when you're building release variants frequently, for example to test feature flags and or do performance analyses.

### Building debuggable release variants

Nightly, Beta and Release variants are getting published to Google Play and therefore are not debuggable. To locally create debuggable builds of those variants, add the following to `<proj-root>/local.properties`:

```sh
debuggable
```

### Setting raptor manifest flag

To set the raptor manifest flag in Nightly, Beta and Release variants, add the following to `<proj-root>/local.properties`:

```sh
raptorEnabled
```

### Auto-publication workflow for android-components and application-services
If you're making changes to these projects and want to test them in Fenix, auto-publication workflow is the fastest, most reliable
way to do that.


+ 30
- 91
app/build.gradle View File

@@ -6,7 +6,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'jacoco'
apply from: "$project.rootDir/automation/gradle/versionCode.gradle"
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'

@@ -48,6 +47,10 @@ android {
if (gradle.hasProperty("localProperties.autosignReleaseWithDebugKey")) {
signingConfig signingConfigs.debug
}

if (gradle.hasProperty("localProperties.debuggable")) {
debuggable true
}
}

buildTypes {
@@ -58,31 +61,20 @@ android {
resValue "bool", "IS_DEBUG", "true"
pseudoLocalesEnabled true
}
forPerformanceTest releaseTemplate >> { // the ">>" concatenates the raptor-specific options with the template
applicationIdSuffix ".fenix.performancetest"
debuggable true
manifestPlaceholders = [
// Since we configure this build to behave like a "fennec" flavored build, we need
// to set a shared user id for the manifest. The actual values does not matter.
// However we pick a unique value to not "clash" with other Fenix/Fennec builds
// installed on the device.
"sharedUserId": "org.mozilla.fenix.performancetest.sharedID"
]
}
fenixProduction releaseTemplate >> {
nightly releaseTemplate >> {
applicationIdSuffix ".fenix"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
def deepLinkSchemeValue = "fenix-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue]
}
fennecProduction releaseTemplate >> {
beta releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox"
def deepLinkSchemeValue = "fenix"
applicationIdSuffix ".firefox_beta"
def deepLinkSchemeValue = "fenix-beta"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Release channel) and therefore needs to inherit
// This release type is meant to replace Firefox (Beta channel) and therefore needs to inherit
// its sharedUserId for all eternity. See:
// https://searchfox.org/mozilla-central/search?q=moz_android_shared_id&case=false&regexp=false&path=
// Shipping an app update without sharedUserId can have
@@ -93,10 +85,10 @@ android {
"deepLinkScheme": deepLinkSchemeValue
]
}
fennecBeta releaseTemplate >> {
release releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox_beta"
def deepLinkSchemeValue = "fenix-beta"
applicationIdSuffix ".firefox"
def deepLinkSchemeValue = "fenix"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Release channel) and therefore needs to inherit
@@ -112,32 +104,6 @@ android {
}
}

variantFilter { // There's a "release" build type that exists by default that we don't use (it's replaced by "nightly" and "beta")
if (buildType.name == 'release') {
setIgnore true
}

// Current build variant setup:
//
// | geckoNightly | geckoBeta |
// |--------------------|---------------|-----------|
// | debug | ✅ | ✅ | Both variants for testing and development.
// | forPerformanceTest | ✅ | ✅ | Both variants unless the perf team only cares about Nightly (TBD).
// | fenixProduction | ✅ | ❌ | Fenix Production (to be renamed `Nightly`) ships with GV Nightly
// | fennecProduction | ❌ | ✅ | Fenix build to replace production Firefox builds
// | fennecBeta | ❌ | ✅ | Fenix build to replace beta Firefox builds

def flavors = flavors*.name.toString().toLowerCase()

if (buildType.name == 'fenixProduction' && flavors.contains("geckobeta")) {
setIgnore true
}

if ((buildType.name == 'fennecProduction' || buildType.name == 'fennecBeta') && flavors.contains("geckonightly")) {
setIgnore true
}
}

aaptOptions {
// All JavaScript code used internally by GeckoView is packaged in a
// file called omni.ja. If this file is compressed in the APK,
@@ -162,29 +128,19 @@ android {
androidTest {
resources.srcDirs += ['src/androidTest/resources']
}
fennecBeta {
java.srcDirs = ['src/migration/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
debug {
java.srcDirs = ['src/geckoNightly/java']
}
fennecProduction {
java.srcDirs = ['src/migration/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
nightly {
java.srcDirs = ['src/geckoNightly/java']
}
forPerformanceTest {
// We want our performance test builds to use the same code as our "fennec" flavor builds
// since those builds will ship to our large user base.
java.srcDirs = ['src/migration/java']
beta {
java.srcDirs = ['src/migration/java', 'src/geckoBeta/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
}
}

productFlavors {
geckoNightly {
dimension "engine"
}

geckoBeta {
dimension "engine"
release {
java.srcDirs = ['src/migration/java', 'src/geckoRelease/java']
manifest.srcFile "src/migration/AndroidManifest.xml"
}
}

@@ -216,8 +172,6 @@ android {
}
}

def baseVersionCode = generatedVersionCode

android.applicationVariants.all { variant ->

// -------------------------------------------------------------------------------------------------
@@ -252,27 +206,11 @@ android.applicationVariants.all { variant ->
// same version code. Therefore we need to have different version codes for our ARM and x86
// builds.

// Our generated version code now has a length of 9 (See automation/gradle/versionCode.gradle).
// Our x86 builds need a higher version code to avoid installing ARM builds on an x86 device
// with ARM compatibility mode.

variant.outputs.each { output ->
def abi = output.getFilter(OutputFile.ABI)

def versionCodeOverride
if (variant.name.contains("Fennec")) {
versionCodeOverride = Config.generateFennecVersionCode(abi)
} else if (abi == "x86_64") {
versionCodeOverride = baseVersionCode + 3
} else if (abi == "x86") {
versionCodeOverride = baseVersionCode + 2
} else if (abi == "arm64-v8a") {
versionCodeOverride = baseVersionCode + 1
} else if (abi == "armeabi-v7a") {
versionCodeOverride = baseVersionCode
} else {
throw RuntimeException("Unknown ABI: $abi")
}
// We use the same version code generator, that we inherited from Fennec, across all channels - even on
// channels that never shipped a Fennec build.
def versionCodeOverride = Config.generateFennecVersionCode(abi)

println("versionCode for $abi = $versionCodeOverride")

@@ -377,8 +315,11 @@ ext.gleanDocsDirectory = "$rootDir/docs"
apply plugin: "org.mozilla.telemetry.glean-gradle-plugin"

dependencies {
geckoNightlyImplementation Deps.mozilla_browser_engine_gecko_nightly
geckoBetaImplementation Deps.mozilla_browser_engine_gecko_beta
debugImplementation Deps.mozilla_browser_engine_gecko_nightly

nightlyImplementation Deps.mozilla_browser_engine_gecko_nightly
betaImplementation Deps.mozilla_browser_engine_gecko_beta
releaseImplementation Deps.mozilla_browser_engine_gecko_release

implementation Deps.kotlin_stdlib
implementation Deps.kotlin_coroutines
@@ -604,17 +545,15 @@ task printVariants {
fileName: it.outputFileName,
]},
build_type: it.buildType.name,
engine: it.productFlavors.find { it.dimension == 'engine' }.name,
name: it.name,
]}
// AndroidTest is a special case not included above
variants.add([
apks: [[
abi: 'noarch',
fileName: 'app-geckoNightly-debug-androidTest.apk',
fileName: 'app-debug-androidTest.apk',
]],
build_type: 'androidTest',
engine: 'geckoNightly',
name: 'androidTest',
])
println 'variants: ' + groovy.json.JsonOutput.toJson(variants)


app/src/fennecBeta/res/drawable-hdpi/fenix_search_widget.png → app/src/beta/res/drawable-hdpi/fenix_search_widget.png View File


app/src/fennecBeta/res/drawable-hdpi/ic_logo_wordmark_normal.png → app/src/beta/res/drawable-hdpi/ic_logo_wordmark_normal.png View File


app/src/fennecBeta/res/drawable-hdpi/ic_logo_wordmark_private.png → app/src/beta/res/drawable-hdpi/ic_logo_wordmark_private.png View File


app/src/fennecBeta/res/drawable-mdpi/ic_logo_wordmark_normal.png → app/src/beta/res/drawable-mdpi/ic_logo_wordmark_normal.png View File


app/src/fennecBeta/res/drawable-mdpi/ic_logo_wordmark_private.png → app/src/beta/res/drawable-mdpi/ic_logo_wordmark_private.png View File


app/src/fennecBeta/res/drawable-xhdpi/ic_logo_wordmark_normal.png → app/src/beta/res/drawable-xhdpi/ic_logo_wordmark_normal.png View File


app/src/fennecBeta/res/drawable-xhdpi/ic_logo_wordmark_private.png → app/src/beta/res/drawable-xhdpi/ic_logo_wordmark_private.png View File


app/src/fennecBeta/res/drawable-xxhdpi/ic_logo_wordmark_normal.png → app/src/beta/res/drawable-xxhdpi/ic_logo_wordmark_normal.png View File


app/src/fennecBeta/res/drawable-xxhdpi/ic_logo_wordmark_private.png → app/src/beta/res/drawable-xxhdpi/ic_logo_wordmark_private.png View File


app/src/fennecBeta/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png → app/src/beta/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png View File


app/src/fennecBeta/res/drawable-xxxhdpi/ic_logo_wordmark_private.png → app/src/beta/res/drawable-xxxhdpi/ic_logo_wordmark_private.png View File


app/src/fennecBeta/res/drawable/ic_launcher_foreground.xml → app/src/beta/res/drawable/ic_launcher_foreground.xml View File


app/src/fennecBeta/res/mipmap-hdpi/ic_launcher.png → app/src/beta/res/mipmap-hdpi/ic_launcher.png View File


app/src/fennecBeta/res/mipmap-hdpi/ic_launcher_round.png → app/src/beta/res/mipmap-hdpi/ic_launcher_round.png View File


app/src/fennecBeta/res/mipmap-mdpi/ic_launcher.png → app/src/beta/res/mipmap-mdpi/ic_launcher.png View File


app/src/fennecBeta/res/mipmap-mdpi/ic_launcher_round.png → app/src/beta/res/mipmap-mdpi/ic_launcher_round.png View File


app/src/fennecBeta/res/mipmap-xhdpi/ic_launcher.png → app/src/beta/res/mipmap-xhdpi/ic_launcher.png View File


app/src/fennecBeta/res/mipmap-xhdpi/ic_launcher_round.png → app/src/beta/res/mipmap-xhdpi/ic_launcher_round.png View File


app/src/fennecBeta/res/mipmap-xxhdpi/ic_launcher.png → app/src/beta/res/mipmap-xxhdpi/ic_launcher.png View File


app/src/fennecBeta/res/mipmap-xxhdpi/ic_launcher_round.png → app/src/beta/res/mipmap-xxhdpi/ic_launcher_round.png View File


app/src/fennecBeta/res/mipmap-xxxhdpi/ic_launcher.png → app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png View File


app/src/fennecBeta/res/mipmap-xxxhdpi/ic_launcher_round.png → app/src/beta/res/mipmap-xxxhdpi/ic_launcher_round.png View File


app/src/fennecBeta/res/values/colors.xml → app/src/beta/res/values/colors.xml View File


app/src/fennecBeta/res/values/static_strings.xml → app/src/beta/res/values/static_strings.xml View File


app/src/fennecBeta/res/xml/shortcuts.xml → app/src/beta/res/xml/shortcuts.xml View File


+ 0
- 66
app/src/fenixBeta/res/drawable/ic_launcher_foreground.xml
File diff suppressed because it is too large
View File


BIN
app/src/fenixBeta/res/ic_launcher-web.png View File

Before After
Width: 192  |  Height: 192  |  Size: 13 KiB

BIN
app/src/fenixBeta/res/mipmap-hdpi/ic_launcher.png View File

Before After
Width: 76  |  Height: 76  |  Size: 3.9 KiB

BIN
app/src/fenixBeta/res/mipmap-hdpi/ic_launcher_round.png View File

Before After
Width: 76  |  Height: 76  |  Size: 6.6 KiB

BIN
app/src/fenixBeta/res/mipmap-mdpi/ic_launcher.png View File

Before After
Width: 48  |  Height: 48  |  Size: 2.2 KiB

BIN
app/src/fenixBeta/res/mipmap-mdpi/ic_launcher_round.png View File

Before After
Width: 48  |  Height: 48  |  Size: 3.5 KiB

BIN
app/src/fenixBeta/res/mipmap-xhdpi/ic_launcher.png View File

Before After
Width: 96  |  Height: 96  |  Size: 5.6 KiB

BIN
app/src/fenixBeta/res/mipmap-xhdpi/ic_launcher_round.png View File

Before After
Width: 96  |  Height: 96  |  Size: 9.1 KiB

BIN
app/src/fenixBeta/res/mipmap-xxhdpi/ic_launcher.png View File

Before After
Width: 144  |  Height: 144  |  Size: 9.4 KiB

BIN
app/src/fenixBeta/res/mipmap-xxhdpi/ic_launcher_round.png View File

Before After
Width: 144  |  Height: 144  |  Size: 15 KiB

BIN
app/src/fenixBeta/res/mipmap-xxxhdpi/ic_launcher.png View File

Before After
Width: 192  |  Height: 192  |  Size: 13 KiB

BIN
app/src/fenixBeta/res/mipmap-xxxhdpi/ic_launcher_round.png View File

Before After
Width: 192  |  Height: 192  |  Size: 22 KiB

+ 0
- 29
app/src/fenixBeta/res/xml/shortcuts.xml View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="open_new_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_TAB"
android:targetPackage="org.mozilla.fenix.beta"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
<shortcut
android:shortcutId="open_new_private_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_private_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_private_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
android:targetPackage="org.mozilla.fenix.beta"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
</shortcuts>

+ 0
- 25
app/src/fenixNightly/res/drawable/ic_launcher_foreground.xml View File

@@ -1,25 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M78.12,44.4c-1.23,-2.69 -3.79,-6.09 -5.71,-6.77 -0.56,-0.2 -1.17,0.48 -1.05,1.06 -2.75,-3.43 -5.87,-6.37 -8.1,-10.31 -0.2,-0.38 -0.41,-1.11 -0.56,-1.32 -0.3,-0.43 -0.91,-0.53 -1.7,-0.06 -4.26,2.54 -8.36,9 -8.6,13.57 -0.5,0.16 -3.27,0.38 -2.87,1.83 0.63,1.3 1.74,0.1 3.19,0 4.36,-0.32 6.95,0.74 9.42,3.1 -1.62,-0.27 -4.04,-0.56 -4.04,0.87 0,0.57 1.28,1.1 1.8,1.51a9.08,9.08 0,0 1,3.45 9.3c-1.18,5.67 -5.69,7.9 -9.94,7.65 -8.76,-0.52 -9.73,-8.35 -9.73,-8.35 1.35,-2.94 5.64,-3.53 6.6,-3.49 1.4,0.05 1.86,-0.24 2.84,-1.09 1.87,-1.63 2.44,-2.85 1.2,-3.5 -1.03,-0.54 -2.9,-1.37 -4.35,-2.35 -2.89,-1.94 -2.34,-2.46 -3.57,-3.11 -0.3,-1.57 -0.41,-2.23 -0.21,-3.92 0.12,-1.1 0.54,-1.78 0.08,-2.14 -0.63,-0.5 -0.75,-0.27 -1.24,-0.1 -2.35,0.81 -4.36,3.01 -5.16,3.73a17.13,17.13 0,0 1,-0.33 -3.98c0.2,-1.28 -0.55,-1.9 -1.8,-1.14 -2.83,1.7 -10.17,8.6 -9.68,19.56 0.59,13.37 10.16,24.88 25.03,25.62 14.87,0.73 25.6,-11.4 26.82,-22.97 0.44,-4.25 -0.22,-9.77 -1.8,-13.2zM59.29,41.5c-1.64,-0.52 -3.26,-1 -5,-0.94 0.17,-2.9 2.58,-7.63 4.43,-9.22 -0.67,2.02 -1.33,6.91 0.57,10.16zM59.78,36.05c0,-3.6 0.76,-4.93 1.5,-6.74a29.71,29.71 0,0 0,2.54 3.6c3.68,4.36 7.84,7.85 10,13.28 0.94,2.34 -0.13,8.45 -3.94,12.16 0.47,-2.87 -0.37,-6.66 -1.33,-7.94 -0.82,-1.08 -1.54,-2.3 -2.6,-3.07 -2.23,-3.48 -2.43,-2.6 -3.94,-4.76a11.17,11.17 0,0 1,-2.23 -6.53zM61.38,64.05c5.04,-3.94 5.41,-12.11 0.7,-16.64 7.82,2.59 6.19,12.1 5.2,13.28 -1.1,1.33 -3.75,2.45 -5.9,3.37zM51.6,50.49c0,1.16 -1.76,0.34 -4.94,1.19 -3.14,0.83 -4.29,3.33 -4.29,3.33 -0.05,-0.79 0.2,-2.4 -0.25,-2.82 -0.37,-0.35 -0.94,-0.18 -1.73,-0.34a5.43,5.43 0,0 1,-3.62 -2.37c2.84,-1.47 5.7,-0.86 8.54,0.47 1.82,0.85 4.27,0.41 6.3,0.54zM44.33,39.18s-0.21,1.32 -0.02,2.76c0,0 -1.62,-0.58 -2.67,-0.57 0.9,-0.97 2.69,-2.2 2.69,-2.2zM30.06,54.53c-0.84,-5.4 2.49,-13 7.63,-16.98 0.12,1.81 0.15,4.26 1.28,5.32 0.3,0.28 1.13,0.1 1.86,0.14 1.37,0.08 3.04,0.43 4.21,1.24 1.7,1.17 2.2,2.76 6.44,4.64 0,0 -4.06,0.11 -5.17,-0.25 -2,-0.65 -3.33,-1.78 -7.28,-1.52 -1.72,0.11 -4.78,1.4 -4.54,2.28 0.7,2.6 3.64,4.31 5.87,4.5 -0.71,6.87 7.33,13.37 14.55,13.17 13.09,-0.38 18.75,-9.5 20.22,-14.27 0.24,4.83 -1.15,10.06 -4.01,13.63 -5.26,6.54 -13.16,8.82 -21.82,7.32 -9.65,-1.68 -17.78,-9.9 -19.23,-19.22zM78.06,57.29C76.55,69.45 65.25,79.3 51.55,78.04c-8.6,-0.79 -16.35,-6.89 -19.22,-13.36 5.41,7.23 11.98,10.77 20.53,11.15 11.55,0.52 20.79,-6.02 23.56,-16.87 1.52,-5.95 -0.15,-11.3 -1.62,-16.7a22.66,22.66 0,0 1,3.27 15.03z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="25.09"
android:startX="78.92"
android:endY="74.45"
android:endX="37.26"
android:type="linear">
<item android:offset="0" android:color="#88FFD1"/>
<item android:offset="0.04" android:color="#7BFCD6"/>
<item android:offset="0.13" android:color="#57F3E2"/>
<item android:offset="0.24" android:color="#1EE5F5"/>
<item android:offset="0.29" android:color="#00DDFF"/>
<item android:offset="1" android:color="#9059FF"/>
</gradient>
</aapt:attr>
</path>
</vector>

BIN
app/src/fenixNightly/res/ic_launcher-web.png View File

Before After
Width: 512  |  Height: 512  |  Size: 45 KiB

BIN
app/src/fenixNightly/res/mipmap-hdpi/ic_launcher.png View File

Before After
Width: 72  |  Height: 72  |  Size: 3.9 KiB

BIN
app/src/fenixNightly/res/mipmap-hdpi/ic_launcher_round.png View File

Before After
Width: 72  |  Height: 72  |  Size: 6.4 KiB

BIN
app/src/fenixNightly/res/mipmap-mdpi/ic_launcher.png View File

Before After
Width: 48  |  Height: 48  |  Size: 2.2 KiB

BIN
app/src/fenixNightly/res/mipmap-mdpi/ic_launcher_round.png View File

Before After
Width: 48  |  Height: 48  |  Size: 3.5 KiB

BIN
app/src/fenixNightly/res/mipmap-xhdpi/ic_launcher.png View File

Before After
Width: 96  |  Height: 96  |  Size: 5.9 KiB

BIN
app/src/fenixNightly/res/mipmap-xhdpi/ic_launcher_round.png View File

Before After
Width: 96  |  Height: 96  |  Size: 9.5 KiB

BIN
app/src/fenixNightly/res/mipmap-xxhdpi/ic_launcher.png View File

Before After
Width: 144  |  Height: 144  |  Size: 9.8 KiB

BIN
app/src/fenixNightly/res/mipmap-xxhdpi/ic_launcher_round.png View File

Before After
Width: 144  |  Height: 144  |  Size: 15 KiB

BIN
app/src/fenixNightly/res/mipmap-xxxhdpi/ic_launcher.png View File

Before After
Width: 192  |  Height: 192  |  Size: 14 KiB

BIN
app/src/fenixNightly/res/mipmap-xxxhdpi/ic_launcher_round.png View File

Before After
Width: 192  |  Height: 192  |  Size: 21 KiB

+ 0
- 29
app/src/fenixNightly/res/xml/shortcuts.xml View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->

<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="open_new_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_TAB"
android:targetPackage="org.mozilla.fenix.nightly"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
<shortcut
android:shortcutId="open_new_private_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_private_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_private_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
android:targetPackage="org.mozilla.fenix.nightly"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
</shortcuts>

+ 0
- 18
app/src/fenixProduction/AndroidManifest.xml View File

@@ -1,18 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.mozilla.fenix">

<application>

<service android:name=".customtabs.CustomTabsService">
<!-- Trusted Web Activities are currently only supported in nightly. -->
<intent-filter tools:node="removeAll" />
<intent-filter>
<action android:name="android.support.customtabs.action.CustomTabsService" />
<category android:name="androidx.browser.trusted.category.TrustedWebActivities" />
</intent-filter>
</service>

</application>

</manifest>

+ 0
- 7
app/src/fenixProduction/res/values/colors.xml View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<resources>
<color name="ic_launcher_background">@color/nightly_launcher_background</color>
</resources>

+ 0
- 8
app/src/fenixProduction/res/values/static_strings.xml View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- 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/. -->
<resources>
<!-- Name of the application -->
<string name="app_name" translatable="false">Firefox Nightly</string>
</resources>

+ 0
- 8
app/src/fennecNightly/res/mipmap-anydpi-v26/ic_launcher.xml View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground_fennec_nightly"/>
</adaptive-icon>

+ 0
- 8
app/src/fennecNightly/res/mipmap-anydpi-v26/ic_launcher_round.xml View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground_fennec_nightly"/>
</adaptive-icon>

BIN
app/src/fennecNightly/res/mipmap-hdpi/ic_launcher.png View File

Before After
Width: 72  |  Height: 72  |  Size: 6.2 KiB

BIN
app/src/fennecNightly/res/mipmap-hdpi/ic_launcher_foreground_fennec_nightly.png View File

Before After
Width: 162  |  Height: 162  |  Size: 8.6 KiB

BIN
app/src/fennecNightly/res/mipmap-hdpi/ic_launcher_round.png View File

Before After
Width: 72  |  Height: 72  |  Size: 6.3 KiB

BIN
app/src/fennecNightly/res/mipmap-mdpi/ic_launcher.png View File

Before After
Width: 48  |  Height: 48  |  Size: 3.6 KiB

BIN
app/src/fennecNightly/res/mipmap-mdpi/ic_launcher_foreground_fennec_nightly.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.8 KiB

BIN
app/src/fennecNightly/res/mipmap-mdpi/ic_launcher_round.png View File

Before After
Width: 48  |  Height: 48  |  Size: 3.8 KiB

BIN
app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher.png View File

Before After
Width: 96  |  Height: 96  |  Size: 9.3 KiB

BIN
app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher_foreground_fennec_nightly.png View File

Before After
Width: 216  |  Height: 216  |  Size: 12 KiB

BIN
app/src/fennecNightly/res/mipmap-xhdpi/ic_launcher_round.png View File

Before After
Width: 96  |  Height: 96  |  Size: 9.2 KiB

BIN
app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher.png View File

Before After
Width: 144  |  Height: 144  |  Size: 16 KiB

BIN
app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher_foreground_fennec_nightly.png View File

Before After
Width: 324  |  Height: 324  |  Size: 24 KiB

BIN
app/src/fennecNightly/res/mipmap-xxhdpi/ic_launcher_round.png View File

Before After
Width: 144  |  Height: 144  |  Size: 15 KiB

BIN
app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher.png View File

Before After
Width: 192  |  Height: 192  |  Size: 24 KiB

BIN
app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher_foreground_fennec_nightly.png View File

Before After
Width: 432  |  Height: 432  |  Size: 34 KiB

BIN
app/src/fennecNightly/res/mipmap-xxxhdpi/ic_launcher_round.png View File

Before After
Width: 192  |  Height: 192  |  Size: 22 KiB

+ 0
- 7
app/src/fennecNightly/res/values/colors.xml View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<resources>
<color name="ic_launcher_background">@color/debug_launcher_background</color>
</resources>

+ 0
- 8
app/src/fennecNightly/res/values/static_strings.xml View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- 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/. -->
<resources>
<!-- Name of the application -->
<string name="app_name" translatable="false">Firefox Nightly</string>
</resources>

+ 0
- 28
app/src/fennecNightly/res/xml/shortcuts.xml View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="open_new_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_TAB"
android:targetPackage="org.mozilla.fennec_aurora"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
<shortcut
android:shortcutId="open_new_private_tab"
android:enabled="true"
android:icon="@drawable/ic_static_shortcut_private_tab"
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_private_tab_2"
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
android:targetPackage="org.mozilla.fennec_aurora"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
</shortcuts>

+ 72
- 0
app/src/geckoRelease/java/org/mozilla/fenix/engine/GeckoProvider.kt View File

@@ -0,0 +1,72 @@
/* 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/. */

import android.content.Context
import android.os.Bundle
import mozilla.components.browser.engine.gecko.autofill.GeckoLoginDelegateWrapper
import mozilla.components.browser.engine.gecko.glean.GeckoAdapter
import mozilla.components.concept.engine.EngineSession.TrackingProtectionPolicy
import mozilla.components.concept.storage.LoginsStorage
import mozilla.components.lib.crash.handler.CrashHandlerService
import mozilla.components.service.sync.logins.GeckoLoginStorageDelegate
import org.mozilla.fenix.Config
import org.mozilla.fenix.ext.components
import org.mozilla.geckoview.GeckoRuntime
import org.mozilla.geckoview.GeckoRuntimeSettings

object GeckoProvider {
var testConfig: Bundle? = null
private var runtime: GeckoRuntime? = null

@Synchronized
fun getOrCreateRuntime(
context: Context,
storage: Lazy<LoginsStorage>,
trackingProtectionPolicy: TrackingProtectionPolicy
): GeckoRuntime {
if (runtime == null) {
runtime = createRuntime(context, storage, trackingProtectionPolicy)
}

return runtime!!
}

private fun createRuntime(
context: Context,
storage: Lazy<LoginsStorage>,
policy: TrackingProtectionPolicy
): GeckoRuntime {
val builder = GeckoRuntimeSettings.Builder()

testConfig?.let {
builder.extras(it)
.remoteDebuggingEnabled(true)
}

// Use meeee.
policy.hashCode()

val runtimeSettings = builder
.crashHandler(CrashHandlerService::class.java)
.telemetryDelegate(GeckoAdapter())
// TODO: Fix me!
// .contentBlocking(policy.toContentBlockingSetting())
.aboutConfigEnabled(Config.channel.isBeta)
.debugLogging(Config.channel.isDebug)
.build()

val settings = context.components.settings
if (!settings.shouldUseAutoSize) {
runtimeSettings.automaticFontSizeAdjustment = false
val fontSize = settings.fontSizeFactor
runtimeSettings.fontSizeFactor = fontSize
}

val geckoRuntime = GeckoRuntime.create(context, runtimeSettings)
val loginStorageDelegate = GeckoLoginStorageDelegate(storage)
geckoRuntime.loginStorageDelegate = GeckoLoginDelegateWrapper(loginStorageDelegate)

return geckoRuntime
}
}

+ 21
- 33
app/src/main/java/org/mozilla/fenix/Config.kt View File

@@ -5,14 +5,14 @@
package org.mozilla.fenix

enum class ReleaseChannel {
FenixDebug,
FenixProduction,
FennecProduction,
FennecBeta;
Debug,
Nightly,
Beta,
Release;

val isReleased: Boolean
get() = when (this) {
FenixDebug -> false
Debug -> false
else -> true
}

@@ -27,51 +27,39 @@ enum class ReleaseChannel {
get() = !this.isReleased

val isReleaseOrBeta: Boolean
get() = when (this) {
FennecProduction -> true
FennecBeta -> true
else -> false
}
get() = this == Release || this == Beta

val isRelease: Boolean
get() = when (this) {
FennecProduction -> true
Release -> true
else -> false
}

val isBeta: Boolean
get() = when (this) {
FennecBeta -> true
else -> false
}
get() = this == Beta

val isNightlyOrDebug: Boolean
get() = when (this) {
FenixDebug -> true
FenixProduction -> true
else -> false
}
get() = this == Debug || this == Nightly

/**
* Is this a build for a release channel that we used to ship Fennec on?
*/
val isFennec: Boolean
get() = this in fennecChannels

/**
* Is this build for a "pure" Fenix channel that we never shipped Fennec on?
*/
val isFenix: Boolean
get() = !isFennec
}

object Config {
val channel = when (BuildConfig.BUILD_TYPE) {
"fenixProduction" -> ReleaseChannel.FenixProduction
"debug" -> ReleaseChannel.FenixDebug
"fennecProduction" -> ReleaseChannel.FennecProduction
"fennecBeta" -> ReleaseChannel.FennecBeta

// Builds for local performance analysis, recording benchmarks, automation, etc.
// This should be treated like a released channel because we want to test
// what users experience and there are performance-impacting changes in debug
// release channels (e.g. logging) that are never intended to be shipped.
"forPerformanceTest" -> ReleaseChannel.FenixProduction

"debug" -> ReleaseChannel.Debug
"nightly" -> ReleaseChannel.Nightly
"beta" -> ReleaseChannel.Beta
"release" -> ReleaseChannel.Release
else -> {
throw IllegalStateException("Unknown build type: ${BuildConfig.BUILD_TYPE}")
}
@@ -79,6 +67,6 @@ object Config {
}

private val fennecChannels: List<ReleaseChannel> = listOf(
ReleaseChannel.FennecBeta,
ReleaseChannel.FennecProduction
ReleaseChannel.Beta,
ReleaseChannel.Release
)

+ 3
- 3
app/src/main/java/org/mozilla/fenix/components/Analytics.kt View File

@@ -102,9 +102,9 @@ fun isSentryEnabled() = !BuildConfig.SENTRY_TOKEN.isNullOrEmpty()
private fun getSentryProjectUrl(): String? {
val baseUrl = "https://sentry.prod.mozaws.net/operations"
return when (Config.channel) {
ReleaseChannel.FenixProduction -> "$baseUrl/fenix"
ReleaseChannel.FennecProduction -> "$baseUrl/fenix-fennec"
ReleaseChannel.FennecBeta -> "$baseUrl/fenix-fennec-beta"
ReleaseChannel.Nightly -> "$baseUrl/fenix"
ReleaseChannel.Release -> "$baseUrl/fenix-fennec"
ReleaseChannel.Beta -> "$baseUrl/fenix-fennec-beta"
else -> null
}
}

app/src/fenixNightly/AndroidManifest.xml → app/src/nightly/AndroidManifest.xml View File


app/src/fenixProduction/res/drawable-hdpi/ic_logo_wordmark_normal.png → app/src/nightly/res/drawable-hdpi/ic_logo_wordmark_normal.png View File


app/src/fenixProduction/res/drawable-hdpi/ic_logo_wordmark_private.png → app/src/nightly/res/drawable-hdpi/ic_logo_wordmark_private.png View File


app/src/fenixProduction/res/drawable-mdpi/ic_logo_wordmark_normal.png → app/src/nightly/res/drawable-mdpi/ic_logo_wordmark_normal.png View File


app/src/fenixProduction/res/drawable-mdpi/ic_logo_wordmark_private.png → app/src/nightly/res/drawable-mdpi/ic_logo_wordmark_private.png View File


app/src/fenixProduction/res/drawable-xhdpi/ic_logo_wordmark_normal.png → app/src/nightly/res/drawable-xhdpi/ic_logo_wordmark_normal.png View File


app/src/fenixProduction/res/drawable-xhdpi/ic_logo_wordmark_private.png → app/src/nightly/res/drawable-xhdpi/ic_logo_wordmark_private.png View File


app/src/fenixProduction/res/drawable-xxhdpi/ic_logo_wordmark_normal.png → app/src/nightly/res/drawable-xxhdpi/ic_logo_wordmark_normal.png View File


app/src/fenixProduction/res/drawable-xxhdpi/ic_logo_wordmark_private.png → app/src/nightly/res/drawable-xxhdpi/ic_logo_wordmark_private.png View File


app/src/fenixProduction/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png → app/src/nightly/res/drawable-xxxhdpi/ic_logo_wordmark_normal.png View File


app/src/fenixProduction/res/drawable-xxxhdpi/ic_logo_wordmark_private.png → app/src/nightly/res/drawable-xxxhdpi/ic_logo_wordmark_private.png View File


app/src/fenixProduction/res/drawable/ic_launcher_foreground.xml → app/src/nightly/res/drawable/ic_launcher_foreground.xml View File


app/src/fenixProduction/res/ic_launcher-web.png → app/src/nightly/res/ic_launcher-web.png View File


app/src/fenixProduction/res/mipmap-hdpi/ic_launcher.png → app/src/nightly/res/mipmap-hdpi/ic_launcher.png View File


app/src/fenixProduction/res/mipmap-hdpi/ic_launcher_round.png → app/src/nightly/res/mipmap-hdpi/ic_launcher_round.png View File


app/src/fenixProduction/res/mipmap-mdpi/ic_launcher.png → app/src/nightly/res/mipmap-mdpi/ic_launcher.png View File


app/src/fenixProduction/res/mipmap-mdpi/ic_launcher_round.png → app/src/nightly/res/mipmap-mdpi/ic_launcher_round.png View File


app/src/fenixProduction/res/mipmap-xhdpi/ic_launcher.png → app/src/nightly/res/mipmap-xhdpi/ic_launcher.png View File


app/src/fenixProduction/res/mipmap-xhdpi/ic_launcher_round.png → app/src/nightly/res/mipmap-xhdpi/ic_launcher_round.png View File


app/src/fenixProduction/res/mipmap-xxhdpi/ic_launcher.png → app/src/nightly/res/mipmap-xxhdpi/ic_launcher.png View File


app/src/fenixProduction/res/mipmap-xxhdpi/ic_launcher_round.png → app/src/nightly/res/mipmap-xxhdpi/ic_launcher_round.png View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save