Skip to content

Conversation

@Verryx-02
Copy link
Contributor

@Verryx-02 Verryx-02 commented Aug 3, 2025

First time contributor checklist

Contributor checklist

  • OnePlus 8T OxygenOS 14
  • My contribution is fully baked and ready to be merged as is

Description

This PR improves file organization by saving image attachments to Pictures/Signal/ instead of the root Pictures/ directory on Android 10+ devices, following established Android app conventions without changing user experience.

Why this change matters:
Signal currently saves images directly to Pictures/, mixing them with personal photos, camera shots, and downloads from other apps. This creates clutter and makes it harder for users to manage their files. Most popular messaging apps (WhatsApp, Telegram, Instagram, Twitter...) already organize their media into dedicated subdirectories.

User benefit:

  • Signal images are now properly organized and easily discoverable
  • No clutter in the main Pictures folder
  • Consistent with user expectations from other messaging apps
  • Zero impact on user workflow - saving and sharing work exactly the same

Technical implementation:
This change handles both modern and legacy Android versions with minimal code changes:

For Android 10+ (API 29+) - Modern MediaStore approach:

if (Build.VERSION.SDK_INT > 28 && contentType.startsWith("image/")) {
  contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + "/Signal")
}

For Android 9 and below (API < 29) - Modified getExternalPathForType():

// Changed from:
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)

// To:
File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "Signal")

This ensures consistent behavior across all Android versions while using the appropriate API for each platform.

Why this aligns with Signal's philosophy:

  • No new options - This is a sensible default that improves organization transparently
  • No user complexity - Users continue saving images exactly as before
  • Better user experience - Reduces file management friction without requiring user configuration
  • Platform consistency - Follows Android's intended MediaStore patterns

Testing performed:

  • Verified on OnePlus 8T (Android 14) that images save correctly to Pictures/Signal/
  • Confirmed automatic subdirectory creation
  • No regressions in save functionality
  • Code changes for older Android versions follow existing patterns in the codebase

Testing not performed:
Validation on Android 9 and below

This change represents the kind of thoughtful default that improves user experience without adding complexity - exactly what Signal stands for.

…tures/

Images are now saved to Pictures/Signal/ instead of Pictures/ on Android 10+
using MediaStore RELATIVE_PATH. Maintains backward compatibility for older
Android versions via existing getExternalPathForType() logic.
@Verryx-02
Copy link
Contributor Author

Note: This PR intentionally focuses only on image attachments, following Signal's preference for small, incremental changes.
I'm happy to extend this to other media types (video, audio, documents) in separate PRs if this approach is well-received.

@cody-signal
Copy link
Contributor

Go ahead and update for the other supported media types in this PR, and then I'll look at getting it pulled in.

Now all media types are organized in Signal subdirectories
- Images: Pictures/Signal/
- Videos: Movies/Signal/
- Audio: Music/Signal/
- Documents: Documents/Signal/ (Android 9-) or Download/Signal/ (Android 10+)

Note: Documents vs Downloads difference for generic files
existed before this change - this PR only adds Signal
subdirectory organization.
@Verryx-02
Copy link
Contributor Author

Verryx-02 commented Aug 4, 2025

Updated to include all supported media types as requested

Extended the Signal subdirectory organization to all attachment types:

  • Images: Pictures/Signal/
  • Videos: Movies/Signal/
  • Audio: Music/Signal/
  • Documents: Download/Signal/

Key points:

  • Maintains consistent behavior across Android versions using appropriate APIs
  • Fixed the Documents vs Downloads difference for generic files.
  • All media types now follow the same organized subdirectory pattern
  • Tested ONLY on Android 14

@Verryx-02
Copy link
Contributor Author

Small correction made

Initially I had unified both Android versions to save generic files to Download/Signal/, but I decided to revert this change to be more conservative.

The approach now maintains the existing behavior:

  • Android 9-: Documents/Signal/ (as it was Documents/ before)
  • Android 10+: Download/Signal/ (as it was Download/ before)

I don't know why there was this difference between the versions, but I thought it's best not to touch it for now.

@cody-signal
Copy link
Contributor

Thanks, this will be in 7.52

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