Skip to content

fix: prevent intent flag overwrite in playVideo#18

Merged
alexgerardojacinto merged 2 commits into
mainfrom
fix/overwritten-intent-flag
Jul 8, 2026
Merged

fix: prevent intent flag overwrite in playVideo#18
alexgerardojacinto merged 2 commits into
mainfrom
fix/overwritten-intent-flag

Conversation

@OS-pedrogustavobilro

@OS-pedrogustavobilro OS-pedrogustavobilro commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ 🤖 AI-assisted PR with Claude, with manual testing by me

Description

Combines FLAG_ACTIVITY_NO_HISTORY and FLAG_GRANT_READ_URI_PERMISSION into a single intent.flags assignment using or in IONCAMRVideoManager.playVideo.

Context

In playVideo, two consecutive direct assignments to intent.flags were used:

intent.flags = Intent.FLAG_ACTIVITY_NO_HISTORY
intent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION

Because each = assignment replaces the full flags value, the second line silently discarded FLAG_ACTIVITY_NO_HISTORY, meaning the external video player was left in the activity back stack contrary to the intended behaviour. FLAG_GRANT_READ_URI_PERMISSION was present in the final value, so URI access worked — but the no-history behaviour was never applied.

Discovered while testing RMET-5241.

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Tests

I replaced the .aar in a Cordova app, and testing playing video with different Android apps. I didn't notice any change in behavior, most likely because they were triggered from a single activity / screen, and there was no backstack. So in worst case scenario this change is a no-op, but the fix still makes sense.

Checklist

  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

@alexgerardojacinto

Copy link
Copy Markdown
Contributor

Tested it here and it works properly, merging this PR so this can be released with #17

@alexgerardojacinto alexgerardojacinto merged commit f802e3e into main Jul 8, 2026
1 check passed
@alexgerardojacinto alexgerardojacinto deleted the fix/overwritten-intent-flag branch July 8, 2026 13:13
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