summaryrefslogtreecommitdiff
path: root/privacymodule-api
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 /privacymodule-api
parentae2feae022ba6485b020afa6b5f5c78049ecf1d4 (diff)
5648: display trackers for pro-profile app instances.
Diffstat (limited to 'privacymodule-api')
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt8
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt13
2 files changed, 18 insertions, 3 deletions
diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt
index 9d7e675..d0e2e75 100644
--- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt
+++ b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 E FOUNDATION
+ * Copyright (C) 2021 E FOUNDATION, 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
@@ -150,7 +150,7 @@ abstract class APermissionsPrivacyModule(protected val context: Context) : IPerm
packageName = appInfo.packageName,
uid = appInfo.uid,
label = getAppLabel(appInfo),
- icon = if (withIcon) getApplicationIcon(appInfo.packageName) else null
+ icon = if (withIcon) getApplicationIcon(appInfo) else null
)
}
@@ -158,6 +158,10 @@ abstract class APermissionsPrivacyModule(protected val context: Context) : IPerm
return context.packageManager.getApplicationLabel(appInfo)
}
+ private fun getApplicationIcon(appInfo: ApplicationInfo): Drawable? {
+ return context.packageManager.getApplicationIcon(appInfo)
+ }
+
override fun getApplicationIcon(packageName: String): Drawable? {
return context.packageManager.getApplicationIcon(packageName)
}
diff --git a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt
index ff0b3d7..b64762f 100644
--- a/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt
+++ b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 E FOUNDATION
+ * Copyright (C) 2021 E FOUNDATION, 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,7 @@ package foundation.e.privacymodules.permissions
import android.app.NotificationChannel
import android.content.pm.ApplicationInfo
+import android.content.pm.PackageInfo
import android.graphics.drawable.Drawable
import foundation.e.privacymodules.permissions.data.AppOpModes
import foundation.e.privacymodules.permissions.data.ApplicationDescription
@@ -34,6 +35,16 @@ interface IPermissionsPrivacyModule {
withIcon: Boolean = true
): ApplicationDescription
+ fun getApplications(
+ filter: ((PackageInfo) -> Boolean)?,
+ withIcon: Boolean
+ ): List<ApplicationDescription>
+
+ fun getWorkProfileApplications(
+ filter: ((PackageInfo) -> Boolean)?,
+ withIcon: Boolean
+ ): List<ApplicationDescription>
+
/**
* List the installed application on the device which have not the FLAGS_SYSTEM.
* @return list of filled up [ApplicationDescription]