Acrobat Reader for Android writes to the wrong ContentUri, overwriting the wrong file
Environment
Android >= N (which requires ContentUri instead of File Uris)
Steps to repro
- In Dropbox for Android: Open file A with Acrobat reader
- In Acrobat Reader: Make edits to File A, don't save the changes.
- Switch app to Dropbox and open file B
- Open file B with Acrobat reader
- Return to Dropbox
- File B's contents are replaced with File A's edited content
Expected Result
File A should be saved.
Observed Result
File B is overwritten, and File A is not saved.
Looking at the Intents and ContentProvider Queries. Here's the time line.
In Dropbox: Open file A with Adobe.
Dropbox sends and intent to Adobe (dat=content://com.dropbox.android.FileCache/filecache/353f4cac-5e9a-452f-bbcb-aa88863485d6)
07-25 12:19:06.173 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/353f4cac-5e9a-452f-bbcb-aa88863485d6 (projection = "_size")
07-25 12:21:16.613 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/353f4cac-5e9a-452f-bbcb-aa88863485d6 (projection ["displayname", "_size"])
07-25 12:22:02.462 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: openFile: uri: content://com.dropbox.android.FileCache/filecache/353f4cac-5e9a-452f-bbcb-aa88863485d6 (mode="r")
07-25 12:21:16.613 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/353f4cac-5e9a-452f-bbcb-aa88863485d6 (projection=["localrev", "lastmodified"])
In Adobe: Make Changes to the PDF file and click on the "Check"
Nothing happens!
In Dropbox: Open File B in Adobe
Dropbox sends and intent to Adobe (dat=content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f)
07-25 12:26:09.409 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f (projection = ["_size"])
07-25 12:26:56.054 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f (projection = ["displayname", "_size"])
07-25 12:27:31.901 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: openFile: uri: content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f (mode="r")
07-25 12:28:08.953 9033-9091/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: query: uri: content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f (projection=["localrev", "lastmodified"])
07-25 12:28:51.358 9033-9671/com.dropbox.android D/com.dropbox.android.provider.FileCacheProvider: openFile: uri: content://com.dropbox.android.FileCache/filecache/47d9291a-b00c-4608-a6ce-ab1e11958e0f (mode="w") <-- This is bad: Adobe is changing the newly opened file instead of the original file!
Attaching video of the repro.