| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 18 | |
| Tyler Gunn | 711d876fd | 2014-09-19 11:17:02 -0700 | [diff] [blame] | 19 | import android.annotation.SystemApi; |
| 20 | |
| Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 21 | /** |
| 22 | * Defines capabilities a phone call can support, such as conference calling and video telephony. |
| 23 | * Also defines properties of a phone call, such as whether it is using VoLTE technology. |
| Tyler Gunn | 711d876fd | 2014-09-19 11:17:02 -0700 | [diff] [blame] | 24 | * @hide |
| Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 25 | */ |
| Tyler Gunn | 711d876fd | 2014-09-19 11:17:02 -0700 | [diff] [blame] | 26 | @SystemApi |
| Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 27 | public final class PhoneCapabilities { |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 28 | /** Call can currently be put on hold or unheld. */ |
| 29 | public static final int HOLD = 0x00000001; |
| 30 | |
| 31 | /** Call supports the hold feature. */ |
| 32 | public static final int SUPPORT_HOLD = 0x00000002; |
| 33 | |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 34 | /** |
| 35 | * Calls within a conference can be merged. Some connection services create a conference call |
| 36 | * only after two calls have been merged. However, a conference call can also be added the |
| 37 | * moment there are more than one call. CDMA calls are implemented in this way because the call |
| 38 | * actions are more limited when more than one call exists. This flag allows merge to be exposed |
| 39 | * as a capability on the conference call instead of individual calls. |
| 40 | */ |
| 41 | public static final int MERGE_CONFERENCE = 0x00000004; |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 42 | |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 43 | /** Calls withing a conference can be swapped between foreground and background. */ |
| 44 | public static final int SWAP_CONFERENCE = 0x00000008; |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 45 | |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 46 | /** Call currently supports adding another call to this one. */ |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 47 | public static final int ADD_CALL = 0x00000010; |
| 48 | |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 49 | /** Call supports responding via text option. */ |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 50 | public static final int RESPOND_VIA_TEXT = 0x00000020; |
| 51 | |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 52 | /** Call can be muted. */ |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 53 | public static final int MUTE = 0x00000040; |
| 54 | |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 55 | /** |
| 56 | * Call supports conference call management. This capability only applies to conference calls |
| 57 | * which can have other calls as children. |
| 58 | */ |
| 59 | public static final int MANAGE_CONFERENCE = 0x00000080; |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 60 | |
| Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 61 | /** |
| 62 | * Local device supports video telephony. |
| 63 | * @hide |
| 64 | */ |
| Tyler Gunn | 2db72ad | 2014-07-10 14:34:51 -0700 | [diff] [blame] | 65 | public static final int SUPPORTS_VT_LOCAL = 0x00000100; |
| 66 | |
| Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 67 | /** |
| 68 | * Remote device supports video telephony. |
| 69 | * @hide |
| 70 | */ |
| Tyler Gunn | 2db72ad | 2014-07-10 14:34:51 -0700 | [diff] [blame] | 71 | public static final int SUPPORTS_VT_REMOTE = 0x00000200; |
| 72 | |
| Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 73 | /** |
| 74 | * Call is using voice over LTE. |
| 75 | * @hide |
| 76 | */ |
| Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 77 | public static final int VoLTE = 0x00000400; |
| 78 | |
| Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 79 | /** |
| 80 | * Call is using voice over WIFI. |
| 81 | * @hide |
| 82 | */ |
| Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 83 | public static final int VoWIFI = 0x00000800; |
| 84 | |
| Ihab Awad | 2ef34be | 2014-09-11 08:49:02 -0700 | [diff] [blame] | 85 | /** |
| 86 | * Call is able to be separated from its parent {@code Conference}, if any. |
| 87 | */ |
| 88 | public static final int SEPARATE_FROM_CONFERENCE = 0x00001000; |
| 89 | |
| 90 | /** |
| 91 | * Call is able to be individually disconnected when in a {@code Conference}. |
| 92 | */ |
| 93 | public static final int DISCONNECT_FROM_CONFERENCE = 0x00002000; |
| 94 | |
| 95 | public static final int ALL = HOLD | SUPPORT_HOLD | MERGE_CONFERENCE | SWAP_CONFERENCE |
| 96 | | ADD_CALL | RESPOND_VIA_TEXT | MUTE | MANAGE_CONFERENCE | SEPARATE_FROM_CONFERENCE |
| 97 | | DISCONNECT_FROM_CONFERENCE; |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 98 | |
| 99 | public static String toString(int capabilities) { |
| 100 | StringBuilder builder = new StringBuilder(); |
| 101 | builder.append("[Capabilities:"); |
| 102 | if ((capabilities & HOLD) != 0) { |
| 103 | builder.append(" HOLD"); |
| 104 | } |
| 105 | if ((capabilities & SUPPORT_HOLD) != 0) { |
| 106 | builder.append(" SUPPORT_HOLD"); |
| 107 | } |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 108 | if ((capabilities & MERGE_CONFERENCE) != 0) { |
| 109 | builder.append(" MERGE_CONFERENCE"); |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 110 | } |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 111 | if ((capabilities & SWAP_CONFERENCE) != 0) { |
| 112 | builder.append(" SWAP_CONFERENCE"); |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 113 | } |
| 114 | if ((capabilities & ADD_CALL) != 0) { |
| 115 | builder.append(" ADD_CALL"); |
| 116 | } |
| 117 | if ((capabilities & RESPOND_VIA_TEXT) != 0) { |
| 118 | builder.append(" RESPOND_VIA_TEXT"); |
| 119 | } |
| 120 | if ((capabilities & MUTE) != 0) { |
| 121 | builder.append(" MUTE"); |
| 122 | } |
| Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 123 | if ((capabilities & MANAGE_CONFERENCE) != 0) { |
| 124 | builder.append(" MANAGE_CONFERENCE"); |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 125 | } |
| Tyler Gunn | 2db72ad | 2014-07-10 14:34:51 -0700 | [diff] [blame] | 126 | if ((capabilities & SUPPORTS_VT_LOCAL) != 0) { |
| 127 | builder.append(" SUPPORTS_VT_LOCAL"); |
| 128 | } |
| 129 | if ((capabilities & SUPPORTS_VT_REMOTE) != 0) { |
| 130 | builder.append(" SUPPORTS_VT_REMOTE"); |
| 131 | } |
| Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 132 | if ((capabilities & VoLTE) != 0) { |
| 133 | builder.append(" VoLTE"); |
| 134 | } |
| 135 | if ((capabilities & VoWIFI) != 0) { |
| 136 | builder.append(" VoWIFI"); |
| 137 | } |
| Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 138 | builder.append("]"); |
| 139 | return builder.toString(); |
| 140 | } |
| 141 | |
| Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 142 | private PhoneCapabilities() {} |
| Sailesh Nepal | f6e9b27 | 2014-04-01 14:23:09 -0700 | [diff] [blame] | 143 | } |