From 9e084ec372aa9de27bb431844c5b51590db16871 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Wed, 25 May 2022 16:22:16 +0200 Subject: [PATCH] Inject permission utils --- .../java/im/vector/app/features/widgets/WidgetFragment.kt | 5 +++-- .../app/features/widgets/webview/WebviewPermissionUtils.kt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/widgets/WidgetFragment.kt b/vector/src/main/java/im/vector/app/features/widgets/WidgetFragment.kt index ed2c69c908..897f6d6279 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/WidgetFragment.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/WidgetFragment.kt @@ -64,7 +64,9 @@ data class WidgetArgs( val urlParams: Map = emptyMap() ) : Parcelable -class WidgetFragment @Inject constructor() : +class WidgetFragment @Inject constructor( + private val permissionUtils: WebviewPermissionUtils +) : VectorBaseFragment(), WebViewEventListener, WebChromeEventListener, @@ -72,7 +74,6 @@ class WidgetFragment @Inject constructor() : private val fragmentArgs: WidgetArgs by args() private val viewModel: WidgetViewModel by activityViewModel() - private val permissionUtils = WebviewPermissionUtils() override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentRoomWidgetBinding { return FragmentRoomWidgetBinding.inflate(inflater, container, false) diff --git a/vector/src/main/java/im/vector/app/features/widgets/webview/WebviewPermissionUtils.kt b/vector/src/main/java/im/vector/app/features/widgets/webview/WebviewPermissionUtils.kt index 3a39153581..2bf12dff43 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/webview/WebviewPermissionUtils.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/webview/WebviewPermissionUtils.kt @@ -26,8 +26,9 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder import im.vector.app.R import im.vector.app.core.utils.checkPermissions import java.lang.NullPointerException +import javax.inject.Inject -class WebviewPermissionUtils { +class WebviewPermissionUtils @Inject constructor() { private var permissionRequest: PermissionRequest? = null private var selectedPermissions = listOf()