diff --git a/app/src/main/java/org/mozilla/fenix/share/ShareController.kt b/app/src/main/java/org/mozilla/fenix/share/ShareController.kt index 6257bea3b9..553ee877c3 100644 --- a/app/src/main/java/org/mozilla/fenix/share/ShareController.kt +++ b/app/src/main/java/org/mozilla/fenix/share/ShareController.kt @@ -84,7 +84,7 @@ class DefaultShareController( override fun handleShareToApp(app: AppShareOption) { lifecycleScope.launch(Dispatchers.IO) { - recentAppsStorage.updateRecentApp(app.packageName) + recentAppsStorage.updateRecentApp(app.activityName) } val intent = Intent(ACTION_SEND).apply { diff --git a/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt b/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt index bd7d558371..0dd4756309 100644 --- a/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt +++ b/app/src/main/java/org/mozilla/fenix/share/ShareViewModel.kt @@ -90,7 +90,7 @@ class ShareViewModel(application: Application) : AndroidViewModel(application) { } val shareAppsActivities = getIntentActivities(shareIntent, getApplication()) var apps = buildAppsList(shareAppsActivities, getApplication()) - recentAppsStorage.updateDatabaseWithNewApps(apps.map { app -> app.packageName }) + recentAppsStorage.updateDatabaseWithNewApps(apps.map { app -> app.activityName }) val recentApps = buildRecentAppsList(apps) apps = filterOutRecentApps(apps, recentApps) @@ -117,7 +117,7 @@ class ShareViewModel(application: Application) : AndroidViewModel(application) { val result: MutableList = ArrayList() for (recentApp in recentAppsDatabase) { for (app in apps) { - if (recentApp.packageName == app.packageName) { + if (recentApp.activityName == app.activityName) { result.add(app) } } diff --git a/app/src/main/java/org/mozilla/fenix/share/listadapters/AppShareAdapter.kt b/app/src/main/java/org/mozilla/fenix/share/listadapters/AppShareAdapter.kt index 6c722dd5e5..1647e36018 100644 --- a/app/src/main/java/org/mozilla/fenix/share/listadapters/AppShareAdapter.kt +++ b/app/src/main/java/org/mozilla/fenix/share/listadapters/AppShareAdapter.kt @@ -32,7 +32,7 @@ class AppShareAdapter( private object DiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame(oldItem: AppShareOption, newItem: AppShareOption) = - oldItem.packageName == newItem.packageName + oldItem.activityName == newItem.activityName override fun areContentsTheSame(oldItem: AppShareOption, newItem: AppShareOption) = oldItem == newItem