• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 HIMSA II K/S - www.himsa.com.
3  * Represented by EHIMA - www.ehima.com
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 android.bluetooth;
19 
20 import android.bluetooth.BluetoothDevice;
21 import android.content.AttributionSource;
22 import android.os.ParcelUuid;
23 import android.bluetooth.IBluetoothCsipSetCoordinatorLockCallback;
24 
25 import com.android.modules.utils.SynchronousResultReceiver;
26 
27 /**
28  * APIs for Bluetooth CSIP Set Coordinator
29  *
30  * @hide
31  */
32 oneway interface IBluetoothCsipSetCoordinator {
33   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
connect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)34   void connect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
35   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
disconnect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)36   void disconnect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
37   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectedDevices(in AttributionSource attributionSource, in SynchronousResultReceiver receiver)38   void getConnectedDevices(in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
39   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)40   void getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
41   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)42   void getConnectionState(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
43   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)44   void setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
45   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)46   void getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
47 
48   /**
49     * Get the list of group identifiers for the given context {@var uuid}.
50     * @return group identifiers as <code>List<Integer></code>
51     */
52   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getAllGroupIds(in ParcelUuid uuid, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)53   void getAllGroupIds(in ParcelUuid uuid, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
54 
55   /**
56     * Get all groups that {@var device} belongs to.
57     * @return group identifiers and their context uuids as <code>Map<Integer, ParcelUuid></code>
58     */
59   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getGroupUuidMapByDevice(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)60   void getGroupUuidMapByDevice(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
61 
62   /**
63    * Get the number of known group members or
64    * {@link android.bluetooth.IBluetoothCsipSetCoordinator.CSIS_GROUP_SIZE_UNKNOWN} if unknown.
65    * @return group size
66    */
67   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
getDesiredGroupSize(in int group_id, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)68   void getDesiredGroupSize(in int group_id, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
69 
70   /**
71    * Lock group identified with {@var groupId}.
72    * @return unique lock identifier required for unlocking
73    */
74   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
lockGroup(int groupId, in IBluetoothCsipSetCoordinatorLockCallback callback, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)75   void lockGroup(int groupId, in IBluetoothCsipSetCoordinatorLockCallback callback, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
76 
77   /**
78    * Unlock group using {@var lockUuid} acquired through
79    * {@link android.bluetooth.IBluetoothCsipSetCoordinator.lockGroup}.
80    */
81   @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
unlockGroup(in ParcelUuid lockUuid, in AttributionSource attributionSource, in SynchronousResultReceiver receiver)82   void unlockGroup(in ParcelUuid lockUuid, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
83 
84   const int CSIS_GROUP_ID_INVALID = -1;
85   const int CSIS_GROUP_SIZE_UNKNOWN = 1;
86 
87   const int CSIS_GROUP_LOCK_SUCCESS = 0;
88   const int CSIS_GROUP_LOCK_FAILED_INVALID_GROUP = 1;
89   const int CSIS_GROUP_LOCK_FAILED_GROUP_EMPTY = 2;
90   const int CSIS_GROUP_LOCK_FAILED_GROUP_NOT_CONNECTED = 3;
91   const int CSIS_GROUP_LOCK_FAILED_LOCKED_BY_OTHER = 4;
92   const int CSIS_GROUP_LOCK_FAILED_OTHER_REASON = 5;
93   const int CSIS_LOCKED_GROUP_MEMBER_LOST = 6;
94 }
95