Skip to content

Commit 1588fb9

Browse files
Log warning message if we set voice sommands to sub menus (#1761)
1 parent 4928327 commit 1588fb9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuReplaceUtilities.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import com.smartdevicelink.proxy.rpc.enums.MenuLayout;
5353
import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
5454
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
55+
import com.smartdevicelink.util.DebugTool;
5556

5657
import java.util.ArrayList;
5758
import java.util.HashMap;
@@ -64,6 +65,7 @@
6465
* Created by Bilal Alsharifi on 1/25/21.
6566
*/
6667
class MenuReplaceUtilities {
68+
private static final String TAG = "MenuReplaceUtilities";
6769
private static int menuId = 0;
6870

6971
static int getNextMenuId() {
@@ -271,6 +273,10 @@ static AddSubMenu subMenuCommandForMenuCell(MenuCell cell, FileManager fileManag
271273
boolean shouldCellIncludeSecondaryImage = cell.getSecondaryArtwork() != null && cell.getSecondaryArtwork().getImageRPC() != null && shouldCellIncludeSecondaryImageFromCell(cell, fileManager, windowCapability);
272274
Image secondaryIcon = (shouldCellIncludeSecondaryImage ? cell.getSecondaryArtwork().getImageRPC() : null);
273275

276+
if (cell.getVoiceCommands() != null && !cell.getVoiceCommands().isEmpty()) {
277+
DebugTool.logWarning(TAG, "Setting voice commands for submenu cells is not supported. The voice commands will not be set.");
278+
}
279+
274280
MenuLayout submenuLayout;
275281
List<MenuLayout> availableMenuLayouts = windowCapability != null ? windowCapability.getMenuLayoutsAvailable() : null;
276282
if (cell.getSubMenuLayout() != null && availableMenuLayouts != null && availableMenuLayouts.contains(cell.getSubMenuLayout())) {

0 commit comments

Comments
 (0)