From 9482a93fdabaf2bcce8d5fd1818bfff7844a7aa8 Mon Sep 17 00:00:00 2001 From: Nan Date: Tue, 18 Jun 2024 12:48:27 -0700 Subject: [PATCH] update an override method signature * This code was originally created in https://github.com/OneSignal/OneSignal-Android-SDK/pull/2112 * A parallel PR made a change to the method signature of `onFocus` --- .../permissions/impl/NotificationPermissionController.kt | 4 ++-- .../permission/NotificationPermissionControllerTests.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/permissions/impl/NotificationPermissionController.kt b/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/permissions/impl/NotificationPermissionController.kt index a17661b94..59bc6459f 100644 --- a/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/permissions/impl/NotificationPermissionController.kt +++ b/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/permissions/impl/NotificationPermissionController.kt @@ -87,8 +87,8 @@ internal class NotificationPermissionController( private fun registerPollingLifecycleListener() { _applicationService.addApplicationLifecycleHandler( object : ApplicationLifecycleHandlerBase() { - override fun onFocus() { - super.onFocus() + override fun onFocus(firedOnSubscribe: Boolean) { + super.onFocus(firedOnSubscribe) pollingWaitInterval = _configModelStore.model.foregroundFetchNotificationPermissionInterval pollingWaiter.wake() } diff --git a/OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/permission/NotificationPermissionControllerTests.kt b/OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/permission/NotificationPermissionControllerTests.kt index be1e290c6..59665fc21 100644 --- a/OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/permission/NotificationPermissionControllerTests.kt +++ b/OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/permission/NotificationPermissionControllerTests.kt @@ -61,7 +61,7 @@ class NotificationPermissionControllerTests : FunSpec({ // call onFocus to set the proper polling interval. // This happens when registering the lifecycle handler for (focusHandler in focusHandlerList) { - focusHandler.onFocus() + focusHandler.onFocus(false) } // When @@ -99,7 +99,7 @@ class NotificationPermissionControllerTests : FunSpec({ // call onFocus to set the proper polling interval. // This happens when registering the lifecycle handler for (focusHandler in handlerList) { - focusHandler.onFocus() + focusHandler.onFocus(false) } // When @@ -142,7 +142,7 @@ class NotificationPermissionControllerTests : FunSpec({ // call onFocus to set the proper polling interval. // This happens when registering the lifecycle handler for (focusHandler in handlerList) { - focusHandler.onFocus() + focusHandler.onFocus(false) } // When @@ -156,7 +156,7 @@ class NotificationPermissionControllerTests : FunSpec({ delay(100) // the app regains focus for (handler in handlerList) { - handler.onFocus() + handler.onFocus(false) } delay(5)