summaryrefslogtreecommitdiff
path: root/permissionsstandalone/src/main/java/foundation/e/privacymodules
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-01-02 08:35:20 +0000
committerGuillaume Jacquart <guillaume.jacquart@hoodbrains.com>2023-01-02 08:35:20 +0000
commitf1d5b12dd11019508208571db5e5f57f43e3c4b6 (patch)
treeaf6a9f8aaf75beba32cce096e2ec19a8a319d6d3 /permissionsstandalone/src/main/java/foundation/e/privacymodules
parentae2feae022ba6485b020afa6b5f5c78049ecf1d4 (diff)
5648: display trackers for pro-profile app instances.
Diffstat (limited to 'permissionsstandalone/src/main/java/foundation/e/privacymodules')
-rw-r--r--permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt20
1 files changed, 19 insertions, 1 deletions
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 52dfd08..da7c73e 100644
--- a/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt
+++ b/permissionsstandalone/src/main/java/foundation/e/privacymodules/permissions/PermissionsPrivacyModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 E FOUNDATION
+ * Copyright (C) 2022 MURENA SAS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,6 +19,8 @@ package foundation.e.privacymodules.permissions
import android.app.NotificationChannel
import android.content.Context
+import android.content.pm.PackageInfo
+import android.content.pm.PackageManager
import foundation.e.privacymodules.permissions.data.AppOpModes
import foundation.e.privacymodules.permissions.data.ApplicationDescription
@@ -26,6 +28,22 @@ import foundation.e.privacymodules.permissions.data.ApplicationDescription
* Implements [IPermissionsPrivacyModule] using only API authorized on the PlayStore.
*/
class PermissionsPrivacyModule(context: Context) : APermissionsPrivacyModule(context) {
+ override fun getApplications(
+ filter: ((PackageInfo) -> Boolean)?,
+ withIcon: Boolean
+ ): List<ApplicationDescription> {
+ return context.packageManager.getInstalledPackages(PackageManager.GET_PERMISSIONS)
+ .filter { filter?.invoke(it) == true }
+ .map { buildApplicationDescription(it.applicationInfo, withIcon = withIcon) }
+ }
+
+ override fun getWorkProfileApplications(
+ filter: ((PackageInfo) -> Boolean)?,
+ withIcon: Boolean
+ ): List<ApplicationDescription> {
+ return emptyList()
+ }
+
/**
* @see IPermissionsPrivacyModule.toggleDangerousPermission
* Return an ManualAction to go toggle manually the permission in the ap page of the settings.