diff options
Diffstat (limited to 'android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java')
-rw-r--r-- | android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java index 13c7d3119..a0c0d9369 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java @@ -38,6 +38,7 @@ import androidx.annotation.NonNull; import com.smartdevicelink.proxy.rpc.enums.FileType; import com.smartdevicelink.proxy.rpc.enums.StaticIconName; +import com.smartdevicelink.util.DebugTool; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -46,7 +47,7 @@ import java.util.Arrays; /** * A class representing data to be uploaded to core */ -public class SdlFile { +public class SdlFile implements Cloneable { private String fileName; private int id = -1; private Uri uri; @@ -368,4 +369,22 @@ public class SdlFile { // return comparison return hashCode() == o.hashCode(); } + + /** + * Creates a deep copy of the object + * + * @return deep copy of the object, null if an exception occurred + */ + @Override + public SdlFile clone() { + try { + SdlFile fileClone = (SdlFile) super.clone(); + return fileClone; + } catch (CloneNotSupportedException e) { + if (DebugTool.isDebugEnabled()) { + throw new RuntimeException("Clone not supported by super class"); + } + } + return null; + } } |