| Jaikumar Ganesh | bf981ca | 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 | |
| 18 | package android.bluetooth; |
| 19 | |
| William Escande | 77e6c2d | 2022-09-03 16:28:12 -0700 | [diff] [blame] | 20 | import android.annotation.NonNull; |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 21 | import android.os.Parcel; |
| 22 | import android.os.Parcelable; |
| 23 | |
| 24 | /** |
| 25 | * The Bluetooth Health Application Configuration that is used in conjunction with |
| 26 | * the {@link BluetoothHealth} class. This class represents an application configuration |
| 27 | * that the Bluetooth Health third party application will register to communicate with the |
| 28 | * remote Bluetooth health device. |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 29 | * |
| 30 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 31 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 32 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 33 | * {@link BluetoothDevice#createL2capChannel(int)} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 34 | */ |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 35 | @Deprecated |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 36 | public final class BluetoothHealthAppConfiguration implements Parcelable { |
| Jack He | f2d49bd | 2019-03-28 17:42:26 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Hide auto-created default constructor |
| 40 | * @hide |
| 41 | */ |
| 42 | BluetoothHealthAppConfiguration() {} |
| 43 | |
| Jack He | 9e045d2 | 2017-08-22 21:21:23 -0700 | [diff] [blame] | 44 | @Override |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 45 | public int describeContents() { |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Return the data type associated with this application configuration. |
| 51 | * |
| 52 | * @return dataType |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 53 | * |
| 54 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 55 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 56 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 57 | * {@link BluetoothDevice#createL2capChannel(int)} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 58 | */ |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 59 | @Deprecated |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 60 | public int getDataType() { |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 61 | return 0; |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Return the name of the application configuration. |
| 66 | * |
| 67 | * @return String name |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 68 | * |
| 69 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 70 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 71 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 72 | * {@link BluetoothDevice#createL2capChannel(int)} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 73 | */ |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 74 | @Deprecated |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 75 | public String getName() { |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 76 | return null; |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Return the role associated with this application configuration. |
| 81 | * |
| Jack He | 910201b | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 82 | * @return One of {@link BluetoothHealth#SOURCE_ROLE} or {@link BluetoothHealth#SINK_ROLE} |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 83 | * |
| 84 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 85 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 86 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 87 | * {@link BluetoothDevice#createL2capChannel(int)} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 88 | */ |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 89 | @Deprecated |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 90 | public int getRole() { |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 91 | return 0; |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /** |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 95 | * @deprecated Health Device Profile (HDP) and MCAP protocol are no longer used. New |
| 96 | * apps should use Bluetooth Low Energy based solutions such as {@link BluetoothGatt}, |
| 97 | * {@link BluetoothAdapter#listenUsingL2capChannel()(int)}, or |
| 98 | * {@link BluetoothDevice#createL2capChannel(int)} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 99 | */ |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 100 | @Deprecated |
| William Escande | 77e6c2d | 2022-09-03 16:28:12 -0700 | [diff] [blame] | 101 | @NonNull |
| 102 | public static final Creator<BluetoothHealthAppConfiguration> CREATOR = new Creator<>() { |
| 103 | @Override |
| 104 | public BluetoothHealthAppConfiguration createFromParcel(Parcel in) { |
| 105 | return new BluetoothHealthAppConfiguration(); |
| 106 | } |
| Jaikumar Ganesh | d3b7d1d | 2011-07-06 17:37:02 -0700 | [diff] [blame] | 107 | |
| William Escande | 77e6c2d | 2022-09-03 16:28:12 -0700 | [diff] [blame] | 108 | @Override |
| 109 | public BluetoothHealthAppConfiguration[] newArray(int size) { |
| 110 | return new BluetoothHealthAppConfiguration[size]; |
| 111 | } |
| 112 | }; |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 113 | |
| Jack He | 9e045d2 | 2017-08-22 21:21:23 -0700 | [diff] [blame] | 114 | @Override |
| Jack He | 07ffaa4 | 2019-01-03 16:23:41 -0800 | [diff] [blame] | 115 | public void writeToParcel(Parcel out, int flags) {} |
| Jaikumar Ganesh | bf981ca | 2011-04-01 16:33:09 -0700 | [diff] [blame] | 116 | } |