/**
  * Resumes a call in progress. Typically launched from the EmergencyCall button on various
  * lockscreens.
  *
  * @return true if we were able to tell InCallScreen to show.
  */
 public boolean resumeCall() {
   ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
   try {
     if (phone != null && phone.showCallScreen()) {
       return true;
     }
   } catch (RemoteException e) {
     // What can we do?
   }
   return false;
 }
  /**
   * Returns true if the intent is due to hitting the green send key (hardware call button:
   * KEYCODE_CALL) while in a call.
   *
   * @param intent the intent that launched this activity
   * @param recentCallsRequest true if the intent is requesting to view recent calls
   * @return true if the intent is due to hitting the green send key while in a call
   */
  private boolean isSendKeyWhileInCall(Intent intent, boolean recentCallsRequest) {
    // If there is a call in progress go to the call screen
    if (recentCallsRequest) {
      final boolean callKey = intent.getBooleanExtra("call_key", false);

      try {
        ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
        if (callKey && phone != null && phone.showCallScreen()) {
          return true;
        }
      } catch (RemoteException e) {
        Log.e(TAG, "Failed to handle send while in call", e);
      }
    }

    return false;
  }