Dolphin, the GameCube and Wii emulator - Forums

Full Version: Scoped storage issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
(11-14-2021, 07:29 AM)JosJuice Wrote: [ -> ]Huh

Well, I have no idea what's going on... But I'm glad it works, at least.

I am so, so sorry to bother you yet again, but I figured something out (bad). I rebooted my phone, and Dolphin went right back to using scoped storage and ignoring the contents of my dolphin-emu folder altogether. It even asked my permission to gather usage stats as if it had never been run before. It seems that, at least on my phone, Google's "existing install doesn't enforce scoped storage when updated" loophole only applies until the next reboot. I assume the first time I noticed this was also the first time a ran a scoped-storage-enabled build after a reboot (although I can't be sure). So I'm back to square one. I can't restore my saves to the new folder, as had been previously established, and the only way I can play without starting over is by uninstalling, installing 15260 and then reapplying the latest update on every single reboot. I'd use an expletive if I knew it wasn't censored here. Again, I'm really sorry for bothering you this much with a single issue, but I felt this was relevant info.
The loophole works as expected on the devices I tested (mostly Samsungs). I'm starting to suspect OxygenOS might be doing something funky...
(11-14-2021, 08:34 PM)mbc07 Wrote: [ -> ]The loophole works as expected on the devices I tested (mostly Samsungs). I'm starting to suspect OxygenOS might be doing something funky...

Even after a reboot? Mine works perfectly at first, but when I reboot the phone, Dolphin acts as if everything's gone (although the dolphin-emu folder is still there) and creates an entirely new folder structure under Android/data/org.dolphinemu.dolphinemu/files, without copying/moving anything over from the old folder to the new one. The only thing it does keep, for whatever reason, is my touch screen control layout.
I have reproduced this behavior after a reboot.

Well, good news is that we know what's going on, bad news is that Google intentionally made things a lot worse for us than I thought... Why the hell would they even implement something that's affected by whether you've rebooted since you updated the app?
(11-15-2021, 01:54 AM)JosJuice Wrote: [ -> ]I have reproduced this behavior after a reboot.

Well, good news is that we know what's going on, bad news is that Google intentionally made things a lot worse for us than I thought... Why the hell would they even implement something that's affected by whether you've rebooted since you updated the app?

Just throwing my two cents out there, but I believe they might have run into some issues enforcing scoped storage on update while the phone is running, and thus made it so that it's only done on the next reboot...
But we're setting preserveLegacyExternalStorage, which is supposed to make scoped storage not apply until the app gets uninstalled: https://developer.android.com/training/data-storage/use-cases#if_your_app_targets

By the way, I re-tested USB, and I still don't seem to have the permission issues that you're having. So that mystery is still unsolved.
I looked up preserveLegacyExternalStorage in the AOSP source code, and I found a test which has a comment stating that preserving legacy storage when the app is updated is broken in Android 11 but not in Android 12: https://cs.android.com/android/_/android/platform/cts/+/f0885a38defab0e3cb7e84de225175fabcf52729

So, it's not intentional from Google's side, but the behavior is in AOSP nonetheless. Until you get an Android 12 update, that is.
(11-15-2021, 02:44 AM)JosJuice Wrote: [ -> ]I looked up preserveLegacyExternalStorage in the AOSP source code, and I found a test which has a comment stating that preserving legacy storage when the app is updated is broken in Android 11 but not in Android 12: https://cs.android.com/android/_/android/platform/cts/+/f0885a38defab0e3cb7e84de225175fabcf52729

So, it's not intentional from Google's side, but the behavior is in AOSP nonetheless. Until you get an Android 12 update, that is.

Well, Oxygen OS 12 is already in Beta 2 stage, so I should get a stable update sooner rather than later. And it's based on the Color OS codebase, so it may behave in a fundamentally different way, both regarding preserving legacy external storage and Android/data permissions, so I guess I could get lucky and have one of those two work if this can't be solved from Dolphin's side. There's one final thing that I'd like to test, that being moving files/folders through USB to the scoped storage directory of another app and seeing if I have the same permissions issue, but I haven't found another app that uses scoped storage in a similar way. I'm open to suggestions that aren't PPSSPP (since I don't really want to break that one, seeing as it's working with shared external storage right now), if you know any.
@JosJuice as of the latest update, I have rebooted twice (one due to a minor Oxygen OS update, one for ADB commands) and it didn't force scoped storage on me. I don't know if the permissions issue is gone, but the legacy external storage is working, so I'll try my best not to break it!
@JosJuice thank you for adding the import/export option. I've managed to preserve legacy external storage for now, but, it I ever have to move to scoped storage, this will be very useful.
Pages: 1 2 3 4 5