From dc1abb79781af776315cd7b673225ffd4f648a96 Mon Sep 17 00:00:00 2001 From: yostyle Date: Fri, 23 Sep 2022 15:46:09 +0200 Subject: [PATCH] Add Activities of android permission controller in the whitelist --- .../features/lifecycle/VectorActivityLifecycleCallbacks.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/lifecycle/VectorActivityLifecycleCallbacks.kt b/vector/src/main/java/im/vector/app/features/lifecycle/VectorActivityLifecycleCallbacks.kt index c884843f5c..6fc1bcf6c7 100644 --- a/vector/src/main/java/im/vector/app/features/lifecycle/VectorActivityLifecycleCallbacks.kt +++ b/vector/src/main/java/im/vector/app/features/lifecycle/VectorActivityLifecycleCallbacks.kt @@ -33,6 +33,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.matrix.android.sdk.api.extensions.tryOrNull import timber.log.Timber class VectorActivityLifecycleCallbacks constructor(private val popupAlertManager: PopupAlertManager) : Application.ActivityLifecycleCallbacks { @@ -94,9 +95,13 @@ class VectorActivityLifecycleCallbacks constructor(private val popupAlertManager val context = activity.applicationContext val packageManager: PackageManager = context.packageManager - // Get all activities from app manifest + // Get all activities from element android and android permission controller app if (activitiesInfo.isEmpty()) { activitiesInfo = packageManager.getPackageInfo(context.packageName, PackageManager.GET_ACTIVITIES).activities + + activitiesInfo += tryOrNull { + packageManager.getPackageInfo("com.google.android.permissioncontroller", PackageManager.GET_ACTIVITIES).activities + } ?: emptyArray() } // Get all running activities on app task