From f8d19823ea9be0c8700a69a215fac7d3af4d6d87 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Tue, 4 Oct 2022 08:34:34 +0200 Subject: 5561: display name of other VPNrunning always on. --- .../permissions/APermissionsPrivacyModule.kt | 6 ++++-- .../permissions/IPermissionsPrivacyModule.kt | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'privacymodule-api/src') 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 -- cgit v1.2.1