When you set the property using for example test case set-context-property you call method context interface method SetProperty, which is mapped to method pri_set_property in gprs.c GDBusMethodTable context_methods.
I added some additional traces as following to my proposed fix:
Sorry I wrote down wrong line number. It should have been 1231.
Fix proposal can be found from https:/ /github. com/jkangas/ ofono-1/ commit/ d0cc0d4723f550b d0fefbadd64a220 b938af6695
When you set the property using for example test case set-context- property you call method context interface method SetProperty, which is mapped to method pri_set_property in gprs.c GDBusMethodTable context_methods.
I added some additional traces as following to my proposed fix:
DBG("JUSSI LOGS: ctx->type is %d.", ctx->type)
if (ctx->type == OFONO_GPRS_ CONTEXT_ TYPE_ANY || CONTEXT_ TYPE_WAP || CONTEXT_ TYPE_IMS) {
ctx->type == OFONO_GPRS_
ctx->type == OFONO_GPRS_
DBG("JUSSI LOGS: Calling invalid args.")
return __ofono_ error_invalid_ args(msg) ;
}
Now, my context listing gives this value for context 2
[ /ril_0/context2 ]
IPv6.Settings = { }
AccessPointNam e = mms
Password =
Active = 0
Type = wap
Settings = { }
Username =
Protocol = ip
Name = PALLO
If I run this:
set-context- property 1 MessageCenter KOEPALLO
I get response "Invalid arguments in method call" as expected
and traces show
JUSSI LOGS: ctx->type is 3.
JUSSI LOGS: Calling invalid args.
Next if I change the type to mms and try to set the MessageCenter like this
set-context- property 1 Type mms property 1 MessageCenter KOEPALLO
set-context-
I get no error from the scripts and extra logs are just
JUSSI LOGS: ctx->type is 2.
Now, if I add same extra traces to original 7f3955122af8b03 49fb7d3f2db8abd 754459d146 fix like this:
DBG("JUSSI LOGS: ctx->type is %d.", ctx->type);
if (ctx->type != OFONO_GPRS_ CONTEXT_ TYPE_MMS || CONTEXT_ TYPE_INTERNET) {
ctx->type != OFONO_GPRS_
DBG("JUSSI LOGS: Calling invalid args.");
return __ofono_ error_invalid_ args(msg) ;
}
And do the same steps, I get
JUSSI LOGS: ctx->type is 3.
JUSSI LOGS: Calling invalid args
to first attempt and later one to the second.
JUSSI LOGS: ctx->type is 2.
JUSSI LOGS: Calling invalid args.
I think this proves the issue.