fix(android): honor media capture deny policy#47
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an Android ChangesAndroid media capture permission
Sequence Diagram(s)sequenceDiagram
participant ReactProp
participant RNCWebView
participant RNCWebChromeClient
participant PermissionRequest
ReactProp->>RNCWebView: Set mediaCapturePermissionGrantType
PermissionRequest->>RNCWebChromeClient: Submit requested resources
RNCWebChromeClient->>RNCWebView: Read grant type
RNCWebChromeClient->>RNCWebChromeClient: Filter media capture resources
RNCWebChromeClient->>PermissionRequest: Deny filtered request
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java`:
- Around line 165-170: Update the empty-request branch in the media permission
handling around RNCMediaCapturePermission.filterRequestedResources and
request.deny() to clear permissionRequest and grantedPermissions after the
synchronous deny/grant decision. Ensure any later OS permission callback cannot
reuse stale state to grant a request that was already denied.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8818baf6-4cdf-4e6b-83b4-98cab84b3bfd
📒 Files selected for processing (11)
.changeset/harden-android-media-capture.mdandroid/build.gradleandroid/src/main/java/com/reactnativecommunity/webview/RNCMediaCapturePermission.javaandroid/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.javaandroid/src/main/java/com/reactnativecommunity/webview/RNCWebView.javaandroid/src/main/java/com/reactnativecommunity/webview/RNCWebViewManagerImpl.ktandroid/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.javaandroid/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.javaandroid/src/test/java/com/reactnativecommunity/webview/RNCMediaCapturePermissionTest.javadocs/Reference.mdsrc/WebViewTypes.ts
tian000
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Honor
mediaCapturePermissionGrantType="deny"on Android.Tests:
yarn lint, existing Jest suite, focused Java policy harness.Summary by CodeRabbit
mediaCapturePermissionGrantTypeWebView prop.deny, camera and microphone capture requests are blocked without showing permission prompts.denyvs non-denybehavior for media-capture resources.