Skip to content
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

Add SAF permission grant routine for FTP server first run #2598

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

TranceLove
Copy link
Collaborator

Description

  • Refactored FtpServerFragment to allow different ActivityResultLauncher instances of different callbacks to be created in same code
  • Added routine to prompt user to grant access to device's internal storage (default FTP server shared folder) at SAF level

Issue tracker

Fixes #2592

Manual tests

  • Done

  • Device: LG Nexus 5x

  • OS: AOSPExtended 6.7 (9.0)

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

@TranceLove TranceLove added Issue-Bug Related unexpected behavior or something worth investigating. Issue-Severe (high) Showstopper issues that require immediate attention Area-FTP Related to FTP Server. labels Jun 8, 2021
@TranceLove TranceLove self-assigned this Jun 8, 2021
or Intent.FLAG_GRANT_READ_URI_PERMISSION
) == PackageManager.PERMISSION_DENIED
) {
mainActivity.accent.run {
Copy link
Member

Choose a reason for hiding this comment

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

Please at least put this function in a named constants so that this is more readable.

@VishalNehra
Copy link
Member

VishalNehra commented Jun 8, 2021

Working fine for me.
Please note, for me everything was working fine without this PR both ftps and ftp without any explicit SAF permission on android 11 oneplus 9r

VishalNehra
VishalNehra previously approved these changes Jun 8, 2021
VishalNehra
VishalNehra previously approved these changes Jun 9, 2021
Fixes #2592.

- Refactored FtpServerFragment to allow different ActivityResultLauncher instances of different callbacks to be created in same code
- Added routine to prompt user to grant access to device's internal storage (default FTP server shared folder) at SAF level
@VishalNehra VishalNehra merged commit 0ba7b0a into release/3.6 Jun 10, 2021
@VishalNehra VishalNehra deleted the bugfix/2592 branch June 10, 2021 08:09
TranceLove added a commit that referenced this pull request Jun 14, 2021
Continuation of #2598, fixes #2626. Saves the selected folder returned from ACTION_OPEN_DOCUMENT_TREE Intent.
TranceLove added a commit that referenced this pull request Jun 14, 2021
Continuation of #2598, fixes #2626. Saves the selected folder returned from ACTION_OPEN_DOCUMENT_TREE Intent.

Additionally, fixed the detection of whether the FTP shared folder is within the internal storage, so ACTION_OPEN_DOCUMENT_TREE will also be triggered for user to select the shared folder in content:// URI.
TranceLove added a commit that referenced this pull request Jun 15, 2021
Continuation of #2598, fixes #2626. Saves the selected folder returned from ACTION_OPEN_DOCUMENT_TREE Intent.

Additionally, fixed the detection of whether the FTP shared folder is within the internal storage, so ACTION_OPEN_DOCUMENT_TREE will also be triggered for user to select the shared folder in content:// URI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FTP Related to FTP Server. Issue-Bug Related unexpected behavior or something worth investigating. Issue-Severe (high) Showstopper issues that require immediate attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FTP server on stock install is not usable
3 participants