-
Notifications
You must be signed in to change notification settings - Fork 39
fix(react-native): restore screen wake lock and proximity sensing #1971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR restores screen wake lock and proximity sensing functionality that was lost during the migration from InCallManager to the custom callManager implementation. The changes ensure the device screen stays on during calls and the proximity sensor automatically turns off the screen when held near the ear (earpiece mode only).
Key Changes:
- Added screen wake lock on iOS to prevent screen dimming during calls
- Implemented proximity sensor monitoring on both iOS and Android to turn off screen when device is near ear
- Integrated proximity management into the call lifecycle via
callManager.start()andcallManager.stop()
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sample-apps/react-native/dogfood/src/navigators/Call.tsx |
Integrated callManager.start() and callManager.stop() calls in the dogfood app to enable wake lock and proximity sensing |
packages/react-native-sdk/ios/StreamInCallManager.swift |
Added wake lock, proximity monitoring, and audio route observation on iOS |
packages/react-native-sdk/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt |
Integrated ProximityManager into Android call manager lifecycle |
packages/react-native-sdk/android/src/main/java/com/streamvideo/reactnative/callmanager/ProximityManager.kt |
New Android proximity manager implementation handling sensor registration and wake lock management |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...native-sdk/android/src/main/java/com/streamvideo/reactnative/callmanager/ProximityManager.kt
Show resolved
Hide resolved
### 💡 Overview Follow up to #1971 Fixes the following issues on android: * Proximity stuff (turning off screen when kept closed to body for earpiece output) - should be done only for communicator mode * `getAudioDeviceStatus` method was somehow removed from callmanager native side. This PR adds it back. * Earpiece detection was using older APIs on newer android. This PR makes sure newer APIs are used. * Ringing calls started with earpiece. No need to do so. Changed to speaker now. * adds the necessary `android.permission.WAKE_LOCK` to the android library extra: comments to clarify impl in iOS ### 📝 Implementation notes 🎫 Ticket: https://linear.app/stream/issue/XYZ-123 📑 Docs: https://github.com/GetStream/docs-content/pull/<id>
💡 Overview
When we migrated away from InCallManager (#1840) to our in-house
callManager, we didn't port the Wake Lock on iOS and proximity sensing on both Android and iOS.This PR closes that gap.
🎫 Ticket: https://linear.app/stream/issue/RN-291/screen-auto-lock