Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Crash occurs in SDLDisplayCapabilities+ShowManagerExtensions#maxNumberOfMainFieldLines #1122

Closed
t-yoshii opened this issue Oct 29, 2018 · 0 comments
Assignees
Labels
bug A defect in the library

Comments

@t-yoshii
Copy link

Bug Report

Crash occurs in SDLDisplayCapabilities+ShowManagerExtensions#maxNumberOfMainFieldLines because the type of textFields.name is not "String".

Due to this SDL Core's bug smartdevicelink/sdl_core#2485 , MOBILE_API and HMI_API have different "TextFieldName" information. The 24th and subsequent TextFieldName differ.
As a result, some textFields.name has "long" value.

Type check is required as a temporary fix until above issue #2485 is resolved.

Reproduction Steps
  1. HMI returns UI.GetCapabilities response which includes "textFields" with "addressLines" or "phoneNumber"
  2. SDL app connects to SDL Core
  3. SDL app update screen with SDLScreenManager and call maxNumberOfMainFieldLines function.
Expected Behavior

Crash do not occur

Observed Behavior

Crash occurs

OS & Version Information
  • SDL iOS Version: 6.1.1
  • Testing Against: Our internal HU
Test Case, Sample Code, and / or Example App

I will create PR later.

Additional information

MOBILE_API do not have navigationText, notificationText. So, following fields are shifted.

HMI Mobile
navigationText locationName
notificationText locationDescription
locationName addressLines
locationDescription phoneNumber
addressLines 28
phoneNumber 29

//HMI's UI.GetCapabilities response to SDLCore. Each textFields has correct value.

		"textFields" : 
		[
			
			{
				"characterSet" : "TYPE2SET",
				"name" : "locationName",
				"rows" : 1,
				"width" : 500
			},
			
			{
				"characterSet" : "TYPE2SET",
				"name" : "locationDescription",
				"rows" : 1,
				"width" : 500
			},
			
			{
				"characterSet" : "TYPE2SET",
				"name" : "addressLines",
				"rows" : 1,
				"width" : 500
			},
			
			{
				"characterSet" : "TYPE2SET",
				"name" : "phoneNumber",
				"rows" : 1,
				"width" : 500
			}
		]

// Core's displayCapabilities response to HS. textFields have incorrect value.

  "displayCapabilities" : {
  "displayType" : "GEN3_8-INCH",
  "graphicSupported" : true,

   :
   <snip>
   :

  "textFields" : [
     {
        "characterSet" : "TYPE2SET",
        "name" : "addressLines",
        "rows" : 1,
        "width" : 500
     },
     {
        "characterSet" : "TYPE2SET",
        "name" : "phoneNumber",
        "rows" : 1,
        "width" : 500
     },
     {
        "characterSet" : "TYPE2SET",
        "name" : 28,
        "rows" : 1,
        "width" : 500
     },
     {
        "characterSet" : "TYPE2SET",
        "name" : 29,
        "rows" : 1,
        "width" : 500
     }
  ]

// See above 28 value at function maxNumberOfMainFieldLines in Xcode debugger.
// Its type is "long".

self    SDLDisplayCapabilities *    0x1c00145e0    0x00000001c00145e0
highestFound    NSInteger    0
textField    SDLTextField *    0x1c00153c0    0x00000001c00153c0
SDLRPCStruct    SDLRPCStruct    
NSObject    NSObject    
store    __NSDictionaryM *    4 key/value pairs    0x00000001c02354c0
[0]    (null)    @"rows" : (long)1    
[1]    (null)    @"name" : (long)28                <<<<< long!!!
[2]    (null)    @"characterSet" : @"TYPE2SET"    
[3]    (null)    @"width" : (long)500
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug A defect in the library
Projects
None yet
Development

No branches or pull requests

2 participants