Emulator Issues #12764
open[Android] [Scoped Storage] Consider moving the user folder from Android/data/org.dolphinemu.dolphinemu to Android/media/org.dolphinemu.dolphinemu
0%
Description
Since version 5.0-15348, Dolphin complies with Scoped Storage requirements by storing the user folder under Internal Storage => Android => data => org.dolphinemu.dolphinemu. That folder, however, has restricted access and the transition hasn't been exactly smooth (we've seen phones that deny access to the folder even when accessed on a computer via USB, phones that hides the only system app that still has full access to the folder, among other related issues).
I've been watching how other apps that used to store content in bare folders at the root of the internal storage reacted since the Scoped Storage enforcement went live on the Play Store and noticed that a few opted to use Android => media instead of Android => data (e.g. WhatsApp). At first I thought only media files could be stored there but those apps are storing all kinds of files there. The most important benefit, however, is that the media folder doesn't have the same access restrictions of the data subfolder: any app can read/write files there, even in the folder of other apps and using that directory seems sufficient to comply with the Scoped Storage requirements.
I haven't investigated if there are other implications in using the Android\media folder that might affect Dolphin, but given the benefits it might be worth considering the switch, if feasible?
Updated by JosJuice about 3 years ago
- Status changed from New to Questionable
getExternalMediaDirs is marked as deprecated by API 30. If I use it I bet Google is going to break it next year or something, once again giving us the headache of how to best migrate user data...
Updated by JosJuice about 3 years ago
- Operating system Android added
- Operating system deleted (
N/A)
Updated by mbc07 about 3 years ago
Well, that's a bummer.
Maybe we could provide an option to select between Android\data and Android\media, that defaults to Android\data and has a warning that it might stop working in future Android updates if the user changes the location to Android\media, similar to how we handle save states on Android? Another approach I could think of is keep using Android\data but provide an option to import whatever the user has put into Android\media to Android\data.
From the dev side, I agree the code for handling that will probably be ugly, but from the user side, not having to deal with workarounds that may or may not work (depending of the device) to access the user data folder might justify the effort...
Updated by JosJuice about 3 years ago
If someone else wants to implement an option to use Android/media/, I'd be willing to include it in Dolphin. But personally I'm just tired of dealing with scoped storage at this point...
Updated by JMC4789 about 2 years ago
- Status changed from Questionable to Won't fix
Updated by mbc07 about 2 years ago
I rarely announce things before they're ready but I AM working in moving the user folder to Android/media (the location change was trivial, working on the UI side now, including a migration prompt and lots of testing). Yes, getExternalMediaDirs() is currently marked as deprecated but I don't think Google will drop it entirely any time soon, especially considering a lot of apps (including most of the big chatting apps, like Telegram and WhatsApp) are also using Android/media since the Scoped Storage enforcement took place.
A lot of our users still struggle to access the user folder and all workarounds we provide are cumbersome and/or unreliable (some don't even work anymore in Android 13). That's just bad and I don't think that's acceptable, when we could be using Android/media since the enforcement took place and basically eliminate most of the headache Scoped Storage brought. In the worst case scenario of Android 14 completely removing access to Android/media, we would still one more year after its final release before targeting its API becomes mandatory on Play Store, that's late 2024 at best...
Updated by JMC4789 about 2 years ago
- Status changed from Won't fix to Work started
Okay. I just closed it as JosJuice wasn't planning on working on it.