summaryrefslogtreecommitdiff
path: root/privacymodule-api/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'privacymodule-api/src/main')
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt6
-rw-r--r--privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt15
2 files changed, 14 insertions, 7 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 68f7ee1..1fcfd44 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
@@ -59,9 +59,11 @@ abstract class APermissionsPrivacyModule(protected val context: Context): IPermi
/**
* @see IPermissionsPrivacyModule.getInstalledApplications
*/
- override fun getApplicationDescription(packageName: String): ApplicationDescription {
+ override fun getApplicationDescription(packageName: String, withIcon: Boolean): ApplicationDescription {
val appDesc = buildApplicationDescription(context.packageManager.getApplicationInfo(packageName, 0), false)
- appDesc.icon = getApplicationIcon(appDesc.packageName)
+ if (withIcon) {
+ appDesc.icon = getApplicationIcon(appDesc.packageName)
+ }
return appDesc
}
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 ba85f13..8eb3fd4 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
@@ -28,7 +28,10 @@ import foundation.e.privacymodules.permissions.data.PermissionDescription
*/
interface IPermissionsPrivacyModule {
- fun buildApplicationDescription(appInfo: ApplicationInfo, withIcon: Boolean = true): ApplicationDescription
+ fun buildApplicationDescription(
+ appInfo: ApplicationInfo,
+ withIcon: Boolean = true
+ ): ApplicationDescription
/**
* List the installed application on the device which have not the FLAGS_SYSTEM.
@@ -51,13 +54,12 @@ interface IPermissionsPrivacyModule {
fun getPermissionDescription(permissionName: String): PermissionDescription
-
/**
* Get the filled up [ApplicationDescription] for the app specified by its [packageName]
* @param packageName the appId of the app
* @return the informations about the app.
*/
- fun getApplicationDescription(packageName: String): ApplicationDescription
+ fun getApplicationDescription(packageName: String, withIcon: Boolean = true): ApplicationDescription
/**
* Check if the current runtime permission is granted for the specified app.
@@ -68,7 +70,6 @@ interface IPermissionsPrivacyModule {
*/
fun isDangerousPermissionGranted(packageName: String, permissionName: String): Boolean
-
/**
* Get the appOps mode for the specified [appOpPermissionName] of the specified application.
*
@@ -94,7 +95,6 @@ interface IPermissionsPrivacyModule {
grant: Boolean
): Boolean
-
/**
* Change the appOp Mode for the specified appOpPermission and application.
* @param appDesc the application
@@ -124,4 +124,9 @@ interface IPermissionsPrivacyModule {
*/
fun setVpnPackageAuthorization(packageName: String): Boolean
+ /**
+ * Returns the package name of the currently set always-on VPN application, or null.
+ */
+ fun getAlwaysOnVpnPackage(): String?
+
} \ No newline at end of file