File tree Expand file tree Collapse file tree
base/src/main/java/com/smartdevicelink/managers/file Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,11 +271,17 @@ public void run() {
271271 */
272272 public boolean hasUploadedFile (@ NonNull SdlFile file ) {
273273 // HAX: [#827](https://github.com/smartdevicelink/sdl_ios/issues/827) Older versions of Core had a bug where list files would cache incorrectly.
274- if (file .isPersistent () && mutableRemoteFileNames != null && mutableRemoteFileNames .contains (file .getName ())) {
275- // If it's a persistent file, the bug won't present itself; just check if it's on the remote system
276- return true ;
277- } else if (!file .isPersistent () && mutableRemoteFileNames != null && mutableRemoteFileNames .contains (file .getName ()) && uploadedEphemeralFileNames .contains (file .getName ())) {
278- // If it's an ephemeral file, the bug will present itself; check that it's a remote file AND that we've uploaded it this session
274+ Version rpcVersion = new Version (internalInterface .getSdlMsgVersion ());
275+ if (new Version (4 , 4 , 0 ).isNewerThan (rpcVersion ) == 1 ) {
276+ if (file .isPersistent () && mutableRemoteFileNames != null && mutableRemoteFileNames .contains (file .getName ())) {
277+ // HAX: If it's a persistent file, the bug won't present itself; just check if it's on the remote system
278+ return true ;
279+ } else if (!file .isPersistent () && mutableRemoteFileNames != null && mutableRemoteFileNames .contains (file .getName ()) && uploadedEphemeralFileNames .contains (file .getName ())) {
280+ // HAX: If it's an ephemeral file, the bug will present itself; check that it's a remote file AND that we've uploaded it this session
281+ return true ;
282+ }
283+ } else if (mutableRemoteFileNames != null && mutableRemoteFileNames .contains (file .getName ())) {
284+ // If not connected to a system where the bug presents itself, we can trust the `remoteFileNames`
279285 return true ;
280286 }
281287 return false ;
You can’t perform that action at this time.
0 commit comments