summaryrefslogtreecommitdiff
path: root/privacymodule-api
diff options
context:
space:
mode:
authorGuillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com>2022-10-04 08:34:34 +0200
committerGuillaume Jacquart <guillaume.jacquart-ext@mousquetaires.com>2022-10-26 14:01:43 +0200
commitf8d19823ea9be0c8700a69a215fac7d3af4d6d87 (patch)
tree1a6cf3ef0903dfd52bd40db55cebfa19e046fbd9 /privacymodule-api
parent7c41d557a3523abc202b0d0a09835f79a85c1947 (diff)
5561: display name of other VPNrunning always on.
Diffstat (limited to 'privacymodule-api')
-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