diff --git a/app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/TrackerBlockingVpnService.kt b/app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/TrackerBlockingVpnService.kt index dee49845fb8f..55315fc0f444 100644 --- a/app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/TrackerBlockingVpnService.kt +++ b/app-tracking-protection/vpn-impl/src/main/java/com/duckduckgo/mobile/android/vpn/service/TrackerBlockingVpnService.kt @@ -610,9 +610,17 @@ class TrackerBlockingVpnService : VpnService(), CoroutineScope by MainScope(), V */ private fun notifyVpnStart(): Boolean { val emptyNotification = VpnEnabledNotificationContentPlugin.VpnEnabledNotificationContent.EMPTY - val vpnNotification: VpnEnabledNotificationContentPlugin.VpnEnabledNotificationContent = - vpnEnabledNotificationContentPluginPoint.getHighestPriorityPlugin()?.getInitialContent() - ?: emptyNotification + var vpnNotification: VpnEnabledNotificationContentPlugin.VpnEnabledNotificationContent = emptyNotification + for (retries in 1..20) { + vpnNotification = + vpnEnabledNotificationContentPluginPoint.getHighestPriorityPlugin()?.getInitialContent() + ?: emptyNotification + + if (vpnNotification != emptyNotification) { + logcat { "Notification in retry: $retries" } + break + } + } startForeground( VPN_FOREGROUND_SERVICE_ID,