From 5f982815db48658540340f8a5429613d75144c45 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Fri, 12 Apr 2024 14:51:17 +0300 Subject: [PATCH] Fixes LongMethod detekt issue --- .../java/org/wordpress/android/AppInitializer.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt index 6e0cbc2eee04..42d081b4f8d6 100644 --- a/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt +++ b/WordPress/src/main/java/org/wordpress/android/AppInitializer.kt @@ -367,10 +367,7 @@ class AppInitializer @Inject constructor( exPlat.forceRefresh() - if (buildConfig.isDebugSettingsEnabled()) { - debugCookieManager = DebugCookieManager(application, cookieManager, buildConfig) - debugCookieManager.sync() - } + initDebugCookieManager() if (!initialized && BuildConfig.DEBUG && Build.VERSION.SDK_INT >= VERSION_CODES.R) { initAppOpsManager() @@ -381,6 +378,13 @@ class AppInitializer @Inject constructor( initialized = true } + private fun initDebugCookieManager() { + if (buildConfig.isDebugSettingsEnabled()) { + debugCookieManager = DebugCookieManager(application, cookieManager, buildConfig) + debugCookieManager.sync() + } + } + /** * Data access auditing * @link https://developer.android.com/guide/topics/data/audit-access