双卡双待手机[海信]挂断来电和指定卡去电实现
海双卡双待手机[海信]挂断来电和指定卡去电实现的技术调研信双卡手机拨打电话时,在启动拨打电话时,传递一个参数给系统,这样系统的可以根据该参数判断使用指定的卡:
海信手机在挂断电话时,使用反射方法,获取endcall(int) 参数来挂断电话,Method getITelephonyMethod = mTelephyMgr.getClass().getDeclaredMethod("getITelephonyMSim"); getITelephonyMethod.setAccessible(true); Object objITelephonyMSim = getITelephonyMethod.invoke(mTelephyMgr); Method intEndCall = objITelephonyMSim.getClass().getMethod("getCallState", int.class); int state1 = (Integer) intEndCall.invoke(objITelephonyMSim, 0);//主卡状态 int state2 = (Integer)intEndCall.invoke(objITelephonyMSim, 1);//副卡状态 if (state1 == 1 || state2 ==1) { //来电话了,执行拒接逻辑 }