1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
4 import java.util.Vector;
\r
6 import com.smartdevicelink.proxy.RPCRequest;
\r
7 import com.smartdevicelink.proxy.constants.Names;
\r
8 import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
\r
9 import com.smartdevicelink.util.DebugTool;
\r
11 * Resets the passed global properties to their default values as defined by
\r
14 * The HELPPROMPT global property default value is generated by SMARTDEVICELINK consists of
\r
15 * the first vrCommand of each Command Menu item defined at the moment PTT is
\r
17 * The TIMEOUTPROMPT global property default value is the same as the HELPPROMPT
\r
18 * global property default value
\r
20 * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b>
\r
23 * @since SmartDeviceLink 1.0
\r
24 * @see SetGlobalProperties
\r
26 public class ResetGlobalProperties extends RPCRequest {
\r
28 * Constructs a new ResetGlobalProperties object
\r
30 public ResetGlobalProperties() {
\r
31 super("ResetGlobalProperties");
\r
34 * Constructs a new ResetGlobalProperties object indicated by the Hashtable
\r
39 * The Hashtable to use
\r
41 public ResetGlobalProperties(Hashtable hash) {
\r
45 * Gets an array of one or more GlobalProperty enumeration elements
\r
46 * indicating which global properties to reset to their default value
\r
48 * @return Vector<GlobalProperty> -an array of one or more GlobalProperty
\r
49 * enumeration elements
\r
51 public Vector<GlobalProperty> getProperties() {
\r
52 if (parameters.get(Names.properties) instanceof Vector<?>) {
\r
53 Vector<?> list = (Vector<?>)parameters.get(Names.properties);
\r
54 if (list != null && list.size() > 0) {
\r
55 Object obj = list.get(0);
\r
56 if (obj instanceof GlobalProperty) {
\r
57 return (Vector<GlobalProperty>) list;
\r
58 } else if (obj instanceof String) {
\r
59 Vector<GlobalProperty> newList = new Vector<GlobalProperty>();
\r
60 for (Object hashObj : list) {
\r
61 String strFormat = (String)hashObj;
\r
62 GlobalProperty toAdd = null;
\r
64 toAdd = GlobalProperty.valueForString(strFormat);
\r
65 } catch (Exception e) {
\r
66 DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.properties, e);
\r
68 if (toAdd != null) {
\r
79 * Sets an array of one or more GlobalProperty enumeration elements
\r
80 * indicating which global properties to reset to their default value
\r
83 * a Vector<GlobalProperty> An array of one or more
\r
84 * GlobalProperty enumeration elements indicating which global
\r
85 * properties to reset to their default value
\r
87 * <b>Notes: </b>Array must have at least one element
\r
89 public void setProperties( Vector<GlobalProperty> properties ) {
\r
90 if (properties != null) {
\r
91 parameters.put(Names.properties, properties );
\r