Skip to content

feat(android): expose call delivery mode (Telecom vs standalone) to Flutter#310

Merged
SERDUN merged 2 commits into
developfrom
feat/wt-1195-expose-call-delivery-mode
Jun 9, 2026
Merged

feat(android): expose call delivery mode (Telecom vs standalone) to Flutter#310
SERDUN merged 2 commits into
developfrom
feat/wt-1195-expose-call-delivery-mode

Conversation

@SERDUN

@SERDUN SERDUN commented Jun 8, 2026

Copy link
Copy Markdown
Member

Overview

On devices without android.software.telecom (many tablets, Android Go, some OEM/ChromeOS) the plugin falls back from the Telecom ConnectionService path to the limited StandaloneCallService. That state was detected natively (TelephonyUtils.isTelecomSupported / CallServiceRouter) but never surfaced to Flutter, so the app cannot tell the user their device runs in the restricted standalone mode.

This adds a getter that exposes the active call-delivery mode to Flutter. It is the callkeep half of WT-1195; the webtrit_phone half (warning the user) builds on it.

Changes

  • New PHostPermissionsApi.getCallDeliveryMode() in the pigeon definition, returning a new CallkeepAndroidCallDeliveryMode enum (telecom / standalone / unknown).
  • Kotlin host implementation in PermissionsApi reuses the same TelephonyUtils.isTelecomSupported(context) gate the router uses, so the reported value matches the actually active delivery path.
  • Wired through every layer: android platform plugin + converter, platform interface (abstract method + model), and the public WebtritCallkeepPermissions API. Non-Android platforms return unknown.

Notes

  • This is distinct from the existing batteryOptimizationWarning (socket mode + battery exemption).
  • The generated pigeon files (callkeep.pigeon.dart, Generated.kt) were edited additively for this one getter; a full pigeon regeneration was intentionally avoided because the committed Generated.kt on develop is already stale relative to its pigeon source (the logging refactor removed PLogTypeEnum / PDelegateLogsFlutterApi from the source while Log.kt / WebtritCallkeepPlugin.kt still reference them), so a wholesale regen would drop symbols the Kotlin still needs and break the build. Worth a separate cleanup.

Test plan

  • flutter analyze clean across all packages
  • flutter test (webtrit_callkeep_android) - all pass, incl. new converter + API tests
  • ./gradlew testDebugUnitTest (Kotlin) - compiles and passes

…lutter

Devices without android.software.telecom fall back from the Telecom
ConnectionService path to a limited StandaloneCallService. That state was
detected natively (TelephonyUtils.isTelecomSupported / CallServiceRouter)
but never surfaced to Flutter, so the app could not tell the user their
device runs in the restricted standalone mode.

Add a PHostPermissionsApi.getCallDeliveryMode() getter returning a new
CallkeepAndroidCallDeliveryMode enum (telecom / standalone / unknown),
wired through every layer: pigeon definition, Kotlin host implementation
(reuses the same isTelecomSupported gate the router uses), the android
platform plugin and converter, the platform interface model, and the
public WebtritCallkeepPermissions API. Non-Android platforms return
unknown.

This is distinct from the existing battery-optimization warning; it is the
prerequisite for warning the user about limited call delivery on devices
without Telecom.

This comment was marked as resolved.

Address review feedback:
- webtrit_callkeep_web now overrides getCallDeliveryMode() to return
  CallkeepAndroidCallDeliveryMode.unknown, mirroring the existing getBatteryMode
  default so the web platform impl does not fall through to the throwing
  platform-interface default.
- Replace the broken dartdoc reference [ConnectionService] with a code-formatted
  android.telecom.ConnectionService to avoid a broken doc link.
@SERDUN SERDUN merged commit ec27a78 into develop Jun 9, 2026
15 of 25 checks passed
@SERDUN SERDUN deleted the feat/wt-1195-expose-call-delivery-mode branch June 9, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants