diff --git a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/ImageField.java b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/ImageField.java index 3700b909a4..bad10b8c1b 100644 --- a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/ImageField.java +++ b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/ImageField.java @@ -1,6 +1,8 @@ package com.smartdevicelink.proxy.rpc; +import java.util.ArrayList; import java.util.Hashtable; +import java.util.List; import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.FileType; @@ -41,22 +43,35 @@ public void setName( ImageFieldName name ) { store.remove(KEY_NAME); } } - public FileType getImageTypeSupported() { - Object obj = store.get(KEY_IMAGE_TYPE_SUPPORTED); - if (obj instanceof FileType) { - return (FileType) obj; - } else if (obj instanceof String) { - FileType theCode = null; - try { - theCode = FileType.valueForString((String) obj); - } catch (Exception e) { - DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + KEY_IMAGE_TYPE_SUPPORTED, e); - } - return theCode; - } - return null; - } - public void setImageTypeSupported( FileType imageTypeSupported ) { + @SuppressWarnings("unchecked") + public List getImageTypeSupported() { + if (store.get(KEY_IMAGE_TYPE_SUPPORTED) instanceof List) { + List list = (List)store.get(KEY_IMAGE_TYPE_SUPPORTED); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof FileType) { + return (List) list; + } else if (obj instanceof String) { + List newList = new ArrayList(); + for (Object hashObj : list) { + String strFormat = (String)hashObj; + FileType theCode = null; + try { + theCode = FileType.valueForString(strFormat); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + KEY_IMAGE_TYPE_SUPPORTED, e); + } + if (theCode != null) { + newList.add(theCode); + } + } + return newList; + } + } + } + return null; + } + public void setImageTypeSupported( List imageTypeSupported ) { if (imageTypeSupported != null) { store.put(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported ); } diff --git a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/PerformInteraction.java b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/PerformInteraction.java index 7ebde6b43f..728b6a5659 100644 --- a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/PerformInteraction.java +++ b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/PerformInteraction.java @@ -6,7 +6,6 @@ import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; -import com.smartdevicelink.proxy.rpc.enums.DisplayType; import com.smartdevicelink.proxy.rpc.enums.InteractionMode; import com.smartdevicelink.proxy.rpc.enums.LayoutMode; import com.smartdevicelink.util.DebugTool; @@ -377,7 +376,7 @@ public void setVrHelp(List vrHelp) { public LayoutMode getInteractionLayout() { Object obj = parameters.get(KEY_INTERACTION_LAYOUT); - if (obj instanceof DisplayType) { + if (obj instanceof LayoutMode) { return (LayoutMode) obj; } else if (obj instanceof String) { LayoutMode theCode = null; diff --git a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java index 5b15ebf61f..f4c4dee712 100644 --- a/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java +++ b/sdl_android_lib/src/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java @@ -269,7 +269,7 @@ public void setKeyboardProperties(KeyboardProperties keyboardProperties) { @SuppressWarnings("unchecked") public KeyboardProperties getKeyboardProperties() { Object obj = parameters.get(KEY_KEYBOARD_PROPERTIES); - if (obj instanceof Image) { + if (obj instanceof KeyboardProperties) { return (KeyboardProperties) obj; } else if (obj instanceof Hashtable) { try {