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