private void onSuppServiceNotification(AsyncResult r) { SuppServiceNotification notification = (SuppServiceNotification) r.result; Phone gsmPhone = PhoneUtils.getGsmPhone(mCallManager); Log.d(TAG, "SS Notification: " + notification); if (notification.notificationType == SuppServiceNotification.NOTIFICATION_TYPE_MT) { if (notification.code == SuppServiceNotification.MT_CODE_FORWARDED_CALL || notification.code == SuppServiceNotification.MT_CODE_DEFLECTED_CALL) { com.android.internal.telephony.Call ringing = gsmPhone.getRingingCall(); if (ringing.getState().isRinging()) { final Call call = getCallForEarliestConnection(ringing); if (call != null) { call.setForwarded(true); notifyUpdateListeners(call); } } else { mNextGsmCallIsForwarded = true; } } else if (notification.code == SuppServiceNotification.MT_CODE_CALL_ON_HOLD || notification.code == SuppServiceNotification.MT_CODE_CALL_RETRIEVED) { final Call call = getCallForEarliestConnection(gsmPhone.getForegroundCall()); if (call != null) { boolean nowHeld = notification.code == SuppServiceNotification.MT_CODE_CALL_ON_HOLD; call.setHeldRemotely(nowHeld); notifyUpdateListeners(call); } } else if (notification.code == SuppServiceNotification.MT_CODE_ADDITIONAL_CALL_FORWARDED) { com.android.internal.telephony.Call fgCall = gsmPhone.getForegroundCall(); if (fgCall.getState().isAlive()) { final Call call = getCallForEarliestConnection(fgCall); if (call != null) { call.setAdditionalCallForwarded(true); notifyUpdateListeners(call); } } } } else if (notification.notificationType == SuppServiceNotification.NOTIFICATION_TYPE_MO) { if (notification.code == SuppServiceNotification.MO_CODE_CALL_IS_WAITING) { com.android.internal.telephony.Call fgCall = gsmPhone.getForegroundCall(); if (fgCall.getState().isDialing()) { final Call call = getCallForEarliestConnection(fgCall); if (call != null) { call.setDialingIsWaiting(true); notifyUpdateListeners(call); } } } else if (notification.code == SuppServiceNotification.MO_CODE_INCOMING_CALLS_BARRED) { final Call call = getCallForEarliestConnection(gsmPhone.getForegroundCall()); if (call != null) { call.setRemoteIncomingCallBarringEnabled(true); notifyUpdateListeners(call); } } } }