Example usage for android.content Intent ACTION_CALL_BUTTON

List of usage examples for android.content Intent ACTION_CALL_BUTTON

Introduction

In this page you can find the example usage for android.content Intent ACTION_CALL_BUTTON.

Prototype

String ACTION_CALL_BUTTON

To view the source code for android.content Intent ACTION_CALL_BUTTON.

Click Source Link

Document

Activity Action: The user pressed the "call" button to go to the dialer or other appropriate UI for placing a call.

Usage

From source file:com.android.common.util.IntentUtils.java

/**
 * Open dial//from ww w  .j  av  a2 s . c  om
 *
 * @param context
 */
public static void openDial(Context context) {
    Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
    context.startActivity(intent);
}

From source file:com.hch.beautyenjoy.tools.IntentUtils.java

/**
 * Open dial/* w w w. j  a  v a2  s .c  o m*/
 */
public static void openDial(Context context) {
    Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
    ComponentName componentName = intent.resolveActivity(context.getPackageManager());
    if (componentName != null) {
        context.startActivity(intent);
    }
}

From source file:com.android.contacts.activities.DialtactsActivity.java

private void fixIntent(Intent intent) {
    // This should be cleaned up: the call key used to send an Intent
    // that just said to go to the recent calls list.  It now sends this
    // abstract action, but this class hasn't been rewritten to deal with it.
    if (Intent.ACTION_CALL_BUTTON.equals(intent.getAction())) {
        intent.setDataAndType(Calls.CONTENT_URI, Calls.CONTENT_TYPE);
        intent.putExtra("call_key", true);
        setIntent(intent);//from w w  w  .  ja  va 2 s.  com
    }
}

From source file:com.android.dialer.DialtactsActivity.java

/**
 * Returns true if the intent is due to hitting the green send key (hardware call button:
 * KEYCODE_CALL) while in a call./*from   w w  w .  j  a  va 2s .c o m*/
 *
 * @param intent the intent that launched this activity
 * @return true if the intent is due to hitting the green send key while in a call
 */
private boolean isSendKeyWhileInCall(Intent intent) {
    // If there is a call in progress and the user launched the dialer by hitting the call
    // button, go straight to the in-call screen.
    final boolean callKey = Intent.ACTION_CALL_BUTTON.equals(intent.getAction());

    if (callKey) {
        TelecomUtil.showInCallScreen(this, false);
        return true;
    }

    return false;
}

From source file:com.android.dialer.DialtactsFragment.java

/**
 * Returns true if the intent is due to hitting the green send key (hardware call button:
 * KEYCODE_CALL) while in a call./*from ww  w.j  a v  a2 s. co  m*/
 *
 * @param intent the intent that launched this activity
 * @return true if the intent is due to hitting the green send key while in a call
 */
private boolean isSendKeyWhileInCall(Intent intent) {
    // If there is a call in progress and the user launched the dialer by hitting the call
    // button, go straight to the in-call screen.
    final boolean callKey = Intent.ACTION_CALL_BUTTON.equals(intent.getAction());

    if (callKey) {
        getTelecomManager().showInCallScreen(false);
        return true;
    }

    return false;
}