diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-02-04 15:27:08 -0500 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-02-04 15:27:08 -0500 |
commit | 5f95808e9d9d15d931d073bc35994b48f6c8e802 (patch) | |
tree | bd28c6100d795453790b8dd82cc12bee1e85adab /android/sdl_android/src/main | |
parent | b05d810d3d44b4ac569d5eeab374a6762dbb97d0 (diff) | |
download | sdl_android-5f95808e9d9d15d931d073bc35994b48f6c8e802.tar.gz |
Generate name for SdlFile if not provided by dev (javaSE)
Diffstat (limited to 'android/sdl_android/src/main')
-rw-r--r-- | android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java | 14 |
1 files changed, 7 insertions, 7 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 dceeee113..d04a9b976 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 @@ -116,7 +116,7 @@ public class SdlFile{ * Sets the name of the file * @param fileName a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the name */ - public void setName(String fileName){ + public void setName(String fileName) { if (fileName != null) { this.shouldAutoGenerateName = false; this.fileName = fileName; @@ -124,10 +124,10 @@ public class SdlFile{ this.shouldAutoGenerateName = true; if (this.getFileData() != null) { this.fileName = generateFileNameFromData(this.getFileData()); - } else if (this.getUri() != null){ - this.fileName = generateFileNameFromUri(uri); - } else if (this.getResourceId() != 0){ - this.fileName = generateFileNameFromResourceId(this.id); + } else if (this.getUri() != null) { + this.fileName = generateFileNameFromUri(this.getUri()); + } else if (this.getResourceId() != 0) { + this.fileName = generateFileNameFromResourceId(this.getResourceId()); } } } @@ -273,7 +273,7 @@ public class SdlFile{ } /** - * Generates a file name from data by hashing the uri and returning the last 16 chars + * Generates a file name from uri by hashing the uri string and returning the last 16 chars * @param uri a URI value representing a file's location * @return a String value representing the name that will be used to store the file in the head unit */ @@ -282,7 +282,7 @@ public class SdlFile{ } /** - * Generates a file name from data by hashing the id and returning the last 16 chars + * Generates a file name from resourceId by hashing the id and returning the last 16 chars * @param id an int value representing the android resource id of the file * @return a String value representing the name that will be used to store the file in the head unit */ |