[Moto G Android Development] MasterAwesome:
Okay I solved all other RIL issues but here is the one im currently facing

E/SUB ( 2639): Error: Invalid card index EVENT_ICC_CHANGED
E/RILQ ( 277): (0/277): RIL[0][event] qcril_qmi_nas_report_restricted_details: .. reporting 18
E/RILQ ( 425): (2/425): RIL[2][event] qcril_qmi_nas_report_restricted_details: .. reporting 18
E/ModemStackController( 2639): onGetModemCapabilityDone: EXIT!, result null or Exception =com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED
E/ModemStackController( 2639): onGetModemCapabilityDone: EXIT!, result null or Exception =com.android.internal.telephony.CommandException: REQUEST_NOT_SUPPORTED
E/RILQ ( 425): (2/425): RIL[2][event] qcril_gstk_qmi_process_notify_ril_is_ready: Invalid values, instance_id: 0x2, slot_index: 0xff, modem_id: 0x0
E/RILQ ( 425): (2/425): RIL[2][event] qcril_gstk_qmi_process_notify_ril_is_ready: *****ASSERTION FAILED*****
E/RILQ ( 425): (2/425): RIL[2][event] qcril_gstk_qmi_process_notify_ril_is_ready: Cond: 0
E/RILQ ( 425): (2/425): RIL[2][event] qcril_gstk_qmi_process_notify_ril_is_ready: **************************
E/UiccCarrierPrivilegeRules( 2639): Error opening channel
E/UiccCarrierPrivilegeRules( 2639): Error opening channel
E/RILC ( 277): invalid command block for token 34 request <unknown request>
E/RILC ( 425): invalid command block for token 35 request <unknown request>
E/PhoneBase( 2639): Error! registerForCallWaiting() in PhoneBase should not be called, CDMAPhone inactive.
E/PhoneBase( 2639): Error! registerForCallWaiting() in PhoneBase should not be called, CDMAPhone inactive.
E/RILQ ( 425): (2/425): RIL[2][main] qcril_qmi_nas_report_restricted_details: .. reporting 18
E/use-Rlog/RLOG-RIL-MOTEXT( 425): qcrilUpdVoiceCallCount, called , VcCount =0
E/RILQ ( 425): (2/425): RIL[2][cmd-112(152)] qcril_qmi_client_send_msg_sync_ex: error 2 / 0 / 1 / 52, context msg hex 4a, service 2
E/RILQ ( 425): (2/425): RIL[2][cmd-112(152)] qcril_sms_request_ims_registration_state: Failed to get the response of IMS NW registration state from qmi.
E/RILQ ( 277): (0/277): RIL[0][main] qcril_qmi_nas_report_restricted_details: .. reporting 18
E/use-Rlog/RLOG-RIL-MOTEXT( 277): qcrilUpdVoiceCallCount, called , VcCount =0
E/RILQ ( 277): (0/277): RIL[0][cmd-112(128)] qcril_qmi_client_send_msg_sync_ex: error 2 / 0 / 1 / 52, context msg hex 4a, service 2
E/RILQ ( 277): (0/277): RIL[0][cmd-112(128)] qcril_sms_request_ims_registration_state: Failed to get the response of IMS NW registration state from qmi.
E/PHONE ( 2639): [ServiceState] setState deprecated use setVoiceRegState()
E/RIL_ImsSms( 2639): IMS State query failed with exp com.android.internal.telephony.CommandException: GENERIC_FAILURE
E/PHONE ( 2639): [ServiceState] setState deprecated use setVoiceRegState()
E/RIL_ImsSms( 2639): IMS State query failed with exp com.android.internal.telephony.CommandException: GENERIC_FAILURE
E/use-Rlog/RLOG-RIL-MOTEXT( 277): mothook_oem: header type 0, requestCode 0x0
E/use-Rlog/RLOG-RIL-MOTEXT( 277): mothook_oem: header type 0, requestCode 0x0
E/RILC ( 277): RIL_onRequestComplete: invalid RIL_Token
E/RILC ( 277): RIL_onRequestComplete: invalid RIL_Token
E/use-Rlog/RLOG-RIL-MOTEXT( 425): mothook_oem: header type 0, requestCode 0x0
E/use-Rlog/RLOG-RIL-MOTEXT( 425): mothook_oem: header type 0, requestCode 0x0
E/RILC ( 425): RIL_onRequestComplete: invalid RIL_Token
E/RILC ( 425): RIL_onRequestComplete: invalid RIL_Token

: invalid RIL_Token, this is due to checkAndDequeueRequestInfo(pRI) that function

the function defines

int checkAndDequeueRequestInfo(struct RequestInfo *pRI) {
int ret = 0;
/* Hook for current context
pendingRequestsMutextHook refer to &s_pendingRequestsMutex */
pthread_mutex_t* pendingRequestsMutexHook = &s_pendingRequestsMutex;
/* pendingRequestsHook refer to &s_pendingRequests */
RequestInfo ** pendingRequestsHook = &s_pendingRequests;

if (pRI == NULL) {
return 0;
}

static pthread_mutex_t s_pendingRequestsMutex = PTHREAD_MUTEX_INITIALIZER
static RequestInfo *s_pendingRequests = NULL;

returns 0 here so we get the invalid RIL error

struct is defined as

typedef struct RequestInfo {
int32_t token; //this is not RIL_Token
CommandInfo *pCI;
struct RequestInfo *p_next;
char cancelled;
char local; // responses to local commands do not go back to command process
RIL_SOCKET_ID socket_id;
} RequestInfo;

Even if the RIL is not CMRIL the same functions are implemented in the vendor RIL so,

if (!checkAndDequeueRequestInfo(pRI)) { //pRI here is null, hence the error is flagged. THE RIL_TOKEN is not being accepted here

RLOGE ("RIL_onRequestComplete: invalid RIL_Token");
return;
}

Regards