parent
e4b4934f53
commit
27d8c09def
|
@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- #2308 - Update the deprecated BitmapDrawable constructor
|
- #2308 - Update the deprecated BitmapDrawable constructor
|
||||||
- #1311 - Enable downloads in custom tabs.
|
- #1311 - Enable downloads in custom tabs.
|
||||||
- #1874 - Added TOP info panel dialog for custom tabs.
|
- #1874 - Added TOP info panel dialog for custom tabs.
|
||||||
|
- #1735 - Adds API to see the release channel
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- #1429 - Updated site permissions ui for MVP
|
- #1429 - Updated site permissions ui for MVP
|
||||||
|
|
|
@ -32,8 +32,7 @@ android {
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
testInstrumentationRunnerArguments clearPackageData: 'true'
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
||||||
manifestPlaceholders.isRaptorEnabled = "false"
|
manifestPlaceholders.isRaptorEnabled = "false"
|
||||||
buildConfigField "boolean", "IS_RELEASED", "false"
|
resValue "bool", "IS_DEBUG", "true"
|
||||||
resValue "bool", "IS_NOT_RELEASED", "true"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def releaseTemplate = {
|
def releaseTemplate = {
|
||||||
|
@ -55,13 +54,11 @@ android {
|
||||||
applicationIdSuffix ".raptor"
|
applicationIdSuffix ".raptor"
|
||||||
}
|
}
|
||||||
nightly releaseTemplate >> {
|
nightly releaseTemplate >> {
|
||||||
buildConfigField "boolean", "IS_RELEASED", "true"
|
resValue "bool", "IS_DEBUG", "false"
|
||||||
resValue "bool", "IS_NOT_RELEASED", "false"
|
|
||||||
}
|
}
|
||||||
beta releaseTemplate >> {
|
beta releaseTemplate >> {
|
||||||
applicationIdSuffix ".beta"
|
applicationIdSuffix ".beta"
|
||||||
buildConfigField "boolean", "IS_RELEASED", "true"
|
resValue "bool", "IS_DEBUG", "false"
|
||||||
resValue "bool", "IS_NOT_RELEASED", "false"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,9 +130,10 @@ android.applicationVariants.all { variant ->
|
||||||
|
|
||||||
def buildType = variant.buildType.name
|
def buildType = variant.buildType.name
|
||||||
def versionCode = null
|
def versionCode = null
|
||||||
def isReleased = variant.buildType.buildConfigFields['IS_RELEASED']?.value ?: false
|
def releaseChannels = ["nightly", "beta", "release"]
|
||||||
|
def isReleased = releaseChannels.contains(buildType)
|
||||||
|
|
||||||
buildConfigField 'Boolean', 'COLLECTIONS_ENABLED', (buildType != "release").toString()
|
buildConfigField 'Boolean', 'COLLECTIONS_ENABLED', (!isReleased).toString()
|
||||||
|
|
||||||
if (isReleased) {
|
if (isReleased) {
|
||||||
versionCode = generatedVersionCode
|
versionCode = generatedVersionCode
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* 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 org.mozilla.fenix
|
||||||
|
|
||||||
|
enum class ReleaseChannel {
|
||||||
|
Debug, Nightly, Beta, Release;
|
||||||
|
|
||||||
|
val isReleased: Boolean
|
||||||
|
get() = when (this) {
|
||||||
|
Release, Beta, Nightly -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object Config {
|
||||||
|
val channel = when (BuildConfig.BUILD_TYPE) {
|
||||||
|
"release" -> ReleaseChannel.Release
|
||||||
|
"beta" -> ReleaseChannel.Beta
|
||||||
|
"nightly" -> ReleaseChannel.Nightly
|
||||||
|
else -> ReleaseChannel.Debug
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,6 +11,8 @@ import com.adjust.sdk.Adjust
|
||||||
import com.adjust.sdk.AdjustConfig
|
import com.adjust.sdk.AdjustConfig
|
||||||
import com.adjust.sdk.LogLevel
|
import com.adjust.sdk.LogLevel
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
|
import org.mozilla.fenix.Config
|
||||||
|
|
||||||
import java.lang.IllegalStateException
|
import java.lang.IllegalStateException
|
||||||
|
|
||||||
class AdjustMetricsService(private val application: Application) : MetricsService {
|
class AdjustMetricsService(private val application: Application) : MetricsService {
|
||||||
|
@ -18,7 +20,7 @@ class AdjustMetricsService(private val application: Application) : MetricsServic
|
||||||
if ((BuildConfig.ADJUST_TOKEN.isNullOrEmpty())) {
|
if ((BuildConfig.ADJUST_TOKEN.isNullOrEmpty())) {
|
||||||
Log.i(LOGTAG, "No adjust token defined")
|
Log.i(LOGTAG, "No adjust token defined")
|
||||||
|
|
||||||
if (BuildConfig.IS_RELEASED) {
|
if (Config.channel.isReleased) {
|
||||||
throw IllegalStateException("No adjust token defined for release build")
|
throw IllegalStateException("No adjust token defined for release build")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,9 @@ import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.content.pm.PackageInfoCompat
|
import androidx.core.content.pm.PackageInfoCompat
|
||||||
import kotlinx.android.synthetic.main.fragment_about.*
|
import kotlinx.android.synthetic.main.fragment_about.*
|
||||||
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.geckoview.BuildConfig
|
import org.mozilla.geckoview.BuildConfig as GeckoViewBuildConfig
|
||||||
|
|
||||||
class AboutFragment : Fragment() {
|
class AboutFragment : Fragment() {
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
@ -30,7 +31,7 @@ class AboutFragment : Fragment() {
|
||||||
val aboutText = try {
|
val aboutText = try {
|
||||||
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
|
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
|
||||||
val geckoVersion = PackageInfoCompat.getLongVersionCode(packageInfo).toString() + " \uD83E\uDD8E " +
|
val geckoVersion = PackageInfoCompat.getLongVersionCode(packageInfo).toString() + " \uD83E\uDD8E " +
|
||||||
BuildConfig.MOZ_APP_VERSION + "-" + BuildConfig.MOZ_APP_BUILDID
|
GeckoViewBuildConfig.MOZ_APP_VERSION + "-" + GeckoViewBuildConfig.MOZ_APP_BUILDID
|
||||||
String.format(
|
String.format(
|
||||||
"%s (Build #%s)",
|
"%s (Build #%s)",
|
||||||
packageInfo.versionName,
|
packageInfo.versionName,
|
||||||
|
@ -40,7 +41,7 @@ class AboutFragment : Fragment() {
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
val buildDate = org.mozilla.fenix.BuildConfig.BUILD_DATE
|
val buildDate = BuildConfig.BUILD_DATE
|
||||||
val content = resources.getString(R.string.about_content, appName)
|
val content = resources.getString(R.string.about_content, appName)
|
||||||
|
|
||||||
about_text.text = aboutText
|
about_text.text = aboutText
|
||||||
|
|
|
@ -24,10 +24,10 @@ import mozilla.components.concept.sync.OAuthAccount
|
||||||
import mozilla.components.concept.sync.Profile
|
import mozilla.components.concept.sync.Profile
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
import mozilla.components.service.fxa.FxaUnauthorizedException
|
import mozilla.components.service.fxa.FxaUnauthorizedException
|
||||||
import org.mozilla.fenix.BuildConfig
|
|
||||||
import org.mozilla.fenix.FenixApplication
|
import org.mozilla.fenix.FenixApplication
|
||||||
import org.mozilla.fenix.HomeActivity
|
import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.BrowserDirection
|
import org.mozilla.fenix.BrowserDirection
|
||||||
|
import org.mozilla.fenix.Config
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.getPreferenceKey
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
import org.mozilla.fenix.ext.requireComponents
|
import org.mozilla.fenix.ext.requireComponents
|
||||||
|
@ -206,7 +206,7 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
|
||||||
preferenceMakeDefaultBrowser?.onPreferenceClickListener =
|
preferenceMakeDefaultBrowser?.onPreferenceClickListener =
|
||||||
getClickListenerForMakeDefaultBrowser()
|
getClickListenerForMakeDefaultBrowser()
|
||||||
|
|
||||||
if (!BuildConfig.IS_RELEASED) {
|
if (!Config.channel.isReleased) {
|
||||||
preferenceLeakCanary?.onPreferenceChangeListener =
|
preferenceLeakCanary?.onPreferenceChangeListener =
|
||||||
Preference.OnPreferenceChangeListener { _, newValue ->
|
Preference.OnPreferenceChangeListener { _, newValue ->
|
||||||
(context?.applicationContext as FenixApplication).toggleLeakCanary(newValue as Boolean)
|
(context?.applicationContext as FenixApplication).toggleLeakCanary(newValue as Boolean)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import android.content.Context.MODE_PRIVATE
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import mozilla.components.feature.sitepermissions.SitePermissionsRules
|
import mozilla.components.feature.sitepermissions.SitePermissionsRules
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
|
import org.mozilla.fenix.Config
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.getPreferenceKey
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
import java.security.InvalidParameterException
|
import java.security.InvalidParameterException
|
||||||
|
@ -52,7 +53,7 @@ class Settings private constructor(context: Context) {
|
||||||
|
|
||||||
val isCrashReportingEnabled: Boolean
|
val isCrashReportingEnabled: Boolean
|
||||||
get() = preferences.getBoolean(appContext.getPreferenceKey(R.string.pref_key_crash_reporter), true) &&
|
get() = preferences.getBoolean(appContext.getPreferenceKey(R.string.pref_key_crash_reporter), true) &&
|
||||||
BuildConfig.CRASH_REPORTING && BuildConfig.IS_RELEASED
|
BuildConfig.CRASH_REPORTING && Config.channel.isReleased
|
||||||
|
|
||||||
val isRemoteDebuggingEnabled: Boolean
|
val isRemoteDebuggingEnabled: Boolean
|
||||||
get() = preferences.getBoolean(appContext.getPreferenceKey(R.string.pref_key_remote_debugging), false)
|
get() = preferences.getBoolean(appContext.getPreferenceKey(R.string.pref_key_remote_debugging), false)
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
android:icon="@drawable/ic_info"
|
android:icon="@drawable/ic_info"
|
||||||
android:key="@string/pref_key_leakcanary"
|
android:key="@string/pref_key_leakcanary"
|
||||||
android:title="@string/preference_leakcanary"
|
android:title="@string/preference_leakcanary"
|
||||||
app:isPreferenceVisible="@bool/IS_NOT_RELEASED" />
|
app:isPreferenceVisible="@bool/IS_DEBUG" />
|
||||||
</androidx.preference.PreferenceCategory>
|
</androidx.preference.PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import java.lang.RuntimeException
|
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
Loading…
Reference in New Issue