Skip to content

Base: implement KnownLocations for android #2353

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
merged 1 commit into from
Jun 19, 2019

Conversation

compnerd
Copy link
Member

Add support for android to KnownLocations. Assume that only current
user is supported as all applications in android are isolated and single
user. For now, place all files in ~/Apple/Library/Preferences. This is
the last piece needed in CoreFoundation for Android support.

@compnerd
Copy link
Member Author

CC: @millenomi @drodriguez

@compnerd
Copy link
Member Author

@swift-ci please test

@spevans
Copy link
Contributor

spevans commented Jun 16, 2019

@swift-ci test linux

@compnerd
Copy link
Member Author

@swift-ci please test

@millenomi
Copy link
Contributor

My proposal is:

Let’s revert to the non-abort patch and mandate that people set CFFIXED_USER_HOME via Os.setenv() before any Swift code is invoked.

@millenomi
Copy link
Contributor

(That way, they can source the internal storage path from an activity without us guessing.)

@millenomi
Copy link
Contributor

millenomi commented Jun 18, 2019

This can be enforced by abort()-ing here.

@compnerd
Copy link
Member Author

@swift-ci please test

@drodriguez
Copy link
Contributor

I also approve the environment variable approach (with the last comment by Lily implemented).

Add a path through KnownLocations for android.  This currently cannot be
computed as we do not have the activity context nor do we know if the
activity was spawned from the zygote or was a NDK process so we do not
have a reference to Davlik to JNI and query the required information.
This is sufficient to get the SDK building for android though.
@compnerd
Copy link
Member Author

@swift-ci please test

@millenomi
Copy link
Contributor

While we’re using it directly here, it is also already picked up by CFPlatform.c, so API like NSHomeDirectory(), FileManager etc. will all heed it.

@compnerd compnerd merged commit 1c1a633 into swiftlang:master Jun 19, 2019
@compnerd compnerd deleted the so-it-is-known branch June 19, 2019 02:31
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.

4 participants