Skip to content

Commit 9d7016d

Browse files
author
Mike Burke
committed
Merge branch 'refs/heads/anildahiya/BugFix_KeyBoardProperty_ImageTypeSupported' into sdl_android_parent/develop
2 parents eccc2c9 + 7a5c0ff commit 9d7016d

File tree

3 files changed

+33
-19
lines changed

3 files changed

+33
-19
lines changed

Diff for: sdl_android_lib/src/com/smartdevicelink/proxy/rpc/ImageField.java

+31-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.smartdevicelink.proxy.rpc;
22

3+
import java.util.ArrayList;
34
import java.util.Hashtable;
5+
import java.util.List;
46

57
import com.smartdevicelink.proxy.RPCStruct;
68
import com.smartdevicelink.proxy.rpc.enums.FileType;
@@ -41,22 +43,35 @@ public void setName( ImageFieldName name ) {
4143
store.remove(KEY_NAME);
4244
}
4345
}
44-
public FileType getImageTypeSupported() {
45-
Object obj = store.get(KEY_IMAGE_TYPE_SUPPORTED);
46-
if (obj instanceof FileType) {
47-
return (FileType) obj;
48-
} else if (obj instanceof String) {
49-
FileType theCode = null;
50-
try {
51-
theCode = FileType.valueForString((String) obj);
52-
} catch (Exception e) {
53-
DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + KEY_IMAGE_TYPE_SUPPORTED, e);
54-
}
55-
return theCode;
56-
}
57-
return null;
58-
}
59-
public void setImageTypeSupported( FileType imageTypeSupported ) {
46+
@SuppressWarnings("unchecked")
47+
public List<FileType> getImageTypeSupported() {
48+
if (store.get(KEY_IMAGE_TYPE_SUPPORTED) instanceof List<?>) {
49+
List<?> list = (List<?>)store.get(KEY_IMAGE_TYPE_SUPPORTED);
50+
if (list != null && list.size() > 0) {
51+
Object obj = list.get(0);
52+
if (obj instanceof FileType) {
53+
return (List<FileType>) list;
54+
} else if (obj instanceof String) {
55+
List<FileType> newList = new ArrayList<FileType>();
56+
for (Object hashObj : list) {
57+
String strFormat = (String)hashObj;
58+
FileType theCode = null;
59+
try {
60+
theCode = FileType.valueForString(strFormat);
61+
} catch (Exception e) {
62+
DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + KEY_IMAGE_TYPE_SUPPORTED, e);
63+
}
64+
if (theCode != null) {
65+
newList.add(theCode);
66+
}
67+
}
68+
return newList;
69+
}
70+
}
71+
}
72+
return null;
73+
}
74+
public void setImageTypeSupported( List<FileType> imageTypeSupported ) {
6075
if (imageTypeSupported != null) {
6176
store.put(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported );
6277
}

Diff for: sdl_android_lib/src/com/smartdevicelink/proxy/rpc/PerformInteraction.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.smartdevicelink.protocol.enums.FunctionID;
88
import com.smartdevicelink.proxy.RPCRequest;
9-
import com.smartdevicelink.proxy.rpc.enums.DisplayType;
109
import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
1110
import com.smartdevicelink.proxy.rpc.enums.LayoutMode;
1211
import com.smartdevicelink.util.DebugTool;
@@ -377,7 +376,7 @@ public void setVrHelp(List<VrHelpItem> vrHelp) {
377376

378377
public LayoutMode getInteractionLayout() {
379378
Object obj = parameters.get(KEY_INTERACTION_LAYOUT);
380-
if (obj instanceof DisplayType) {
379+
if (obj instanceof LayoutMode) {
381380
return (LayoutMode) obj;
382381
} else if (obj instanceof String) {
383382
LayoutMode theCode = null;

Diff for: sdl_android_lib/src/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public void setKeyboardProperties(KeyboardProperties keyboardProperties) {
269269
@SuppressWarnings("unchecked")
270270
public KeyboardProperties getKeyboardProperties() {
271271
Object obj = parameters.get(KEY_KEYBOARD_PROPERTIES);
272-
if (obj instanceof Image) {
272+
if (obj instanceof KeyboardProperties) {
273273
return (KeyboardProperties) obj;
274274
} else if (obj instanceof Hashtable) {
275275
try {

0 commit comments

Comments
 (0)