Exclude ourselves from backup status

This commit is contained in:
Torsten Grote 2024-10-16 08:54:41 -03:00
parent f5c2f0bd3a
commit 321c04958c
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF

View file

@ -107,7 +107,11 @@ internal class AppListRetriever(
val locale = Locale.getDefault()
return (userApps + packageService.launchableSystemApps.mapNotNull {
val packageName = it.activityInfo.packageName
if (packageName in userPackages) return@mapNotNull null
if (packageName in userPackages || packageName == context.packageName) {
// don't re-add user packages again,
// also on some ROMs we are a launchableSystemApp, so we need to exclude ourselves
return@mapNotNull null
}
val metadata = metadataManager.getPackageMetadata(packageName)
AppStatus(
packageName = packageName,