-
Notifications
You must be signed in to change notification settings - Fork 78
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
target: Add persistent_data_path to AndroidTarget #622
target: Add persistent_data_path to AndroidTarget #622
Conversation
devlib/target.py
Outdated
@@ -1785,6 +1786,7 @@ def __init__(self, | |||
is_container=is_container, | |||
max_async=max_async) | |||
self.package_data_directory = package_data_directory | |||
self.persistent_data_path = persistent_data_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this should be the same for a ChomeOS target? In which case should we include a similar parameter for that target as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm would it? I don't really know anything about ChromeOS from that side..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness the way we handle ChromeOS targets (which support Android apps) is essentially creating both a Linux and Android Target together so any parameters (or properties) we add should also be usable by the Android portion of the ChromeOs target.
All I can find when looking for "persistent data path" is Unity, are we sure we want to add some app-specific concepts in AndroidTarget ? Unless there is an android API doc I missed. Maybe there is a related property that could just be queried ( |
That's the only place I found the name itself used but the path is definitely used by other apps as well here and there. It's analogous to the |
That makes sense, does Android allow querying for that path in any way or do apps have to know it in advance ? |
Ah apparently it can, Android's Context has a method for getting the application's data directory: We could always rename this from persistent_data_path to external_files_path or dir? |
Looking into this more it looks like the
So we would be providing the root of this directory and users would need to manually join the package name to this path. IIUC looking at how this path is generated [2] it uses the external directory function (which we expose with As for the name perhaps to keep inline with the android terminology we could expose something like What do you think? [1] https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String) |
76cb39e
to
cb43dd4
Compare
Ah yeah that makes a lot of sense,
The name seems fine to me. I've updated this PR accordingly and will close the WA one. |
FEATURE Add a convenience property for AndroidTarget to expose Android's external storage app directory path. This path is used for some applications (such as Unity games) to store persistent application data instead of '/data/data'. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
cb43dd4
to
33fb3bb
Compare
Updated, sorry for the delay.. |
Some apps, such as Unity-based applications, can store some files in their 'persistent data path' which is usually under '/storage/emulated/0/Android/data'. Add a handle to easily access the path within AndroidTarget in the same way as package_data_directory currently is accessible.