diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cc9d3567f4..846582e3786 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ on: description: 'Gradle version' required: false type: string - default: "7.5" + default: "8.0" jobs: build: diff --git a/app/build.gradle b/app/build.gradle index 9eac12214d7..7b40301d4f4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -696,7 +696,7 @@ dependencies { // HVR hvrImplementation fileTree(dir: "${project.rootDir}/third_party/hvr", include: ['*.jar']) hvrImplementation 'com.huawei.agconnect:agconnect-core-harmony:1.1.0.300' - hvrImplementation 'com.huawei.agconnect:agconnect-core:1.6.5.300' + hvrImplementation 'com.huawei.agconnect:agconnect-core:1.9.1.301' hvrImplementation 'com.huawei.hms:hianalytics:6.3.2.300' hvrImplementation 'com.huawei.hms:ml-computer-voice-asr:3.1.0.300' hvrImplementation 'com.huawei.hms:location:6.2.0.300' diff --git a/app/src/common/gecko/com/igalia/wolvic/browser/api/impl/GeckoWebExtension.kt b/app/src/common/gecko/com/igalia/wolvic/browser/api/impl/GeckoWebExtension.kt index 4fe7a017fcf..4e2f3995811 100644 --- a/app/src/common/gecko/com/igalia/wolvic/browser/api/impl/GeckoWebExtension.kt +++ b/app/src/common/gecko/com/igalia/wolvic/browser/api/impl/GeckoWebExtension.kt @@ -342,12 +342,12 @@ class GeckoWebExtension( */ override fun getMetadata(): Metadata { return nativeExtension.metaData.let { - Metadata( + mozilla.components.concept.engine.webextension.Metadata( name = it.name, description = it.description, developerName = it.creatorName, developerUrl = it.creatorUrl, - homePageUrl = it.homepageUrl, + homepageUrl = it.homepageUrl, version = it.version, permissions = it.permissions.toList(), // Origins is marked as @NonNull but may be null: https://bugzilla.mozilla.org/show_bug.cgi?id=1629957 @@ -355,7 +355,16 @@ class GeckoWebExtension( disabledFlags = DisabledFlags.select(it.disabledFlags), optionsPageUrl = it.optionsPageUrl, openOptionsPageInTab = it.openOptionsPageInTab, - baseUrl = it.baseUrl + baseUrl = it.baseUrl, + averageRating = it.averageRating.toFloat(), + creatorName = it.creatorName, + creatorUrl = it.creatorUrl, + detailUrl = it.homepageUrl, + downloadUrl = it.downloadUrl, + fullDescription = it.fullDescription, + reviewCount = it.reviewCount, + reviewUrl = it.reviewUrl, + updateDate = it.updateDate ) } } diff --git a/app/src/common/shared/com/igalia/wolvic/addons/adapters/AddonsListViewAdapter.kt b/app/src/common/shared/com/igalia/wolvic/addons/adapters/AddonsListViewAdapter.kt index 9327b7b2c49..916fab92839 100644 --- a/app/src/common/shared/com/igalia/wolvic/addons/adapters/AddonsListViewAdapter.kt +++ b/app/src/common/shared/com/igalia/wolvic/addons/adapters/AddonsListViewAdapter.kt @@ -30,7 +30,7 @@ import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Job import kotlinx.coroutines.launch import mozilla.components.feature.addons.Addon -import mozilla.components.feature.addons.amo.AddonCollectionProvider +import mozilla.components.feature.addons.amo.AMOAddonsProvider import mozilla.components.feature.addons.ui.AddonsManagerAdapterDelegate import mozilla.components.feature.addons.ui.CustomViewHolder import mozilla.components.feature.addons.ui.CustomViewHolder.AddonViewHolder @@ -57,7 +57,7 @@ private const val VIEW_HOLDER_TYPE_ADDON = 1 */ @Suppress("TooManyFunctions", "LargeClass") class AddonsManagerAdapter( - private val addonCollectionProvider: AddonCollectionProvider, + private val addonCollectionProvider: AMOAddonsProvider, private val addonsManagerDelegate: AddonsManagerAdapterDelegate, addons: List, private val style: Style? = null @@ -105,6 +105,7 @@ class AddonsManagerAdapter( val userCountView = view.findViewById(R.id.users_count) val addButton = view.findViewById(R.id.add_button) val allowedInPrivateBrowsingLabel = view.findViewById(R.id.allowed_in_private_browsing_label) + val statusErrorView = view.findViewById(R.id.add_on_status_error_message) return AddonViewHolder( view, iconView, @@ -114,7 +115,8 @@ class AddonsManagerAdapter( ratingAccessibleView, userCountView, addButton, - allowedInPrivateBrowsingLabel + allowedInPrivateBrowsingLabel, + statusErrorView ) } @@ -158,15 +160,12 @@ class AddonsManagerAdapter( // for contentDescription for the TalkBack feature holder.ratingAccessibleView.text = ratingContentDescription holder.ratingView.rating = addon.rating!!.average - holder.userCountView.text = String.format(userCount, getFormattedAmount(addon.rating!!.reviews)) holder.ratingView.visibility = View.VISIBLE holder.ratingAccessibleView.visibility = View.VISIBLE - holder.userCountView.visibility = View.VISIBLE } else { holder.ratingView.visibility = View.GONE holder.ratingAccessibleView.visibility = View.GONE - holder.userCountView.visibility = View.GONE } val displayLanguage = LocaleUtils.getDisplayLanguage(context).locale.language @@ -236,7 +235,7 @@ class AddonsManagerAdapter( // if takes less than a second, we assume it comes // from a cache and we don't show any transition animation. val startTime = System.currentTimeMillis() - val iconBitmap = addonCollectionProvider.getAddonIconBitmap(addon) ?: addon.installedState?.icon + val iconBitmap = addon.icon?: addon.installedState?.icon val timeToFetch: Double = (System.currentTimeMillis() - startTime) / 1000.0 val isFromCache = timeToFetch < 1 if (iconBitmap != null) iconDrawable = BitmapDrawable(iconView.resources, iconBitmap) diff --git a/app/src/common/shared/com/igalia/wolvic/addons/views/AddonOptionsDetailsView.java b/app/src/common/shared/com/igalia/wolvic/addons/views/AddonOptionsDetailsView.java index e973ce0a857..866d6117646 100644 --- a/app/src/common/shared/com/igalia/wolvic/addons/views/AddonOptionsDetailsView.java +++ b/app/src/common/shared/com/igalia/wolvic/addons/views/AddonOptionsDetailsView.java @@ -79,7 +79,7 @@ public void bind(Addon addon) { // If the addon is not installed we set the homepage link mBinding.homepage.setOnClickListener(view -> { view.requestFocusFromTouch(); - mWidgetManager.openNewTabForeground(mBinding.getAddon().getSiteUrl()); + mWidgetManager.openNewTabForeground(mBinding.getAddon().getHomepageUrl()); }); bindTranslatedDescription(mBinding.addonDescription, addon); @@ -133,9 +133,7 @@ public void onClick(@NonNull View view) { private void bindAuthors(@NonNull TextView view, Addon addon) { String text = view.getContext().getString(R.string.addons_no_authors); if (addon != null) { - String authors = addon.getAuthors().stream() - .map(Addon.Author::getName) - .collect(Collectors.joining( "," )); + String authors = addon.getAuthor().getName(); if (!authors.isEmpty()) { text = authors; } diff --git a/app/src/common/shared/com/igalia/wolvic/addons/views/AddonsListView.java b/app/src/common/shared/com/igalia/wolvic/addons/views/AddonsListView.java index aeab12c9832..042a6d5a33b 100644 --- a/app/src/common/shared/com/igalia/wolvic/addons/views/AddonsListView.java +++ b/app/src/common/shared/com/igalia/wolvic/addons/views/AddonsListView.java @@ -275,4 +275,16 @@ public void onAddonsUpdated() { }); } + @Override + public void onFindMoreAddonsButtonClicked() { + } + + @Override + public boolean shouldShowFindMoreAddonsButton() { + return false; + } + + @Override + public void onLearnMoreLinkClicked(@NonNull LearnMoreLinks learnMoreLinks, @NonNull Addon addon) { + } } diff --git a/app/src/common/shared/com/igalia/wolvic/browser/Addons.kt b/app/src/common/shared/com/igalia/wolvic/browser/Addons.kt index 4fd1824ccfa..b2f88381643 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/Addons.kt +++ b/app/src/common/shared/com/igalia/wolvic/browser/Addons.kt @@ -28,7 +28,7 @@ import mozilla.components.concept.engine.webextension.Action import mozilla.components.concept.engine.webextension.EnableSource import mozilla.components.feature.addons.Addon import mozilla.components.feature.addons.AddonManager -import mozilla.components.feature.addons.amo.AddonCollectionProvider +import mozilla.components.feature.addons.amo.AMOAddonsProvider import mozilla.components.feature.addons.update.DefaultAddonUpdater import mozilla.components.feature.addons.update.GlobalAddonDependencyProvider import mozilla.components.support.base.android.NotificationsDelegate @@ -52,14 +52,14 @@ class Addons(val context: Context, private val sessionStore: SessionStore) { val addonCollectionProvider by lazy { if (BuildConfig.AMO_COLLECTION.isNotEmpty()) { - AddonCollectionProvider( + AMOAddonsProvider( context, EngineProvider.getDefaultClient(context), collectionName = BuildConfig.AMO_COLLECTION, maxCacheAgeInMinutes = DAY_IN_MINUTES ) } else { - AddonCollectionProvider( + AMOAddonsProvider( context, EngineProvider.getDefaultClient(context), maxCacheAgeInMinutes = DAY_IN_MINUTES) @@ -220,7 +220,7 @@ class Addons(val context: Context, private val sessionStore: SessionStore) { val enabled = installedExtensions[addons[i].id]?.isEnabled() ?: false val icon = CoroutineScope(Dispatchers.Main).future { try { - installedExtensions[addons[i].id]?.loadIcon(AddonManager.TEMPORARY_ADDON_ICON_SIZE) + installedExtensions[addons[i].id]?.loadIcon(AddonManager.ADDON_ICON_SIZE) } catch (throwable: Throwable) { Logger.warn("Failed to load addon icon.", throwable) null diff --git a/app/src/common/shared/com/igalia/wolvic/browser/HistoryStore.kt b/app/src/common/shared/com/igalia/wolvic/browser/HistoryStore.kt index 6bc1f7620ca..851a1cbeb5c 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/HistoryStore.kt +++ b/app/src/common/shared/com/igalia/wolvic/browser/HistoryStore.kt @@ -83,7 +83,6 @@ class HistoryStore constructor(val context: Context) { fun getDetailedHistory(): CompletableFuture?> = GlobalScope.future { storage.getDetailedVisits(0, excludeTypes = listOf( - VisitType.NOT_A_VISIT, VisitType.DOWNLOAD, VisitType.REDIRECT_TEMPORARY, VisitType.RELOAD, @@ -94,7 +93,6 @@ class HistoryStore constructor(val context: Context) { fun getVisitsPaginated(offset: Long, count: Long): CompletableFuture?> = GlobalScope.future { storage.getVisitsPaginated(offset, count, excludeTypes = listOf( - VisitType.NOT_A_VISIT, VisitType.DOWNLOAD, VisitType.REDIRECT_TEMPORARY, VisitType.RELOAD, diff --git a/app/src/common/shared/com/igalia/wolvic/browser/Services.kt b/app/src/common/shared/com/igalia/wolvic/browser/Services.kt index 48e5ba367b6..01e9ef4edde 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/Services.kt +++ b/app/src/common/shared/com/igalia/wolvic/browser/Services.kt @@ -24,6 +24,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import mozilla.appservices.Megazord +import mozilla.appservices.fxaclient.FxaServer import mozilla.appservices.rustlog.LogAdapterCannotEnable import mozilla.components.concept.sync.* import mozilla.components.service.fxa.* @@ -86,7 +87,7 @@ class Services(val context: Context, places: Places): WSession.NavigationDelegat } } } - val serverConfig = ServerConfig(if (BuildConfig.FXA_USE_CHINA_SERVER) Server.CHINA else Server.RELEASE, CLIENT_ID, REDIRECT_URL) + val serverConfig = ServerConfig(if (BuildConfig.FXA_USE_CHINA_SERVER) FxaServer.China else FxaServer.Release, CLIENT_ID, REDIRECT_URL) val accountManager = FxaAccountManager( context = context, diff --git a/app/src/common/shared/com/igalia/wolvic/browser/components/WolvicEngineSession.kt b/app/src/common/shared/com/igalia/wolvic/browser/components/WolvicEngineSession.kt index 964ead45555..b10e512e1d6 100644 --- a/app/src/common/shared/com/igalia/wolvic/browser/components/WolvicEngineSession.kt +++ b/app/src/common/shared/com/igalia/wolvic/browser/components/WolvicEngineSession.kt @@ -10,6 +10,9 @@ import com.igalia.wolvic.browser.engine.Session import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.EngineSessionState import mozilla.components.concept.engine.Settings +import mozilla.components.concept.engine.shopping.ProductAnalysis +import mozilla.components.concept.engine.shopping.ProductRecommendation +import mozilla.components.concept.engine.translate.TranslationOptions import org.json.JSONObject class WolvicEngineSession( @@ -36,13 +39,44 @@ class WolvicEngineSession( ) = Unit override fun loadData(data: String, mimeType: String, encoding: String) = Unit override fun reload(flags: LoadUrlFlags) = Unit + override fun requestAnalysisStatus( + url: String, + onResult: (String) -> Unit, + onException: (Throwable) -> Unit + ) = Unit; + override fun requestPdfToDownload() = Unit override fun requestPrintContent() = Unit + override fun requestProductAnalysis( + url: String, + onResult: (ProductAnalysis) -> Unit, + onException: (Throwable) -> Unit + ) = Unit + + override fun requestProductRecommendations( + url: String, + onResult: (List) -> Unit, + onException: (Throwable) -> Unit + ) = Unit + + override fun requestTranslate(fromLanguage: String, toLanguage: String, options: TranslationOptions?) = Unit + + override fun requestTranslationRestore() = Unit + override fun restoreState(state: EngineSessionState) = true + override fun sendClickAttributionEvent(aid: String, onResult: (Boolean) -> Unit, onException: (Throwable) -> Unit) = Unit + + override fun sendImpressionAttributionEvent(aid: String, onResult: (Boolean) -> Unit, onException: (Throwable) -> Unit) = Unit + override fun stopLoading() = Unit override fun toggleDesktopMode(enable: Boolean, reload: Boolean) = Unit override fun updateTrackingProtection(policy: TrackingProtectionPolicy) = Unit override fun purgeHistory() = Unit; + override fun reanalyzeProduct( + url: String, + onResult: (String) -> Unit, + onException: (Throwable) -> Unit + ) = Unit; } private class DummyEngineSessionState : EngineSessionState { diff --git a/app/src/common/shared/com/igalia/wolvic/search/SearchEngineWrapper.kt b/app/src/common/shared/com/igalia/wolvic/search/SearchEngineWrapper.kt index 26c0032d2d9..2dbbd4fce2e 100644 --- a/app/src/common/shared/com/igalia/wolvic/search/SearchEngineWrapper.kt +++ b/app/src/common/shared/com/igalia/wolvic/search/SearchEngineWrapper.kt @@ -210,7 +210,7 @@ class SearchEngineWrapper private constructor(aContext: Context) : private get() = if (hasContext() && context is VRBrowserActivity) context as VRBrowserActivity? else null // SharedPreferences.OnSharedPreferenceChangeListener - override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) { + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { if (mContextRef.get() != null) { if (key == mContextRef.get()!! .getString(R.string.settings_key_geolocation_data) || key == mContextRef.get()!! diff --git a/app/src/common/shared/com/igalia/wolvic/ui/adapters/HistoryAdapter.java b/app/src/common/shared/com/igalia/wolvic/ui/adapters/HistoryAdapter.java index b0ffb5ace04..09999c183b0 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/adapters/HistoryAdapter.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/adapters/HistoryAdapter.java @@ -112,7 +112,7 @@ public void removeItem(VisitInfo historyItem) { public int itemCount() { if (mHistoryList != null) { return mHistoryList.stream().allMatch(item -> - item.getVisitType() == VisitType.NOT_A_VISIT) ? + item.getVisitType() == VisitType.TYPED) ? 0 : mHistoryList.size(); } @@ -271,7 +271,7 @@ public int getItemViewType(int position) { } private boolean isPositionHeader(int position) { - return mHistoryList.get(position).getVisitType() == VisitType.NOT_A_VISIT; + return mHistoryList.get(position).getVisitType() == VisitType.TYPED; } private View.OnHoverListener mIconHoverListener = (view, motionEvent) -> { diff --git a/app/src/common/shared/com/igalia/wolvic/ui/views/library/HistoryView.java b/app/src/common/shared/com/igalia/wolvic/ui/views/library/HistoryView.java index 8b72fbc806a..5923dc41e97 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/views/library/HistoryView.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/views/library/HistoryView.java @@ -403,7 +403,7 @@ private void updateHistory() { private void addSection(final @NonNull List items, @NonNull String section, long rangeStart, long rangeEnd) { for (int i = 0; i < items.size(); i++) { - if (items.get(i).getVisitTime() == rangeStart && items.get(i).getVisitType() == VisitType.NOT_A_VISIT) + if (items.get(i).getVisitTime() == rangeStart && items.get(i).getVisitType() == VisitType.TYPED) break; if (items.get(i).getVisitTime() < rangeStart && items.get(i).getVisitTime() > rangeEnd) { @@ -411,7 +411,7 @@ private void addSection(final @NonNull List items, @NonNull String se section, section, rangeStart, - VisitType.NOT_A_VISIT, + VisitType.TYPED, null, false )); diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7da60261e29..34d0b3d22a3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,7 +29,6 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:extractNativeLibs="true" android:theme="@style/FxR.Dark"> + + + # Metrics @@ -11,5 +11,5 @@ This means you might have to go searching through the dependency tree to get a f Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection). - + diff --git a/gradle.properties b/gradle.properties index 7650c6c9dd5..a6f549e822a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,3 +23,7 @@ android.injected.testOnly=false android.useAndroidX=true android.enableJetifier=true + +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 289f5c14975..7f7ce3dc422 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Jul 21 16:13:31 CEST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/versions.gradle b/versions.gradle index 92ea907a129..34be340741a 100644 --- a/versions.gradle +++ b/versions.gradle @@ -24,20 +24,20 @@ ext.deps = [:] def versions = [:] // GeckoView versions can be found here: // https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/ -versions.gecko_view_release = "116.0.20230815173142" -versions.gecko_view_nightly = "116.0.20230703204942" -versions.gecko_view_beta = "116.0.20230720200012" -versions.android_components = "116.3.0" +versions.gecko_view_release = "121.0.20240108143603" +versions.gecko_view_nightly = "121.0.20231120095246" +versions.gecko_view_beta = "121.0.20231208091859" +versions.android_components = "121.1.0" // Note that android-components also depends on application-services, // and in fact is our main source of appservices-related functionality. // The version number below tracks the application-services version // that we depend on directly for its rustlog package, and it's important // that it be kept insync with the version used by android-components above. -versions.mozilla_appservices = "116.0" +versions.mozilla_appservices = "120.0.2" versions.room = "2.5.2" -versions.lifecycle = "2.6.1" +versions.lifecycle = "2.6.2" versions.cardview = "1.0.0" -versions.recyclerview = "1.3.1" +versions.recyclerview = "1.3.2" versions.constraint_layout = "2.1.4" versions.junit = "4.13.2" versions.atsl_core = "1.5.0" @@ -45,12 +45,12 @@ versions.atsl_runner = "1.5.2" versions.atsl_rules = "1.5.0" versions.atsl_junit = "1.1.5" versions.espresso = "3.5.1" -versions.android_gradle_plugin = "7.4.2" -versions.kotlin = "1.8.22" +versions.android_gradle_plugin = '8.2.0' +versions.kotlin = "1.9.21" versions.kotlin_coroutines = "1.7.3" versions.snakeyaml = "2.0" versions.gson = "2.10.1" -versions.robolectric = "4.10.3" +versions.robolectric = "4.11.1" versions.work = "2.8.1" versions.jna = "5.13.0" versions.wavevr = "3.2.0" @@ -185,13 +185,13 @@ ext.deps = deps def build_versions = [:] build_versions.min_sdk = 24 build_versions.min_sdk_wave = 25 -build_versions.target_sdk = 33 +build_versions.target_sdk = 34 build_versions.target_sdk_oculusvr = 32 build_versions.target_sdk_wave = 31 build_versions.target_sdk_aosp = 29 build_versions.target_sdk_spaces = 29 -build_versions.compile_sdk = 33 -build_versions.build_tools = "30.0.3" +build_versions.compile_sdk = 34 +build_versions.build_tools = "34.0.0" ext.build_versions = build_versions ext.deps = deps