summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecomm/TelecommConstants.java
blob: 513a5ee676fcb685c957cd2d9174d5efc679abd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.telecomm;

import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;

/**
 * Defines constants for use with the Telecomm system.
 */
public final class TelecommConstants {
    /**
     * <p>Activity action: Starts the UI for handing an incoming call. This intent starts the
     * in-call UI by notifying the Telecomm system that an incoming call exists for a specific call
     * service (see {@link android.telecomm.ConnectionService}). Telecomm reads the Intent extras
     * to find and bind to the appropriate {@link android.telecomm.ConnectionService} which
     * Telecomm will ultimately use to control and get information about the call.</p>
     *
     * <p>Input: get*Extra field {@link #EXTRA_CALL_SERVICE_DESCRIPTOR} contains the component name
     * of the {@link android.telecomm.ConnectionService} that Telecomm should bind to. Telecomm
     * will then ask the call service for more information about the call prior to showing any UI.
     *
     * TODO(santoscordon): Needs permissions.
     * TODO(santoscordon): Consider moving this into a simple method call on a system service.
     */
    public static final String ACTION_INCOMING_CALL = "android.intent.action.INCOMING_CALL";

    /**
     * The service action used to bind to {@link CallServiceProvider} implementations.
     */
    public static final String ACTION_CALL_SERVICE_PROVIDER = CallServiceProvider.class.getName();

    /**
     * The service action used to bind to {@link ConnectionService} implementations.
     */
    public static final String ACTION_CONNECTION_SERVICE = ConnectionService.class.getName();

    /**
     * Optional extra for {@link Intent#ACTION_CALL} containing a boolean that determines whether
     * the speakerphone should be automatically turned on for an outgoing call.
     */
    public static final String EXTRA_START_CALL_WITH_SPEAKERPHONE =
            "android.intent.extra.START_CALL_WITH_SPEAKERPHONE";

    /**
     * Optional extra for {@link Intent#ACTION_CALL} containing a boolean that determines whether
     * the call should be started with video, if possible.
     */
    public static final String EXTRA_START_CALL_WITH_VIDEO =
            "android.intent.extra.START_CALL_WITH_VIDEO";

    /**
     * Extra for {@link #ACTION_INCOMING_CALL} containing the {@link CallServiceDescriptor} that
     * describes the call service to use for the incoming call.
     */
    public static final String EXTRA_CALL_SERVICE_DESCRIPTOR =
            "android.intent.extra.CALL_SERVICE_DESCRIPTOR";

    /**
     * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains
     * metadata about the call. This {@link Bundle} will be returned to the
     * {@link ConnectionService}.
     */
    public static final String EXTRA_INCOMING_CALL_EXTRAS =
            "android.intent.extra.INCOMING_CALL_EXTRAS";

    /**
     * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the
     * disconnect code.
     */
    public static final String EXTRA_CALL_DISCONNECT_CAUSE =
            "android.telecomm.extra.CALL_DISCONNECT_CAUSE";

    /**
     * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the
     * disconnect message.
     */
    public static final String EXTRA_CALL_DISCONNECT_MESSAGE =
            "android.telecomm.extra.CALL_DISCONNECT_MESSAGE";

    /**
     * Optional extra for {@link TelephonyManager#ACTION_PHONE_STATE_CHANGED} containing the
     * component name of the associated connection service.
     */
    public static final String EXTRA_CONNECTION_SERVICE =
            "android.telecomm.extra.CONNECTION_SERVICE";

    /**
     * The dual tone multi-frequency signaling character sent to indicate the dialing system should
     * pause for a predefined period.
     */
    public static final char DTMF_CHARACTER_PAUSE = ',';

    /**
     * The dual-tone multi-frequency signaling character sent to indicate the dialing system should
     * wait for user confirmation before proceeding.
     */
    public static final char DTMF_CHARACTER_WAIT = ';';
}