Guilmer
Guilmer

Reputation: 1

Windows 10 can't replace a deleted file on some Android devices' data directory

I'm running into an issue and can't find anything online to help me.

I have two Android devices: Samsung S20 and Meta Quest 2 connected to a PC running Windows 10.

I'm developing a Windows app that needs to exchange files with an Android portable device via USB. Since a recent Android OS update, app's access to non private (i.e. outside of Android/data/com.MyCompany.MyApp) directories is highly restricted, I am using the app's private directory to store the files.

But, on my Samsung phone, using either my desktop App (WPD libraries) or Windows Explorer, if I navigate to device\Internal shared storage\Android\data\com.MyCompany.MyApp\files it is not possible to delete a file and copy a new one with the same name. But it works on the Quest 2.

In other words, navigating to device\Internal storage\Android\data\com.MyCompany.MyApp\files I can delete the existing File.txt file, but I will not be able to copy or create a new file named File.txt, unless I physically disconnect the phone and connect it again. I do not get this behaviour on the Quest 2. Funny thing is, I was getting it a few months ago, but not anymore.

I have tried using copy\paste, drag and drop, copying the file to the parent directory and dragging it to the desired child directory, spamming F5, closing and re-opening Windows Explorer, restarting the WPD desktop app, ... nothing works except physically disconnecting the USB cable and plugging it back in. Feels like it's some sort of file cache issue.

I understand the restrictions on the Android\data directory. But this behaviour doesn't make sense and I can't seem to find a fix.

Has anyone experienced this and found a solution?

Upvotes: 0

Views: 221

Answers (0)

Related Questions