1 /* 2 * Copyright (c) 2014 The Android Open Source Project 3 * Copyright (C) 2012 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.bluetooth.hfpclient; 19 20 /* 21 * @hide 22 */ 23 24 public final class HeadsetClientHalConstants { 25 // Do not modify without updating the HAL bt_hf_client.h files. 26 27 // match up with bthf_client_connection_state_t enum of bt_hf_client.h 28 static final int CONNECTION_STATE_DISCONNECTED = 0; 29 static final int CONNECTION_STATE_CONNECTING = 1; 30 static final int CONNECTION_STATE_CONNECTED = 2; 31 static final int CONNECTION_STATE_SLC_CONNECTED = 3; 32 static final int CONNECTION_STATE_DISCONNECTING = 4; 33 34 // match up with bthf_client_audio_state_t enum of bt_hf_client.h 35 static final int AUDIO_STATE_DISCONNECTED = 0; 36 static final int AUDIO_STATE_CONNECTING = 1; 37 static final int AUDIO_STATE_CONNECTED = 2; 38 static final int AUDIO_STATE_CONNECTED_MSBC = 3; 39 40 // match up with bthf_client_vr_state_t enum of bt_hf_client.h 41 static final int VR_STATE_STOPPED = 0; 42 static final int VR_STATE_STARTED = 1; 43 44 // match up with bthf_client_volume_type_t enum of bt_hf_client.h 45 static final int VOLUME_TYPE_SPK = 0; 46 static final int VOLUME_TYPE_MIC = 1; 47 48 // match up with bthf_client_network_state_t enum of bt_hf_client.h 49 static final int NETWORK_STATE_NOT_AVAILABLE = 0; 50 static final int NETWORK_STATE_AVAILABLE = 1; 51 52 // match up with bthf_client_service_type_t enum of bt_hf_client.h 53 static final int SERVICE_TYPE_HOME = 0; 54 static final int SERVICE_TYPE_ROAMING = 1; 55 56 // match up with bthf_client_call_state_t enum of bt_hf_client.h 57 static final int CALL_STATE_ACTIVE = 0; 58 static final int CALL_STATE_HELD = 1; 59 static final int CALL_STATE_DIALING = 2; 60 static final int CALL_STATE_ALERTING = 3; 61 static final int CALL_STATE_INCOMING = 4; 62 static final int CALL_STATE_WAITING = 5; 63 static final int CALL_STATE_HELD_BY_RESP_HOLD = 6; 64 65 // match up with bthf_client_call_t enum of bt_hf_client.h 66 static final int CALL_NO_CALLS_IN_PROGRESS = 0; 67 static final int CALL_CALLS_IN_PROGRESS = 1; 68 69 // match up with bthf_client_callsetup_t enum of bt_hf_client.h 70 static final int CALLSETUP_NONE = 0; 71 static final int CALLSETUP_INCOMING = 1; 72 static final int CALLSETUP_OUTGOING = 2; 73 static final int CALLSETUP_ALERTING = 3; 74 75 // match up with bthf_client_callheld_t enum of bt_hf_client.h 76 static final int CALLHELD_NONE = 0; 77 static final int CALLHELD_HOLD_AND_ACTIVE = 1; 78 static final int CALLHELD_HOLD = 2; 79 80 // match up with btrh_client_resp_and_hold_t of bt_hf_client.h 81 static final int RESP_AND_HOLD_HELD = 0; 82 static final int RESP_AND_HOLD_ACCEPT = 1; 83 static final int RESP_AND_HOLD_REJECT = 2; 84 85 // match up with bthf_client_call_direction_t enum of bt_hf_client.h 86 static final int CALL_DIRECTION_OUTGOING = 0; 87 static final int CALL_DIRECTION_INCOMING = 1; 88 89 // match up with bthf_client_call_mpty_type_t enum of bt_hf_client.h 90 static final int CALL_MPTY_TYPE_SINGLE = 0; 91 static final int CALL_MPTY_TYPE_MULTI = 1; 92 93 // match up with bthf_client_cmd_complete_t enum of bt_hf_client.h 94 static final int CMD_COMPLETE_OK = 0; 95 static final int CMD_COMPLETE_ERROR = 1; 96 static final int CMD_COMPLETE_ERROR_NO_CARRIER = 2; 97 static final int CMD_COMPLETE_ERROR_BUSY = 3; 98 static final int CMD_COMPLETE_ERROR_NO_ANSWER = 4; 99 static final int CMD_COMPLETE_ERROR_DELAYED = 5; 100 static final int CMD_COMPLETE_ERROR_REJECTLISTED = 6; 101 static final int CMD_COMPLETE_ERROR_CME = 7; 102 103 // match up with bthf_client_call_action_t enum of bt_hf_client.h 104 static final int CALL_ACTION_CHLD_0 = 0; 105 static final int CALL_ACTION_CHLD_1 = 1; 106 static final int CALL_ACTION_CHLD_2 = 2; 107 static final int CALL_ACTION_CHLD_3 = 3; 108 static final int CALL_ACTION_CHLD_4 = 4; 109 static final int CALL_ACTION_CHLD_1X = 5; 110 static final int CALL_ACTION_CHLD_2X = 6; 111 static final int CALL_ACTION_ATA = 7; 112 static final int CALL_ACTION_CHUP = 8; 113 static final int CALL_ACTION_BTRH_0 = 9; 114 static final int CALL_ACTION_BTRH_1 = 10; 115 static final int CALL_ACTION_BTRH_2 = 11; 116 117 // match up with bthf_client_subscriber_service_type_t enum of 118 // bt_hf_client.h 119 static final int SUBSCRIBER_SERVICE_TYPE_UNKNOWN = 0; 120 static final int SUBSCRIBER_SERVICE_TYPE_VOICE = 1; 121 static final int SUBSCRIBER_SERVICE_TYPE_FAX = 2; 122 123 // match up with bthf_client_in_band_ring_state_t enum in bt_hf_client.h 124 static final int IN_BAND_RING_NOT_PROVIDED = 0; 125 static final int IN_BAND_RING_PROVIDED = 1; 126 127 // AG features masks 128 // match up with masks in bt_hf_client.h 129 // Three-way calling 130 static final int PEER_FEAT_3WAY = 0x00000001; 131 // Echo cancellation and/or noise reduction 132 static final int PEER_FEAT_ECNR = 0x00000002; 133 // Voice recognition 134 static final int PEER_FEAT_VREC = 0x00000004; 135 // In-band ring tone 136 static final int PEER_FEAT_INBAND = 0x00000008; 137 // Attach a phone number to a voice tag 138 static final int PEER_FEAT_VTAG = 0x00000010; 139 // Ability to reject incoming call 140 static final int PEER_FEAT_REJECT = 0x00000020; 141 // Enhanced Call Status 142 static final int PEER_FEAT_ECS = 0x00000040; 143 // Enhanced Call Control 144 static final int PEER_FEAT_ECC = 0x00000080; 145 // Extended error codes 146 static final int PEER_FEAT_EXTERR = 0x00000100; 147 // Codec Negotiation 148 static final int PEER_FEAT_CODEC = 0x00000200; 149 // HFP 1.7 features 150 // HF Indicators 151 static final int PEER_FEAT_HF_IND = 0x00000400; 152 // ESCO S4 link setting 153 static final int PEER_FEAT_ESCO_S4 = 0x00000800; 154 155 // AG's 3WC features masks 156 // match up with masks in bt_hf_client.h 157 // 0 Release waiting call or held calls 158 static final int CHLD_FEAT_REL = 0x00000001; 159 // 1 Release active calls and accept other (waiting or held) cal 160 static final int CHLD_FEAT_REL_ACC = 0x00000002; 161 // 1x Release specified active call only 162 static final int CHLD_FEAT_REL_X = 0x00000004; 163 // 2 Active calls on hold and accept other (waiting or held) call 164 static final int CHLD_FEAT_HOLD_ACC = 0x00000008; 165 // 2x Request private mode with specified call (put the rest on hold) 166 static final int CHLD_FEAT_PRIV_X = 0x00000010; 167 // 3 Add held call to multiparty */ 168 static final int CHLD_FEAT_MERGE = 0x00000020; 169 // 4 Connect two calls and leave (disconnect from) multiparty */ 170 static final int CHLD_FEAT_MERGE_DETACH = 0x00000040; 171 172 // AT Commands 173 // These Commands values must match with Constants defined in 174 // tBTA_HF_CLIENT_AT_CMD_TYPE in bta_hf_client_api.h 175 // used for sending vendor specific AT cmds to AG. 176 177 static final int HANDSFREECLIENT_AT_CMD_NREC = 15; 178 static final int HANDSFREECLIENT_AT_CMD_VENDOR_SPECIFIC_CMD = 16; 179 static final int HANDSFREECLIENT_AT_CMD_BIEV = 17; 180 181 // Flag to check for local NREC support 182 static final boolean HANDSFREECLIENT_NREC_SUPPORTED = true; 183 } 184