Fix build after merge

pull/415/head
Adam Novak 3 years ago
parent a77b05cdc7
commit e7dbec421e

@ -5,8 +5,6 @@
package com.google.android.gms.ads.identifier;
import android.content.Context;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
public class AdvertisingIdClient {
@ -34,7 +32,7 @@ public class AdvertisingIdClient {
}
public static Info getAdvertisingIdInfo(Context context) throws GooglePlayServicesNotAvailableException, GooglePlayServicesRepairableException {
public static Info getAdvertisingIdInfo(Context context) {
return new Info();
}

@ -27,13 +27,13 @@ import androidx.appcompat.app.AppCompatDialogFragment
import androidx.appcompat.widget.AppCompatCheckBox
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentManager
import kotlinx.android.synthetic.main.mozac_feature_addons_fragment_dialog_addon_installed.view.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import mozilla.components.feature.addons.Addon
import mozilla.components.feature.addons.R
import mozilla.components.feature.addons.databinding.MozacFeatureAddonsFragmentDialogAddonInstalledBinding
import mozilla.components.feature.addons.ui.translateName
import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.ktx.android.content.appName
@ -154,6 +154,8 @@ class PagedAddonInstallationDialogFragment : AppCompatDialogFragment() {
null,
false
)
val binding = MozacFeatureAddonsFragmentDialogAddonInstalledBinding.bind(rootView)
rootView.findViewById<TextView>(R.id.title).text =
requireContext().getString(
@ -164,9 +166,9 @@ class PagedAddonInstallationDialogFragment : AppCompatDialogFragment() {
val icon = safeArguments.getParcelable<Bitmap>(KEY_ICON)
if (icon != null) {
rootView.icon.setImageDrawable(BitmapDrawable(resources, icon))
binding.icon.setImageDrawable(BitmapDrawable(resources, icon))
} else {
iconJob = fetchIcon(addon, rootView.icon)
iconJob = fetchIcon(addon, binding.icon)
}
val allowedInPrivateBrowsing = rootView.findViewById<AppCompatCheckBox>(R.id.allow_in_private_browsing)
@ -182,7 +184,7 @@ class PagedAddonInstallationDialogFragment : AppCompatDialogFragment() {
if (confirmButtonBackgroundColor != DEFAULT_VALUE) {
val backgroundTintList =
ContextCompat.getColorStateList(requireContext(), confirmButtonBackgroundColor)
ContextCompat.getColorStateList(requireContext(), confirmButtonBackgroundColor)
confirmButton.backgroundTintList = backgroundTintList
}
@ -223,7 +225,9 @@ class PagedAddonInstallationDialogFragment : AppCompatDialogFragment() {
val context = iconView.context
val att = context.theme.resolveAttribute(android.R.attr.textColorPrimary)
iconView.setColorFilter(ContextCompat.getColor(context, att))
iconView.setImageDrawable(context.getDrawable(R.drawable.mozac_ic_extensions))
iconView.setImageDrawable(
ContextCompat.getDrawable(context, R.drawable.mozac_ic_extensions)
)
}
logger.error("Attempt to fetch the ${addon.id} icon failed", e)
}

@ -23,9 +23,6 @@ import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.fragment_add_ons_management.addonProgressOverlay
import kotlinx.android.synthetic.main.fragment_add_ons_management.view.add_ons_empty_message
import kotlinx.android.synthetic.main.fragment_add_ons_management.view.add_ons_list
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.launch
@ -134,15 +131,11 @@ class AddonsManagementFragment : Fragment(R.layout.fragment_add_ons_management)
adapter?.updateAddons(searchedAddons)
if (searchedAddons.isEmpty()) {
view?.let { view ->
view.add_ons_empty_message.visibility = View.VISIBLE
view.add_ons_list.visibility = View.GONE
}
binding?.addOnsEmptyMessage?.visibility = View.VISIBLE
binding?.addOnsList?.visibility = View.GONE
} else {
view?.let { view ->
view.add_ons_empty_message.visibility = View.GONE
view.add_ons_list.visibility = View.VISIBLE
}
binding?.addOnsEmptyMessage?.visibility = View.GONE
binding?.addOnsList?.visibility = View.VISIBLE
}
}

@ -8,8 +8,6 @@ import android.content.Context
import android.util.Base64
import androidx.annotation.VisibleForTesting
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import com.google.android.gms.common.GooglePlayServicesNotAvailableException
import com.google.android.gms.common.GooglePlayServicesRepairableException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import mozilla.components.browser.state.search.SearchEngine
@ -90,12 +88,6 @@ object MetricsUtils {
internal fun getAdvertisingID(context: Context): String? {
return try {
AdvertisingIdClient.getAdvertisingIdInfo(context).id
} catch (e: GooglePlayServicesNotAvailableException) {
Logger.debug("ActivationPing - Google Play not installed on the device")
null
} catch (e: GooglePlayServicesRepairableException) {
Logger.debug("ActivationPing - recoverable error connecting to Google Play Services")
null
} catch (e: IllegalStateException) {
// This is unlikely to happen, as this should be running off the main thread.
Logger.debug("ActivationPing - AdvertisingIdClient must be called off the main thread")

Loading…
Cancel
Save