From 6068cebe972e000872e4780dd9f75680a3abf073 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Fri, 21 Apr 2023 06:25:54 +0000 Subject: 6556: add AdvancedPrivacy App Id in trackers stats to avoid appUid aliasing --- .../privacymodules/permissions/PermissionsPrivacyModule.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'permissionsstandalone/src') diff --git a/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt b/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt index da7c73e..283b417 100644 --- a/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt +++ b/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt @@ -21,6 +21,7 @@ import android.app.NotificationChannel import android.content.Context import android.content.pm.PackageInfo import android.content.pm.PackageManager +import android.graphics.drawable.Drawable import foundation.e.privacymodules.permissions.data.AppOpModes import foundation.e.privacymodules.permissions.data.ApplicationDescription @@ -29,19 +30,15 @@ import foundation.e.privacymodules.permissions.data.ApplicationDescription */ class PermissionsPrivacyModule(context: Context) : APermissionsPrivacyModule(context) { override fun getApplications( - filter: ((PackageInfo) -> Boolean)?, - withIcon: Boolean + filter: ((PackageInfo) -> Boolean)? ): List { return context.packageManager.getInstalledPackages(PackageManager.GET_PERMISSIONS) .filter { filter?.invoke(it) == true } - .map { buildApplicationDescription(it.applicationInfo, withIcon = withIcon) } + .map { buildApplicationDescription(it.applicationInfo) } } - override fun getWorkProfileApplications( - filter: ((PackageInfo) -> Boolean)?, - withIcon: Boolean - ): List { - return emptyList() + override fun getApplicationIcon(app: ApplicationDescription): Drawable? { + return getApplicationIcon(app.packageName) } /** -- cgit v1.2.1