1
0
Fork 0

For #8759 Use activityName instead of packageName as app identification

master
mcarare 2020-03-23 14:14:46 +02:00 committed by Mihai Adrian
parent f23b9fcb89
commit 7fbb1640b6
3 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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)
}
}

View File

@ -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