Commit 7fbb1640 authored by mcarare's avatar mcarare Committed by Mihai Adrian
Browse files

For #8759 Use activityName instead of packageName as app identification

parent f23b9fcb
......@@ -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 {
......
......@@ -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<AppShareOption> = ArrayList()
for (recentApp in recentAppsDatabase) {
for (app in apps) {
if (recentApp.packageName == app.packageName) {
if (recentApp.activityName == app.activityName) {
result.add(app)
}
}
......
......@@ -32,7 +32,7 @@ class AppShareAdapter(
private object DiffCallback : DiffUtil.ItemCallback<AppShareOption>() {
override fun areItemsTheSame(oldItem: AppShareOption, newItem: AppShareOption) =
oldItem.packageName == newItem.packageName
oldItem.activityName == newItem.activityName
override fun areContentsTheSame(oldItem: AppShareOption, newItem: AppShareOption) =
oldItem == newItem
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment