diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-08-17 16:35:42 -0400 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2020-08-17 16:35:42 -0400 |
commit | 4081edfd518e0f3903af1edd5f74c8a5de2d50d3 (patch) | |
tree | 53b0f3473be0af4690d66b508aa4116c24cb7596 /base/src/main/java | |
parent | d9aac82aa1a8626c32bd3cd09df49b0b878e8d66 (diff) | |
parent | c92ff5dbd99ff663c4a81ab95868bc8967ee7842 (diff) | |
download | sdl_android-4081edfd518e0f3903af1edd5f74c8a5de2d50d3.tar.gz |
Merge branch 'develop' into feature/issue_1446_remove_deprecated_rpcsfeature/issue_1446_remove_deprecated_rpcs
# Conflicts:
# base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
Diffstat (limited to 'base/src/main/java')
6 files changed, 422 insertions, 1 deletions
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java index cba2cb7ad..b9471209c 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java +++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java @@ -133,6 +133,8 @@ public enum FunctionID{ ON_APP_SERVICE_DATA(32786, "OnAppServiceData"),
ON_SYSTEM_CAPABILITY_UPDATED(32787, "OnSystemCapabilityUpdated"),
ON_SUBTLE_ALERT_PRESSED(32788, "OnSubtleAlertPressed"),
+ ON_UPDATE_FILE(32789, "OnUpdateFile"),
+ ON_UPDATE_SUB_MENU(32790, "OnUpdateSubMenu"),
;
public static final int INVALID_ID = -1;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java new file mode 100644 index 000000000..f8b16ce29 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.proxy.RPCStruct; +import com.smartdevicelink.proxy.rpc.enums.ImageFieldName; + +import java.util.Hashtable; +import java.util.List; + +/** + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>supportedDynamicImageFieldNames</td> + * <td>List<ImageFieldName></td> + * <td>An array of ImageFieldName values for which the system supports sending OnFileUpdatenotifications. If you send an Image struct for that image field with a name without havinguploaded the image data using PutFile that matches that name, the system will request thatyou upload the data with PutFile at a later point when the HMI needs it. The HMI will thendisplay the image in the appropriate field. If not sent, assume false.</td> + * <td>N</td> + * <td></td> + * </tr> + * <tr> + * <td>supportsDynamicSubMenus</td> + * <td>Boolean</td> + * <td>If true, the head unit supports dynamic sub-menus by sending OnUpdateSubMenunotifications. If true, you should not send AddCommands that attach to a parentID for anAddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you shouldsend all AddCommands with a parentID that match the menuID. If not set, assume false.</td> + * <td>N</td> + * <td></td> + * </tr> + * </table> + * @since SmartDeviceLink 7.0.0 + */ +public class DynamicUpdateCapabilities extends RPCStruct { + public static final String KEY_SUPPORTED_DYNAMIC_IMAGE_FIELD_NAMES = "supportedDynamicImageFieldNames"; + public static final String KEY_SUPPORTS_DYNAMIC_SUB_MENUS = "supportsDynamicSubMenus"; + + /** + * Constructs a new DynamicUpdateCapabilities object + */ + public DynamicUpdateCapabilities() { } + + /** + * Constructs a new DynamicUpdateCapabilities object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public DynamicUpdateCapabilities(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Sets the supportedDynamicImageFieldNames. + * + * @param supportedDynamicImageFieldNames An array of ImageFieldName values for which the system supports sending OnFileUpdate + * notifications. If you send an Image struct for that image field with a name without having + * uploaded the image data using PutFile that matches that name, the system will request that + * you upload the data with PutFile at a later point when the HMI needs it. The HMI will then + * display the image in the appropriate field. If not sent, assume false. + */ + public void setSupportedDynamicImageFieldNames(List<ImageFieldName> supportedDynamicImageFieldNames) { + setValue(KEY_SUPPORTED_DYNAMIC_IMAGE_FIELD_NAMES, supportedDynamicImageFieldNames); + } + + /** + * Gets the supportedDynamicImageFieldNames. + * + * @return List<ImageFieldName> An array of ImageFieldName values for which the system supports sending OnFileUpdate + * notifications. If you send an Image struct for that image field with a name without having + * uploaded the image data using PutFile that matches that name, the system will request that + * you upload the data with PutFile at a later point when the HMI needs it. The HMI will then + * display the image in the appropriate field. If not sent, assume false. + */ + @SuppressWarnings("unchecked") + public List<ImageFieldName> getSupportedDynamicImageFieldNames() { + return (List<ImageFieldName>) getObject(ImageFieldName.class, KEY_SUPPORTED_DYNAMIC_IMAGE_FIELD_NAMES); + } + + /** + * Sets the supportsDynamicSubMenus. + * + * @param supportsDynamicSubMenus If true, the head unit supports dynamic sub-menus by sending OnUpdateSubMenu + * notifications. If true, you should not send AddCommands that attach to a parentID for an + * AddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you should + * send all AddCommands with a parentID that match the menuID. If not set, assume false. + */ + public void setSupportsDynamicSubMenus(Boolean supportsDynamicSubMenus) { + setValue(KEY_SUPPORTS_DYNAMIC_SUB_MENUS, supportsDynamicSubMenus); + } + + /** + * Gets the supportsDynamicSubMenus. + * + * @return Boolean If true, the head unit supports dynamic sub-menus by sending OnUpdateSubMenu + * notifications. If true, you should not send AddCommands that attach to a parentID for an + * AddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you should + * send all AddCommands with a parentID that match the menuID. If not set, assume false. + */ + public Boolean getSupportsDynamicSubMenus() { + return getBoolean(KEY_SUPPORTS_DYNAMIC_SUB_MENUS); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java new file mode 100644 index 000000000..2f1c63cf8 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCNotification; + +import java.util.Hashtable; + +/** + * This notification tells an app to upload and update a file with a given name. + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>fileName</td> + * <td>String</td> + * <td>File reference name.</td> + * <td>Y</td> + * <td></td> + * </tr> + * </table> + * + * @since SmartDeviceLink 7.0.0 + */ +public class OnUpdateFile extends RPCNotification { + public static final String KEY_FILE_NAME = "fileName"; + + /** + * Constructs a new OnUpdateFile object + */ + public OnUpdateFile() { + super(FunctionID.ON_UPDATE_FILE.toString()); + } + + /** + * Constructs a new OnUpdateFile object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public OnUpdateFile(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new OnUpdateFile object + * + * @param fileName File reference name. + */ + public OnUpdateFile(@NonNull String fileName) { + this(); + setFileName(fileName); + } + + /** + * Sets the fileName. + * + * @param fileName File reference name. + */ + public void setFileName(@NonNull String fileName) { + setParameters(KEY_FILE_NAME, fileName); + } + + /** + * Gets the fileName. + * + * @return String File reference name. + */ + public String getFileName() { + return getString(KEY_FILE_NAME); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java new file mode 100644 index 000000000..e6fb05829 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCNotification; + +import java.util.Hashtable; + +/** + * This notification tells an app to update the AddSubMenu or its 'sub' AddCommand and + * AddSubMenus with the requested data + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>menuID</td> + * <td>Integer</td> + * <td>This menuID must match a menuID in the current menu structure</td> + * <td>Y</td> + * <td></td> + * </tr> + * <tr> + * <td>updateSubCells</td> + * <td>Boolean</td> + * <td>If not set, assume false. If true, the app should send AddCommands with parentIDs matchingthe menuID. These AddCommands will then be attached to the submenu and displayed if thesubmenu is selected.</td> + * <td>N</td> + * <td></td> + * </tr> + * </table> + * + * @since SmartDeviceLink 7.0.0 + */ +public class OnUpdateSubMenu extends RPCNotification { + public static final String KEY_MENU_ID = "menuID"; + public static final String KEY_UPDATE_SUB_CELLS = "updateSubCells"; + + /** + * Constructs a new OnUpdateSubMenu object + */ + public OnUpdateSubMenu() { + super(FunctionID.ON_UPDATE_SUB_MENU.toString()); + } + + /** + * Constructs a new OnUpdateSubMenu object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public OnUpdateSubMenu(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new OnUpdateSubMenu object + * + * @param menuID This menuID must match a menuID in the current menu structure + */ + public OnUpdateSubMenu(@NonNull Integer menuID) { + this(); + setMenuID(menuID); + } + + /** + * Sets the menuID. + * + * @param menuID This menuID must match a menuID in the current menu structure + */ + public void setMenuID(@NonNull Integer menuID) { + setParameters(KEY_MENU_ID, menuID); + } + + /** + * Gets the menuID. + * + * @return Integer This menuID must match a menuID in the current menu structure + */ + public Integer getMenuID() { + return getInteger(KEY_MENU_ID); + } + + /** + * Sets the updateSubCells. + * + * @param updateSubCells If not set, assume false. If true, the app should send AddCommands with parentIDs matching + * the menuID. These AddCommands will then be attached to the submenu and displayed if the + * submenu is selected. + */ + public void setUpdateSubCells(Boolean updateSubCells) { + setParameters(KEY_UPDATE_SUB_CELLS, updateSubCells); + } + + /** + * Gets the updateSubCells. + * + * @return Boolean If not set, assume false. If true, the app should send AddCommands with parentIDs matching + * the menuID. These AddCommands will then be attached to the submenu and displayed if the + * submenu is selected. + */ + public Boolean getUpdateSubCells() { + return getBoolean(KEY_UPDATE_SUB_CELLS); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java index 6974c82db..c93cb50ca 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java @@ -20,6 +20,7 @@ public class WindowCapability extends RPCStruct { public static final String KEY_BUTTON_CAPABILITIES = "buttonCapabilities"; public static final String KEY_SOFT_BUTTON_CAPABILITIES = "softButtonCapabilities"; public static final String KEY_MENU_LAYOUTS_AVAILABLE = "menuLayoutsAvailable"; + public static final String KEY_DYNAMIC_UPDATE_CAPABILITIES = "dynamicUpdateCapabilities"; public WindowCapability() { } @@ -205,4 +206,26 @@ public class WindowCapability extends RPCStruct { public List<MenuLayout> getMenuLayoutsAvailable() { return (List<MenuLayout>) getObject(MenuLayout.class, KEY_MENU_LAYOUTS_AVAILABLE); } + + /** + * Sets the dynamicUpdateCapabilities. + * + * @param dynamicUpdateCapabilities Contains the head unit's capabilities for dynamic updating features declaring if the + * module will send dynamic update RPCs. + * @since SmartDeviceLink 7.0.0 + */ + public void setDynamicUpdateCapabilities(DynamicUpdateCapabilities dynamicUpdateCapabilities) { + setValue(KEY_DYNAMIC_UPDATE_CAPABILITIES, dynamicUpdateCapabilities); + } + + /** + * Gets the dynamicUpdateCapabilities. + * + * @return DynamicUpdateCapabilities Contains the head unit's capabilities for dynamic updating features declaring if the + * module will send dynamic update RPCs. + * @since SmartDeviceLink 7.0.0 + */ + public DynamicUpdateCapabilities getDynamicUpdateCapabilities() { + return (DynamicUpdateCapabilities) getObject(DynamicUpdateCapabilities.class, KEY_DYNAMIC_UPDATE_CAPABILITIES); + } } diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java index cc5572ef2..cb595fc9d 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java @@ -114,7 +114,13 @@ public enum ImageFieldName { *
* @since SmartDeviceLink 7.0.0
*/
- subtleAlertIcon
+ subtleAlertIcon,
+ /**
+ * The image field for AddSubMenu.menuIcon
+ *
+ * @since SmartDeviceLink 7.0.0
+ */
+ subMenuIcon
;
/**
|