Skip to content

Commit e367bd9

Browse files
authored
Merge pull request #2132 from OneSignal/fix/NotificationPermissionController_methods
[fix] NotificationPermissionController fix an override method signature
2 parents 6e65b5f + 9482a93 commit e367bd9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/permissions/impl/NotificationPermissionController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ internal class NotificationPermissionController(
8787
private fun registerPollingLifecycleListener() {
8888
_applicationService.addApplicationLifecycleHandler(
8989
object : ApplicationLifecycleHandlerBase() {
90-
override fun onFocus() {
91-
super.onFocus()
90+
override fun onFocus(firedOnSubscribe: Boolean) {
91+
super.onFocus(firedOnSubscribe)
9292
pollingWaitInterval = _configModelStore.model.foregroundFetchNotificationPermissionInterval
9393
pollingWaiter.wake()
9494
}

OneSignalSDK/onesignal/notifications/src/test/java/com/onesignal/notifications/internal/permission/NotificationPermissionControllerTests.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class NotificationPermissionControllerTests : FunSpec({
6161
// call onFocus to set the proper polling interval.
6262
// This happens when registering the lifecycle handler
6363
for (focusHandler in focusHandlerList) {
64-
focusHandler.onFocus()
64+
focusHandler.onFocus(false)
6565
}
6666

6767
// When
@@ -99,7 +99,7 @@ class NotificationPermissionControllerTests : FunSpec({
9999
// call onFocus to set the proper polling interval.
100100
// This happens when registering the lifecycle handler
101101
for (focusHandler in handlerList) {
102-
focusHandler.onFocus()
102+
focusHandler.onFocus(false)
103103
}
104104

105105
// When
@@ -142,7 +142,7 @@ class NotificationPermissionControllerTests : FunSpec({
142142
// call onFocus to set the proper polling interval.
143143
// This happens when registering the lifecycle handler
144144
for (focusHandler in handlerList) {
145-
focusHandler.onFocus()
145+
focusHandler.onFocus(false)
146146
}
147147

148148
// When
@@ -156,7 +156,7 @@ class NotificationPermissionControllerTests : FunSpec({
156156
delay(100)
157157
// the app regains focus
158158
for (handler in handlerList) {
159-
handler.onFocus()
159+
handler.onFocus(false)
160160
}
161161
delay(5)
162162

0 commit comments

Comments
 (0)