Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 | |
| 17 | package android.bluetooth; |
| 18 | |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 19 | import android.os.ParcelFileDescriptor; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 20 | import android.util.Log; |
| 21 | |
| 22 | import java.util.ArrayList; |
| 23 | import java.util.List; |
| 24 | |
| 25 | /** |
| 26 | * Public API for Bluetooth Health Profile. |
| 27 | * |
| 28 | * <p>BluetoothHealth is a proxy object for controlling the Bluetooth |
| 29 | * Service via IPC. |
| 30 | * |
Jaikumar Ganesh | eb9d346 | 2011-08-31 15:36:05 -0700 | [diff] [blame] | 31 | * <p> How to connect to a health device which is acting in the source role. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 32 | * <li> Use {@link BluetoothAdapter#getProfileProxy} to get |
| 33 | * the BluetoothHealth proxy object. </li> |
| 34 | * <li> Create an {@link BluetoothHealth} callback and call |
| 35 | * {@link #registerSinkAppConfiguration} to register an application |
| 36 | * configuration </li> |
| 37 | * <li> Pair with the remote device. This currently needs to be done manually |
| 38 | * from Bluetooth Settings </li> |
| 39 | * <li> Connect to a health device using {@link #connectChannelToSource}. Some |
| 40 | * devices will connect the channel automatically. The {@link BluetoothHealth} |
| 41 | * callback will inform the application of channel state change. </li> |
| 42 | * <li> Use the file descriptor provided with a connected channel to read and |
| 43 | * write data to the health channel. </li> |
| 44 | * <li> The received data needs to be interpreted using a health manager which |
| 45 | * implements the IEEE 11073-xxxxx specifications. |
| 46 | * <li> When done, close the health channel by calling {@link #disconnectChannel} |
| 47 | * and unregister the application configuration calling |
| 48 | * {@link #unregisterAppConfiguration} |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 49 | * |
| 50 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New apps |
| 51 | * should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 52 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 53 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 54 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 55 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 56 | public final class BluetoothHealth implements BluetoothProfile { |
| 57 | private static final String TAG = "BluetoothHealth"; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 58 | /** |
| 59 | * Health Profile Source Role - the health device. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 60 | * |
| 61 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 62 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 63 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 64 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 65 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 66 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 67 | public static final int SOURCE_ROLE = 1 << 0; |
| 68 | |
| 69 | /** |
| 70 | * Health Profile Sink Role the device talking to the health device. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 71 | * |
| 72 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 73 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 74 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 75 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 76 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 77 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 78 | public static final int SINK_ROLE = 1 << 1; |
| 79 | |
| 80 | /** |
| 81 | * Health Profile - Channel Type used - Reliable |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 82 | * |
| 83 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 84 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 85 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 86 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 87 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 88 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 89 | public static final int CHANNEL_TYPE_RELIABLE = 10; |
| 90 | |
| 91 | /** |
| 92 | * Health Profile - Channel Type used - Streaming |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 93 | * |
| 94 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 95 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 96 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 97 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 98 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 99 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 100 | public static final int CHANNEL_TYPE_STREAMING = 11; |
| 101 | |
Jaikumar Ganesh | b5d2d45 | 2011-09-07 14:16:52 -0700 | [diff] [blame] | 102 | |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 103 | /** |
| 104 | * Register an application configuration that acts as a Health SINK. |
| 105 | * This is the configuration that will be used to communicate with health devices |
| 106 | * which will act as the {@link #SOURCE_ROLE}. This is an asynchronous call and so |
| 107 | * the callback is used to notify success or failure if the function returns true. |
| 108 | * |
| 109 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 110 | * |
| 111 | * @param name The friendly name associated with the application or configuration. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 112 | * @param dataType The dataType of the Source role of Health Profile to which the sink wants to |
| 113 | * connect to. |
| 114 | * @param callback A callback to indicate success or failure of the registration and all |
| 115 | * operations done on this application configuration. |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 116 | * @return If true, callback will be called. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 117 | * |
| 118 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 119 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 120 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 121 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 122 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 123 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 124 | public boolean registerSinkAppConfiguration(String name, int dataType, |
Jaikumar Ganesh | fb658c7 | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 125 | BluetoothHealthCallback callback) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 126 | Log.e(TAG, "registerSinkAppConfiguration(): BluetoothHealth is deprecated"); |
| 127 | return false; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Unregister an application configuration that has been registered using |
| 132 | * {@link #registerSinkAppConfiguration} |
| 133 | * |
| 134 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 135 | * |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 136 | * @param config The health app configuration |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 137 | * @return Success or failure. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 138 | * |
| 139 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 140 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 141 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 142 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 143 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 144 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 145 | public boolean unregisterAppConfiguration(BluetoothHealthAppConfiguration config) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 146 | Log.e(TAG, "unregisterAppConfiguration(): BluetoothHealth is deprecated"); |
| 147 | return false; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | /** |
| 151 | * Connect to a health device which has the {@link #SOURCE_ROLE}. |
Jaikumar Ganesh | fb658c7 | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 152 | * This is an asynchronous call. If this function returns true, the callback |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 153 | * associated with the application configuration will be called. |
| 154 | * |
| 155 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 156 | * |
| 157 | * @param device The remote Bluetooth device. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 158 | * @param config The application configuration which has been registered using {@link |
| 159 | * #registerSinkAppConfiguration(String, int, BluetoothHealthCallback) } |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 160 | * @return If true, the callback associated with the application config will be called. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 161 | * |
| 162 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 163 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 164 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 165 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 166 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 167 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 168 | public boolean connectChannelToSource(BluetoothDevice device, |
| 169 | BluetoothHealthAppConfiguration config) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 170 | Log.e(TAG, "connectChannelToSource(): BluetoothHealth is deprecated"); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 171 | return false; |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * Disconnect a connected health channel. |
| 176 | * This is an asynchronous call. If this function returns true, the callback |
| 177 | * associated with the application configuration will be called. |
| 178 | * |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 179 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 180 | * |
| 181 | * @param device The remote Bluetooth device. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 182 | * @param config The application configuration which has been registered using {@link |
| 183 | * #registerSinkAppConfiguration(String, int, BluetoothHealthCallback) } |
Jaikumar Ganesh | eb9d346 | 2011-08-31 15:36:05 -0700 | [diff] [blame] | 184 | * @param channelId The channel id associated with the channel |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 185 | * @return If true, the callback associated with the application config will be called. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 186 | * |
| 187 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 188 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 189 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 190 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 191 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 192 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 193 | public boolean disconnectChannel(BluetoothDevice device, |
Jaikumar Ganesh | eb9d346 | 2011-08-31 15:36:05 -0700 | [diff] [blame] | 194 | BluetoothHealthAppConfiguration config, int channelId) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 195 | Log.e(TAG, "disconnectChannel(): BluetoothHealth is deprecated"); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 196 | return false; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Get the file descriptor of the main channel associated with the remote device |
| 201 | * and application configuration. |
| 202 | * |
| 203 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 204 | * |
Jaikumar Ganesh | eb9d346 | 2011-08-31 15:36:05 -0700 | [diff] [blame] | 205 | * <p> Its the responsibility of the caller to close the ParcelFileDescriptor |
| 206 | * when done. |
| 207 | * |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 208 | * @param device The remote Bluetooth health device |
| 209 | * @param config The application configuration |
| 210 | * @return null on failure, ParcelFileDescriptor on success. |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 211 | * |
| 212 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 213 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 214 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 215 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 216 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 217 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 218 | public ParcelFileDescriptor getMainChannelFd(BluetoothDevice device, |
| 219 | BluetoothHealthAppConfiguration config) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 220 | Log.e(TAG, "getMainChannelFd(): BluetoothHealth is deprecated"); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 221 | return null; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Get the current connection state of the profile. |
| 226 | * |
| 227 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 228 | * |
| 229 | * This is not specific to any application configuration but represents the connection |
| 230 | * state of the local Bluetooth adapter with the remote device. This can be used |
| 231 | * by applications like status bar which would just like to know the state of the |
| 232 | * local adapter. |
| 233 | * |
| 234 | * @param device Remote bluetooth device. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 235 | * @return State of the profile connection. One of {@link #STATE_CONNECTED}, {@link |
| 236 | * #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 237 | */ |
Jaikumar Ganesh | fb658c7 | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 238 | @Override |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 239 | public int getConnectionState(BluetoothDevice device) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 240 | Log.e(TAG, "getConnectionState(): BluetoothHealth is deprecated"); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 241 | return STATE_DISCONNECTED; |
| 242 | } |
| 243 | |
| 244 | /** |
Jaikumar Ganesh | eb9d346 | 2011-08-31 15:36:05 -0700 | [diff] [blame] | 245 | * Get connected devices for the health profile. |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 246 | * |
| 247 | * <p> Return the set of devices which are in state {@link #STATE_CONNECTED} |
| 248 | * |
| 249 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 250 | * |
| 251 | * This is not specific to any application configuration but represents the connection |
| 252 | * state of the local Bluetooth adapter for this profile. This can be used |
| 253 | * by applications like status bar which would just like to know the state of the |
| 254 | * local adapter. |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 255 | * |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 256 | * @return List of devices. The list will be empty on error. |
| 257 | */ |
Jaikumar Ganesh | fb658c7 | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 258 | @Override |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 259 | public List<BluetoothDevice> getConnectedDevices() { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 260 | Log.e(TAG, "getConnectedDevices(): BluetoothHealth is deprecated"); |
| 261 | return new ArrayList<>(); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | /** |
| 265 | * Get a list of devices that match any of the given connection |
| 266 | * states. |
| 267 | * |
| 268 | * <p> If none of the devices match any of the given states, |
| 269 | * an empty list will be returned. |
| 270 | * |
| 271 | * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission. |
| 272 | * This is not specific to any application configuration but represents the connection |
| 273 | * state of the local Bluetooth adapter for this profile. This can be used |
| 274 | * by applications like status bar which would just like to know the state of the |
| 275 | * local adapter. |
| 276 | * |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 277 | * @param states Array of states. States can be one of {@link #STATE_CONNECTED}, {@link |
| 278 | * #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING}, |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 279 | * @return List of devices. The list will be empty on error. |
| 280 | */ |
Jaikumar Ganesh | fb658c7 | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 281 | @Override |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 282 | public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 283 | Log.e(TAG, "getDevicesMatchingConnectionStates(): BluetoothHealth is deprecated"); |
| 284 | return new ArrayList<>(); |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 285 | } |
| 286 | |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 287 | /** Health Channel Connection State - Disconnected |
| 288 | * |
| 289 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 290 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 291 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 292 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 293 | */ |
| 294 | @Deprecated |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 295 | public static final int STATE_CHANNEL_DISCONNECTED = 0; |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 296 | /** Health Channel Connection State - Connecting |
| 297 | * |
| 298 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 299 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 300 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 301 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 302 | */ |
| 303 | @Deprecated |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 304 | public static final int STATE_CHANNEL_CONNECTING = 1; |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 305 | /** Health Channel Connection State - Connected |
| 306 | * |
| 307 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 308 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 309 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 310 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 311 | */ |
| 312 | @Deprecated |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 313 | public static final int STATE_CHANNEL_CONNECTED = 2; |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 314 | /** Health Channel Connection State - Disconnecting |
| 315 | * |
| 316 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 317 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 318 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 319 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 320 | */ |
| 321 | @Deprecated |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 322 | public static final int STATE_CHANNEL_DISCONNECTING = 3; |
| 323 | |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 324 | /** Health App Configuration registration success |
| 325 | * |
| 326 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 327 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 328 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 329 | * {@link BluetoothDevice#createL2capChannel(int)} |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 330 | */ |
Jack He | 6b73b32 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 331 | @Deprecated |
| 332 | public static final int APP_CONFIG_REGISTRATION_SUCCESS = 0; |
| 333 | /** Health App Configuration registration failure |
| 334 | * |
| 335 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 336 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 337 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 338 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 339 | */ |
| 340 | @Deprecated |
| 341 | public static final int APP_CONFIG_REGISTRATION_FAILURE = 1; |
| 342 | /** Health App Configuration un-registration success |
| 343 | * |
| 344 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 345 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 346 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 347 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 348 | */ |
| 349 | @Deprecated |
| 350 | public static final int APP_CONFIG_UNREGISTRATION_SUCCESS = 2; |
| 351 | /** Health App Configuration un-registration failure |
| 352 | * |
| 353 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 354 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 355 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 356 | * {@link BluetoothDevice#createL2capChannel(int)} |
| 357 | */ |
| 358 | @Deprecated |
| 359 | public static final int APP_CONFIG_UNREGISTRATION_FAILURE = 3; |
Jaikumar Ganesh | 2ea1e85 | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 360 | } |