Skip to content

🐛 fix(android): recognize device-protected storage paths - #752

Closed
adityahaa wants to merge 1 commit into
tox-dev:mainfrom
adityahaa:fix/android-device-protected-storage
Closed

adityahaa wants to merge 1 commit into
tox-dev:mainfrom
adityahaa:fix/android-device-protected-storage

Conversation

@adityahaa

@adityahaa adityahaa commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

platformdirs asks pyjnius for the Android app folder and, when pyjnius is missing, looks for the folder on sys.path. That fallback did not recognize device-protected storage (/data/user_de/<user id>), so an app running Python from there got the Unix backend. 📱 Once this merges, such an app gets its own app directories, and its shared media directories point to its Android user's /storage/emulated/<user id> instead of the /storage/emulated/0 default.

The sys.path discovery now accepts the device-protected user_de root wherever it accepted the credential-protected user root, on internal storage and on adopted volumes under /mnt/expand. The shared storage lookup reads the user ID from either root.

This has not been run on a physical Android device or emulator.

Prepared and verified with OpenAI Codex assistance.

@gaborbernat gaborbernat added the bug Something isn't working label Nov 27, 2026
@gaborbernat gaborbernat changed the title fix(android): recognize device-protected storage paths 🐛 fix(android): recognize device-protected storage paths Nov 27, 2026
@gaborbernat

Copy link
Copy Markdown
Member

Closing because this PR does not allow edits by maintainers, so the review fixes could not be pushed here. #753 keeps your commit unchanged and adds the fixes on top. Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants