Target Android 11

upstream-sync
Arturo Mejia 3 years ago
parent 9e20de21a8
commit 0e8dc6164d

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

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

@ -17,6 +17,8 @@ import mozilla.components.concept.base.crash.Breadcrumb
*/
fun Activity.enterToImmersiveMode() {
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
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION

@ -100,6 +100,8 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
super.onStop()
// https://github.com/mozilla-mobile/fenix/issues/14279
// 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
@Suppress("DEPRECATION")
requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
}

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

@ -44,23 +44,23 @@ class VisibilityLifecycleCallback(private val activityManager: ActivityManager?)
return false
}
override fun onActivityStarted(activity: Activity?) {
override fun onActivityStarted(activity: Activity) {
activitiesInStartedState++
}
override fun onActivityStopped(activity: Activity?) {
override fun onActivityStopped(activity: Activity) {
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 {
/**

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

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

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

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

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

@ -76,7 +76,8 @@ abstract class ThemeManager {
private fun updateLightSystemBars(window: Window, context: Context) {
if (SDK_INT >= Build.VERSION_CODES.M) {
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 or SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
@ -85,6 +86,8 @@ abstract class ThemeManager {
if (SDK_INT >= Build.VERSION_CODES.O) {
// 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 or SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
updateNavigationBar(window, context)
@ -93,12 +96,16 @@ abstract class ThemeManager {
private fun clearLightSystemBars(window: Window) {
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
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv()
}
if (SDK_INT >= Build.VERSION_CODES.O) {
// 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
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
}

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

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

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

Loading…
Cancel
Save