mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Fix: Update updates' notifications on (un)installing/updating an app
This commit is contained in:
parent
4a5626971e
commit
dff6e32178
@ -4,7 +4,10 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.looker.droidify.database.DatabaseX
|
||||
import com.looker.droidify.entity.Order
|
||||
import com.looker.droidify.entity.Section
|
||||
import com.looker.droidify.utility.Utils.toInstalledItem
|
||||
import com.looker.droidify.utility.displayUpdatesNotification
|
||||
import com.looker.droidify.utility.extension.android.Android
|
||||
import com.looker.droidify.utility.getLaunchActivities
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -35,6 +38,18 @@ class PackageChangedReceiver : BroadcastReceiver() {
|
||||
if (packageInfo != null) db.installedDao
|
||||
.insertReplace(packageInfo.toInstalledItem(launcherActivities))
|
||||
else db.installedDao.delete(packageName)
|
||||
|
||||
// Update updates notification
|
||||
context.displayUpdatesNotification(
|
||||
db.productDao
|
||||
.queryObject(
|
||||
installed = true,
|
||||
updates = true,
|
||||
searchQuery = "",
|
||||
section = Section.All,
|
||||
order = Order.NAME
|
||||
).map { it.toItem() }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user