For #18553 Revert "Target Android 11"

This reverts commit 0e8dc616
pull/420/head
Arturo Mejia 3 years ago
parent 975f97df46
commit 07c15d3131

@ -58,7 +58,8 @@ android {
def deepLinkSchemeValue = "fenix-dev" def deepLinkSchemeValue = "fenix-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\"" buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [ manifestPlaceholders = [
"deepLinkScheme": deepLinkSchemeValue "deepLinkScheme": deepLinkSchemeValue,
"requestLegacyExternalStorage": true
] ]
// Build flag for "Mozilla Online" variants. See `Config.isMozillaOnline`. // Build flag for "Mozilla Online" variants. See `Config.isMozillaOnline`.
@ -93,13 +94,19 @@ android {
applicationIdSuffix ".fenix.debug" applicationIdSuffix ".fenix.debug"
resValue "bool", "IS_DEBUG", "true" resValue "bool", "IS_DEBUG", "true"
pseudoLocalesEnabled true pseudoLocalesEnabled true
def deepLinkSchemeValue = "fenix-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
"deepLinkScheme": deepLinkSchemeValue,
"requestLegacyExternalStorage": false
]
} }
nightly releaseTemplate >> { nightly releaseTemplate >> {
applicationIdSuffix ".fenix" applicationIdSuffix ".fenix"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true" buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
def deepLinkSchemeValue = "fenix-nightly" def deepLinkSchemeValue = "fenix-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\"" buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue] manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue, "requestLegacyExternalStorage": false]
} }
beta releaseTemplate >> { beta releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true" buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
@ -115,7 +122,8 @@ android {
// - https://issuetracker.google.com/issues/36924841 // - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922 // - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID", "sharedUserId": "org.mozilla.firefox.sharedID",
"deepLinkScheme": deepLinkSchemeValue "deepLinkScheme": deepLinkSchemeValue,
"requestLegacyExternalStorage": true
] ]
} }
release releaseTemplate >> { release releaseTemplate >> {
@ -132,7 +140,8 @@ android {
// - https://issuetracker.google.com/issues/36924841 // - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922 // - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID", "sharedUserId": "org.mozilla.firefox.sharedID",
"deepLinkScheme": deepLinkSchemeValue "deepLinkScheme": deepLinkSchemeValue,
"requestLegacyExternalStorage": true
] ]
} }
} }

@ -27,6 +27,7 @@
android:allowBackup="false" android:allowBackup="false"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:requestLegacyExternalStorage="${requestLegacyExternalStorage}"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/NormalTheme" android:theme="@style/NormalTheme"

@ -29,8 +29,6 @@ import mozilla.components.concept.base.crash.Breadcrumb
) )
fun Activity.enterToImmersiveMode() { fun Activity.enterToImmersiveMode() {
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17804
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION

@ -13,8 +13,7 @@ import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.graphics.Typeface import android.graphics.Typeface
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
import android.os.Build.VERSION import android.os.Build
import android.os.Build.VERSION_CODES
import android.os.Bundle import android.os.Bundle
import android.speech.RecognizerIntent import android.speech.RecognizerIntent
import android.text.style.StyleSpan import android.text.style.StyleSpan
@ -90,8 +89,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
// https://github.com/mozilla-mobile/fenix/issues/14279 // https://github.com/mozilla-mobile/fenix/issues/14279
// To prevent GeckoView from resizing we're going to change the softInputMode to not adjust // To prevent GeckoView from resizing we're going to change the softInputMode to not adjust
// the size of the window. // the size of the window.
if (VERSION.SDK_INT < VERSION_CODES.R) requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
// Refocus the toolbar editing and show keyboard if the QR fragment isn't showing // Refocus the toolbar editing and show keyboard if the QR fragment isn't showing
if (childFragmentManager.findFragmentByTag(QR_FRAGMENT_TAG) == null) { if (childFragmentManager.findFragmentByTag(QR_FRAGMENT_TAG) == null) {
toolbarView.view.edit.focus() toolbarView.view.edit.focus()
@ -102,10 +100,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
super.onStop() super.onStop()
// https://github.com/mozilla-mobile/fenix/issues/14279 // https://github.com/mozilla-mobile/fenix/issues/14279
// Let's reset back to the default behavior after we're done searching // Let's reset back to the default behavior after we're done searching
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17805 requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
@Suppress("DEPRECATION")
if (VERSION.SDK_INT < VERSION_CODES.R)
requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -349,7 +344,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
private fun updateAccessibilityTraversalOrder() { private fun updateAccessibilityTraversalOrder() {
val searchWrapperId = search_wrapper.id val searchWrapperId = search_wrapper.id
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP_MR1) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
qr_scan_button.accessibilityTraversalAfter = searchWrapperId qr_scan_button.accessibilityTraversalAfter = searchWrapperId
search_engines_shortcut_button.accessibilityTraversalAfter = searchWrapperId search_engines_shortcut_button.accessibilityTraversalAfter = searchWrapperId
fill_link_from_clipboard.accessibilityTraversalAfter = searchWrapperId fill_link_from_clipboard.accessibilityTraversalAfter = searchWrapperId

@ -59,12 +59,12 @@ class PerformanceActivityLifecycleCallbacks(
} }
} }
override fun onActivityStarted(activity: Activity) {} override fun onActivityStarted(activity: Activity?) {}
override fun onActivityStopped(activity: Activity) {} override fun onActivityStopped(activity: Activity?) {}
override fun onActivityResumed(activity: Activity) {} override fun onActivityResumed(activity: Activity?) {}
override fun onActivityPaused(activity: Activity) {} override fun onActivityPaused(activity: Activity?) {}
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {} override fun onActivitySaveInstanceState(activity: Activity?, bundle: Bundle?) {}
override fun onActivityDestroyed(activity: Activity) {} override fun onActivityDestroyed(activity: Activity?) {}
companion object { companion object {
/** /**

@ -44,23 +44,23 @@ class VisibilityLifecycleCallback(private val activityManager: ActivityManager?)
return false return false
} }
override fun onActivityStarted(activity: Activity) { override fun onActivityStarted(activity: Activity?) {
activitiesInStartedState++ activitiesInStartedState++
} }
override fun onActivityStopped(activity: Activity) { override fun onActivityStopped(activity: Activity?) {
activitiesInStartedState-- activitiesInStartedState--
} }
override fun onActivityResumed(activity: Activity) {} override fun onActivityResumed(activity: Activity?) {}
override fun onActivityPaused(activity: Activity) {} override fun onActivityPaused(activity: Activity?) {}
override fun onActivityCreated(activity: Activity, bundle: Bundle?) {} override fun onActivityCreated(activity: Activity?, bundle: Bundle?) {}
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {} override fun onActivitySaveInstanceState(activity: Activity?, bundle: Bundle?) {}
override fun onActivityDestroyed(activity: Activity) {} override fun onActivityDestroyed(activity: Activity?) {}
companion object { companion object {
/** /**

@ -130,11 +130,11 @@ class SitePermissionsDetailsExceptionsFragment : PreferenceFragmentCompat() {
AlertDialog.Builder(requireContext()).apply { AlertDialog.Builder(requireContext()).apply {
setMessage(R.string.confirm_clear_permissions_site) setMessage(R.string.confirm_clear_permissions_site)
setTitle(R.string.clear_permissions) setTitle(R.string.clear_permissions)
setPositiveButton(android.R.string.ok) { dialog: DialogInterface, _ -> setPositiveButton(android.R.string.yes) { dialog: DialogInterface, _ ->
clearSitePermissions() clearSitePermissions()
dialog.dismiss() dialog.dismiss()
} }
setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ -> setNegativeButton(android.R.string.no) { dialog: DialogInterface, _ ->
dialog.cancel() dialog.cancel()
} }
}.show() }.show()

@ -95,11 +95,11 @@ class SitePermissionsExceptionsFragment :
AlertDialog.Builder(requireContext()).apply { AlertDialog.Builder(requireContext()).apply {
setMessage(R.string.confirm_clear_permissions_on_all_sites) setMessage(R.string.confirm_clear_permissions_on_all_sites)
setTitle(R.string.clear_permissions) setTitle(R.string.clear_permissions)
setPositiveButton(android.R.string.ok) { dialog: DialogInterface, _ -> setPositiveButton(android.R.string.yes) { dialog: DialogInterface, _ ->
deleteAllSitePermissions() deleteAllSitePermissions()
dialog.dismiss() dialog.dismiss()
} }
setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ -> setNegativeButton(android.R.string.no) { dialog: DialogInterface, _ ->
dialog.cancel() dialog.cancel()
} }
}.show() }.show()

@ -159,11 +159,11 @@ class SitePermissionsManageExceptionsPhoneFeatureFragment : Fragment() {
AlertDialog.Builder(requireContext()).apply { AlertDialog.Builder(requireContext()).apply {
setMessage(R.string.confirm_clear_permission_site) setMessage(R.string.confirm_clear_permission_site)
setTitle(R.string.clear_permission) setTitle(R.string.clear_permission)
setPositiveButton(android.R.string.ok) { dialog: DialogInterface, _ -> setPositiveButton(android.R.string.yes) { dialog: DialogInterface, _ ->
clearPermissions() clearPermissions()
dialog.dismiss() dialog.dismiss()
} }
setNegativeButton(android.R.string.cancel) { dialog: DialogInterface, _ -> setNegativeButton(android.R.string.no) { dialog: DialogInterface, _ ->
dialog.cancel() dialog.cancel()
} }
}.show() }.show()

@ -47,8 +47,8 @@ class ShareViewModel(application: Application) : AndroidViewModel(application) {
@VisibleForTesting @VisibleForTesting
internal val networkCallback = object : ConnectivityManager.NetworkCallback() { internal val networkCallback = object : ConnectivityManager.NetworkCallback() {
override fun onLost(network: Network) = reloadDevices(network) override fun onLost(network: Network?) = reloadDevices(network)
override fun onAvailable(network: Network) = reloadDevices(network) override fun onAvailable(network: Network?) = reloadDevices(network)
private fun reloadDevices(network: Network?) { private fun reloadDevices(network: Network?) {
viewModelScope.launch(ioDispatcher) { viewModelScope.launch(ioDispatcher) {

@ -245,16 +245,12 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), UserInteractionHandler
} }
view.tabLayout.setOnApplyWindowInsetsListener { v, insets -> view.tabLayout.setOnApplyWindowInsetsListener { v, insets ->
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17807
@Suppress("DEPRECATION")
v.updatePadding( v.updatePadding(
left = insets.left(), left = insets.left(),
right = insets.right(), right = insets.right(),
bottom = insets.bottom() bottom = insets.bottom()
) )
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17807
@Suppress("DEPRECATION")
tabTrayView.view.tab_wrapper.updatePadding( tabTrayView.view.tab_wrapper.updatePadding(
bottom = insets.bottom() bottom = insets.bottom()
) )

@ -76,8 +76,7 @@ abstract class ThemeManager {
private fun updateLightSystemBars(window: Window, context: Context) { private fun updateLightSystemBars(window: Window, context: Context) {
if (SDK_INT >= Build.VERSION_CODES.M) { if (SDK_INT >= Build.VERSION_CODES.M) {
window.statusBarColor = context.getColorFromAttr(android.R.attr.statusBarColor) window.statusBarColor = context.getColorFromAttr(android.R.attr.statusBarColor)
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17808
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility =
window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else { } else {
@ -86,8 +85,6 @@ abstract class ThemeManager {
if (SDK_INT >= Build.VERSION_CODES.O) { if (SDK_INT >= Build.VERSION_CODES.O) {
// API level can display handle light navigation bar color // API level can display handle light navigation bar color
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17808
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility =
window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR window.decorView.systemUiVisibility or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
updateNavigationBar(window, context) updateNavigationBar(window, context)
@ -96,16 +93,12 @@ abstract class ThemeManager {
private fun clearLightSystemBars(window: Window) { private fun clearLightSystemBars(window: Window) {
if (SDK_INT >= Build.VERSION_CODES.M) { if (SDK_INT >= Build.VERSION_CODES.M) {
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17808
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility and window.decorView.systemUiVisibility = window.decorView.systemUiVisibility and
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
} }
if (SDK_INT >= Build.VERSION_CODES.O) { if (SDK_INT >= Build.VERSION_CODES.O) {
// API level can display handle light navigation bar color // API level can display handle light navigation bar color
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17808
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility and window.decorView.systemUiVisibility = window.decorView.systemUiVisibility and
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv() SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
} }

@ -34,12 +34,12 @@ class WifiConnectionMonitor(app: Application) {
private var isRegistered = false private var isRegistered = false
private val frameworkListener = object : ConnectivityManager.NetworkCallback() { private val frameworkListener = object : ConnectivityManager.NetworkCallback() {
override fun onLost(network: Network) { override fun onLost(network: Network?) {
notifyListeners(false) notifyListeners(false)
lastKnownStateWasAvailable = false lastKnownStateWasAvailable = false
} }
override fun onAvailable(network: Network) { override fun onAvailable(network: Network?) {
notifyListeners(true) notifyListeners(true)
lastKnownStateWasAvailable = true lastKnownStateWasAvailable = true
} }

@ -18,8 +18,6 @@ import org.robolectric.Shadows.shadowOf
@RunWith(FenixRobolectricTestRunner::class) @RunWith(FenixRobolectricTestRunner::class)
class ActivityTest { class ActivityTest {
// This will be addressed on https://github.com/mozilla-mobile/fenix/issues/17804
@Suppress("DEPRECATION")
@Test @Test
fun testEnterImmersiveMode() { fun testEnterImmersiveMode() {
val activity = Robolectric.buildActivity(Activity::class.java).create().get() val activity = Robolectric.buildActivity(Activity::class.java).create().get()

@ -13,9 +13,9 @@ import java.util.Locale
object Config { object Config {
// Synchronized build configuration for all modules // Synchronized build configuration for all modules
const val compileSdkVersion = 30 const val compileSdkVersion = 29
const val minSdkVersion = 21 const val minSdkVersion = 21
const val targetSdkVersion = 30 const val targetSdkVersion = 29
@JvmStatic @JvmStatic
private fun generateDebugVersionName(): String { private fun generateDebugVersionName(): String {

Loading…
Cancel
Save