Skip to content

fix(android): avoid phone-number permission for self-managed incoming calls - #876

Merged
sboily merged 1 commit into
react-native-webrtc:masterfrom
sboily:fix/android-self-managed-incoming
Sep 14, 2026
Merged

sboily merged 1 commit into
react-native-webrtc:masterfrom
sboily:fix/android-self-managed-incoming

Conversation

@sboily

@sboily sboily commented Sep 14, 2026

Copy link
Copy Markdown
Member

An incoming call with selfManaged: true crashes on recent Android versions when READ_PHONE_NUMBERS is denied. VoiceConnectionService.createConnection() calls TelecomManager.getPhoneAccount() even for the app's own self-managed account, although CallKeep's self-managed permission flow does not request that permission.

Capture the self-managed flag in both incoming and outgoing connection requests, then set the connection property without querying the phone account. Requests without that flag keep the existing account lookup. This follows Donald Wong's approach in #685 and extends it to displayIncomingCall, which is the path reproduced here; #685 currently adds the flag only to outgoing calls.

Validation: the included host-app instrumentation fixture submits an actual incoming call through Android Telecom, checks that phone-number permission is denied, verifies PROPERTY_SELF_MANAGED, and rejects the connection in cleanup. It passes on Samsung SM-S921W (API 36) and Pixel Tablet (API 37), using React Native 0.87.1. Both devices crashed at the account lookup on unmodified 4.3.17. No microphone or network/media session is started by the fixture; outgoing calls were not exercised on device.

… calls

Carry the self-managed flag on incoming and outgoing ConnectionRequests. The flag approach follows PR react-native-webrtc#685 by Donald Wong and covers the incoming path as well.
@sboily sboily added the bug Something isn't working label Sep 14, 2026
@sboily sboily self-assigned this Sep 14, 2026
@sboily
sboily merged commit 7506f38 into react-native-webrtc:master Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants