Skip to content

Fix generic mime type used when externally sharing several files #4715

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

Merged

Conversation

jmartinesp
Copy link
Member

Content

Get the mime type of each uri shared with the app.

Motivation and context

Fixes #4279.

Tests

It's difficult to test without a debugger, having access to the media server or adding some logs.

  • From an external app, like a gallery, share images with different formates.
  • Check the mime type of each image matches, instead of just a image/* mime type being used.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

…y shared with the app.

i.e. `image/*` when sharing a png and jpg file.
@jmartinesp jmartinesp requested a review from a team as a code owner May 13, 2025 14:58
@jmartinesp jmartinesp requested review from bmarty and removed request for a team May 13, 2025 14:58
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label May 13, 2025
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks!

Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/4sRUa6

@jmartinesp jmartinesp enabled auto-merge (squash) May 13, 2025 15:09
Copy link

@jmartinesp jmartinesp merged commit 4f39e09 into develop May 13, 2025
34 checks passed
@jmartinesp jmartinesp deleted the fix/generic-mime-type-when-sharing-several-files branch May 13, 2025 15:26
Copy link

codecov bot commented May 13, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.15%. Comparing base (e6b1c19) to head (e315121).
Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
.../android/features/share/impl/ShareIntentHandler.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4715      +/-   ##
===========================================
- Coverage    80.16%   80.15%   -0.01%     
===========================================
  Files         2126     2126              
  Lines        56313    56314       +1     
  Branches      7021     7022       +1     
===========================================
  Hits         45141    45141              
- Misses        8761     8762       +1     
  Partials      2411     2411              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sharing multiple images from external app doesn't apply the correct mime tag
2 participants