summaryrefslogtreecommitdiff
path: root/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc
diff options
context:
space:
mode:
authorAustin Kirk <askirk@umich.edu>2017-07-31 10:07:07 -0400
committerAustin Kirk <askirk@umich.edu>2017-07-31 10:07:07 -0400
commita2dee7155dd572213f7cf53ac4df0a13e2f9a516 (patch)
treec92bc141408198ddfe855ba0a029cbdc026cec32 /sdl_android/src/main/java/com/smartdevicelink/proxy/rpc
parentbefdeacfd15827307685425b13fde0a823f3c73e (diff)
downloadsdl_android-a2dee7155dd572213f7cf53ac4df0a13e2f9a516.tar.gz
Add phone and navigation capability structs from RCP spec [DRAFT] 4.5.0
Diffstat (limited to 'sdl_android/src/main/java/com/smartdevicelink/proxy/rpc')
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java35
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java27
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java12
3 files changed, 68 insertions, 6 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
new file mode 100644
index 000000000..6d17d2685
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
@@ -0,0 +1,35 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/*
+ * Extended capabilities for an onboard navigation system
+ */
+public class NavigationCapability extends RPCStruct{
+ public static final String KEY_LOCATION_ENABLED = "sendLocationEnabled";
+ public static final String KEY_GETWAYPOINTS_ENABLED = "getWayPointsEnabled";
+
+ public NavigationCapability(){}
+
+ public NavigationCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public Boolean getSendLocationEnabled(){
+ return getBoolean(KEY_LOCATION_ENABLED);
+ }
+
+ public void setSendLocationEnabled(Boolean tf){
+ setValue(KEY_LOCATION_ENABLED, tf);
+ }
+
+ public Boolean getWayPointsEnabled(){
+ return getBoolean(KEY_GETWAYPOINTS_ENABLED);
+ }
+
+ public void setWayPointsEnabled(Boolean tf){
+ setValue(KEY_GETWAYPOINTS_ENABLED, tf);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
new file mode 100644
index 000000000..480812ebf
--- /dev/null
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
@@ -0,0 +1,27 @@
+package com.smartdevicelink.proxy.rpc;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import java.util.Hashtable;
+
+/**
+ * Extended capabilities of the module's phone feature
+ */
+
+public class PhoneCapability extends RPCStruct {
+ public static final String KEY_DIALNUMBER_ENABLED = "dialNumberEnabled";
+
+ public PhoneCapability(){}
+
+ public PhoneCapability(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public Boolean getDialNumberEnabled(){
+ return getBoolean(KEY_DIALNUMBER_ENABLED);
+ }
+
+ public void setDialNumberEnabled(Boolean tf){
+ setValue(KEY_DIALNUMBER_ENABLED, tf);
+ }
+}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
index 97cb787c9..a039e266e 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
@@ -35,21 +35,21 @@ public class SystemCapability extends RPCStruct {
setValue(KEY_SYSTEM_CAPABILITY_TYPE, value);
}
- public Object getCapabilityForType(SystemCapabilityType type){
+ public RPCStruct getCapabilityForType(SystemCapabilityType type){
if(type.equals(SystemCapabilityType.NAVIGATION)){
- return getObject(Object.class, KEY_NAVIGATION_CAPABILITY);
+ return (RPCStruct) getObject(NavigationCapability.class, KEY_NAVIGATION_CAPABILITY);
}else if(type.equals(SystemCapabilityType.PHONE_CALL)){
- return getObject(Object.class, KEY_PHONE_CAPABILITY);
+ return (RPCStruct) getObject(PhoneCapability.class, KEY_PHONE_CAPABILITY);
}else{
return null;
}
}
- public void setCapabilityForType(SystemCapabilityType type, Object capability){
+ public void setCapabilityForType(SystemCapabilityType type, RPCStruct capability){
if(type.equals(SystemCapabilityType.NAVIGATION)){
- setValue(KEY_NAVIGATION_CAPABILITY, (Object) capability);
+ setValue(KEY_NAVIGATION_CAPABILITY, capability);
}else if(type.equals(SystemCapabilityType.PHONE_CALL)){
- setValue(KEY_PHONE_CAPABILITY, (Object) capability);
+ setValue(KEY_PHONE_CAPABILITY, capability);
}else{
return;
}