Skip to content

Add profile pictures from files#3086

Open
arpitagarwal1301 wants to merge 3 commits into
recloudstream:masterfrom
arpitagarwal1301:fix/3079-account-pfp-from-file
Open

Add profile pictures from files#3086
arpitagarwal1301 wants to merge 3 commits into
recloudstream:masterfrom
arpitagarwal1301:fix/3079-account-pfp-from-file

Conversation

@arpitagarwal1301

@arpitagarwal1301 arpitagarwal1301 commented Jul 20, 2026

Copy link
Copy Markdown

What does this change?

Adds a file option to the profile image editor while preserving the existing URL flow.

Selected image documents must decode successfully before preview. Read access is persisted only when the edit is applied, and an inaccessible document falls back to the account's default avatar. Replaced and deleted document grants are released only after no account still references them.

This review revision follows the requested architecture by exposing the profile-image picker through CommonActivity. Each initialized activity owns its lifecycle-safe launcher, while stale picker results and superseded validation requests are ignored. Account UI call sites no longer thread picker callbacks through adapters and dialogs.

The edit icon also has a content description and explicit D-pad focus navigation while retaining its existing touch background.

Closes #3079

Testing

  • :app:compileStableDebugKotlin
  • :app:testStableDebugUnitTest (8 tests, 0 failures)
  • :app:lintStableDebug (0 errors)
  • git diff --check

Limitations

  • The system picker, activity recreation, and TV focus path were not exercised with UI instrumentation or on physical hardware.
  • The optional internal-file copy was not added; unavailable external documents fall back to the default avatar.

AI disclosure

AI-assisted: implementation and review used OpenAI Codex; the listed checks were run on the submitted code.

@fire-light42 fire-light42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for you contribution! Great job on the new feature!

Overall good code, but there are some minor nitpicks.

Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/account/AccountHelper.kt Outdated
@arpitagarwal1301

Copy link
Copy Markdown
Author

Addressed the requested Activity Result API, image/* MIME, string alias, and toast placement changes in f59858c. I kept internal file copying out of scope as noted optional; persisted document permissions and the existing fallback remain in place. Ready for re-review when convenient.

@fire-light42 fire-light42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great job!

Unfortunately passing around a variable to 100 subclasses is a bit too messy, but I realize you did it for a lack of a better solution, there is no good solution after all.

I would really want you to register one global variable in CommonActivity like this: https://github.com/recloudstream/cloudstream/blob/master/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt#L254-L266
This is how we solved a similar problem previously, I failed to send it though :(

It should be a pretty easy change thankfully. This way we do not have to pass around the variable everywhere. After these changes it should be fully done and ready to merge. Sorry for the added difficulties 😢

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.

Account PFP from file

2 participants