Skip to content

fix: allow opting out fgs permission from manifest - #2641

Open
greenfrvr wants to merge 1 commit into
mainfrom
fix/callingx-optional-camera-fgs-type
Open

greenfrvr wants to merge 1 commit into
mainfrom
fix/callingx-optional-camera-fgs-type

Conversation

@greenfrvr

Copy link
Copy Markdown
Contributor

💡 Overview

Fixes #2626.

callingx's CallService claimed the camera foreground service type on every call, even audio-only ones. Apps that don't use the camera in the background couldn't remove FOREGROUND_SERVICE_CAMERA (which needs a Play Console
declaration): removing it made startForeground() throw, and the app crashed with ForegroundServiceDidNotStartInTimeException.

Apps can now remove the camera type in their manifest, and calls keep running on phoneCall|microphone. Nothing changes for apps that keep the default manifest.

📝 Implementation notes

  • New ForegroundServiceTypes helper: microphone/camera are claimed only when the runtime permission is granted and the app manifest declares the type (the service's foregroundServiceType, plus the FOREGROUND_SERVICE_*
    permission on Android 14+). Same approach as the SDK's keep-alive service.
  • If startForeground() still rejects the types, the service falls back to phoneCall alone instead of crashing.

To opt out:

<uses-permission
  android:name="android.permission.FOREGROUND_SERVICE_CAMERA"
  tools:node="remove" />

<service
  android:name="io.getstream.rn.callingx.CallService"
  android:foregroundServiceType="phoneCall|microphone"
  tools:replace="android:foregroundServiceType" />

🎫 Ticket: https://linear.app/stream/issue/RN-540/callingx-fgs-types-opt-out-based-on-declared-permissions

📑 Docs: https://github.com/GetStream/getstream.io/pull/<id>

@greenfrvr greenfrvr self-assigned this Nov 20, 2026
@github-actions

Copy link
Copy Markdown

Bundle size

Built package output. Sizes in KB; delta vs main@d6e266a.

No significant package size increase vs main.

This branch has not been deployed

No deployments
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.

[react-native-callingx] CallService always claims the camera foreground-service type, so FOREGROUND_SERVICE_CAMERA cannot be removed

2 participants