2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/8759 Use activityName instead of packageName as app identification

This commit is contained in:
mcarare 2020-03-23 14:14:46 +02:00 committed by Mihai Adrian
parent c42f203e39
commit 5c4e1ecfd3
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ class DefaultShareController(
override fun handleShareToApp(app: AppShareOption) { override fun handleShareToApp(app: AppShareOption) {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
recentAppsStorage.updateRecentApp(app.packageName) recentAppsStorage.updateRecentApp(app.activityName)
} }
val intent = Intent(ACTION_SEND).apply { val intent = Intent(ACTION_SEND).apply {

View File

@ -90,7 +90,7 @@ class ShareViewModel(application: Application) : AndroidViewModel(application) {
} }
val shareAppsActivities = getIntentActivities(shareIntent, getApplication()) val shareAppsActivities = getIntentActivities(shareIntent, getApplication())
var apps = buildAppsList(shareAppsActivities, getApplication()) var apps = buildAppsList(shareAppsActivities, getApplication())
recentAppsStorage.updateDatabaseWithNewApps(apps.map { app -> app.packageName }) recentAppsStorage.updateDatabaseWithNewApps(apps.map { app -> app.activityName })
val recentApps = buildRecentAppsList(apps) val recentApps = buildRecentAppsList(apps)
apps = filterOutRecentApps(apps, recentApps) apps = filterOutRecentApps(apps, recentApps)
@ -117,7 +117,7 @@ class ShareViewModel(application: Application) : AndroidViewModel(application) {
val result: MutableList<AppShareOption> = ArrayList() val result: MutableList<AppShareOption> = ArrayList()
for (recentApp in recentAppsDatabase) { for (recentApp in recentAppsDatabase) {
for (app in apps) { for (app in apps) {
if (recentApp.packageName == app.packageName) { if (recentApp.activityName == app.activityName) {
result.add(app) result.add(app)
} }
} }

View File

@ -32,7 +32,7 @@ class AppShareAdapter(
private object DiffCallback : DiffUtil.ItemCallback<AppShareOption>() { private object DiffCallback : DiffUtil.ItemCallback<AppShareOption>() {
override fun areItemsTheSame(oldItem: AppShareOption, newItem: AppShareOption) = override fun areItemsTheSame(oldItem: AppShareOption, newItem: AppShareOption) =
oldItem.packageName == newItem.packageName oldItem.activityName == newItem.activityName
override fun areContentsTheSame(oldItem: AppShareOption, newItem: AppShareOption) = override fun areContentsTheSame(oldItem: AppShareOption, newItem: AppShareOption) =
oldItem == newItem oldItem == newItem