Description
The timer feature has a native-channel contract mismatch.
Flutter invokes timer methods that are not fully implemented on the Android side, and TimerRingController also sends one foregrounding call over the wrong channel.
Affected Code
lib/app/modules/timer/controllers/timer_controller.dart
lib/app/modules/timerRing/controllers/timer_ring_controller.dart
android/app/src/main/kotlin/com/ccextractor/ultimate_alarm_clock/ultimate_alarm_clock/MainActivity.kt
Observed Problems
1. cancelTimer is called from Flutter but not implemented on the timer channel
Flutter code calls:
timerChannel.invokeMethod('cancelTimer')
but the Android timer channel handler in MainActivity.kt only implements:
playDefaultAlarm
stopDefaultAlarm
runtimerNotif
clearTimerNotif
So cancelTimer currently falls through to notImplemented.
2. TimerRingController calls bringAppToForeground on the wrong channel
TimerRingController uses:
and then invokes:
But bringAppToForeground is implemented on the alarm channel, not the timer channel.
That means the timer ring flow depends on a method that is not exposed on the channel it actually uses.
Why this matters
This creates silent timer-flow breakage:
- timer cleanup may not actually happen natively
- timer ring foreground recovery is fragile
- background/foreground timer behavior becomes inconsistent
Expected Behavior
- every Flutter timer-channel method must exist on the Android
timer channel
- timer ring foreground recovery must use the correct method/channel contract
- unsupported timer methods should not silently fail
Suggested Fix
- define the timer channel contract explicitly
- add
cancelTimer support on the Android timer channel, or remove the Flutter call if it is obsolete
- route
bringAppToForeground through the correct channel, or expose it on the timer channel if that is the intended contract
- add a small contract test or integration check for the timer method names
Acceptance Criteria
cancelTimer from Flutter does not hit notImplemented
- timer ring background-to-foreground recovery uses a valid native method path
- timer channel method names are documented and aligned between Flutter and Android
- regression coverage exists for the timer channel contract
Description
The timer feature has a native-channel contract mismatch.
Flutter invokes timer methods that are not fully implemented on the Android side, and
TimerRingControlleralso sends one foregrounding call over the wrong channel.Affected Code
lib/app/modules/timer/controllers/timer_controller.dartlib/app/modules/timerRing/controllers/timer_ring_controller.dartandroid/app/src/main/kotlin/com/ccextractor/ultimate_alarm_clock/ultimate_alarm_clock/MainActivity.ktObserved Problems
1.
cancelTimeris called from Flutter but not implemented on thetimerchannelFlutter code calls:
timerChannel.invokeMethod('cancelTimer')but the Android
timerchannel handler inMainActivity.ktonly implements:playDefaultAlarmstopDefaultAlarmruntimerNotifclearTimerNotifSo
cancelTimercurrently falls through tonotImplemented.2.
TimerRingControllercallsbringAppToForegroundon the wrong channelTimerRingControlleruses:MethodChannel('timer')and then invokes:
bringAppToForegroundBut
bringAppToForegroundis implemented on the alarm channel, not the timer channel.That means the timer ring flow depends on a method that is not exposed on the channel it actually uses.
Why this matters
This creates silent timer-flow breakage:
Expected Behavior
timerchannelSuggested Fix
cancelTimersupport on the Androidtimerchannel, or remove the Flutter call if it is obsoletebringAppToForegroundthrough the correct channel, or expose it on the timer channel if that is the intended contractAcceptance Criteria
cancelTimerfrom Flutter does not hitnotImplemented