summaryrefslogtreecommitdiff
path: root/system/binder
diff options
context:
space:
mode:
authorJack He <siyuanh@google.com>2022-02-23 16:58:03 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-23 16:58:03 +0000
commit3a88d77b08c87cb1517fa63cbdf7f99ca10100db (patch)
treec2c8d3e52f453cfd79776457c35d2935a698b93c /system/binder
parent89b965d721c1b41755dc4935e576158d554714e5 (diff)
parent2e6d4b42917664491cd42bc0e13a2961ef058db4 (diff)
Merge changes I343ff48c,I4b1ecf81 am: 2e6d4b4291
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1985329 Change-Id: Id92c7e06e2d4a4ecbbf63942a922613ce6484020
Diffstat (limited to 'system/binder')
-rw-r--r--system/binder/Android.bp1
-rw-r--r--system/binder/android/bluetooth/IBluetoothHapClient.aidl44
-rw-r--r--system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl39
3 files changed, 56 insertions, 28 deletions
diff --git a/system/binder/Android.bp b/system/binder/Android.bp
index 54b7f01be7..44cbc36339 100644
--- a/system/binder/Android.bp
+++ b/system/binder/Android.bp
@@ -25,6 +25,7 @@ filegroup {
"android/bluetooth/IBluetoothHeadset.aidl",
"android/bluetooth/IBluetoothHearingAid.aidl",
"android/bluetooth/IBluetoothHapClient.aidl",
+ "android/bluetooth/IBluetoothHapClientCallback.aidl",
"android/bluetooth/IBluetoothVolumeControl.aidl",
"android/bluetooth/IBluetoothHidHost.aidl",
"android/bluetooth/IBluetoothLeAudio.aidl",
diff --git a/system/binder/android/bluetooth/IBluetoothHapClient.aidl b/system/binder/android/bluetooth/IBluetoothHapClient.aidl
index 672ab409c6..ee956c3210 100644
--- a/system/binder/android/bluetooth/IBluetoothHapClient.aidl
+++ b/system/binder/android/bluetooth/IBluetoothHapClient.aidl
@@ -18,6 +18,7 @@
package android.bluetooth;
import android.bluetooth.BluetoothDevice;
+import android.bluetooth.IBluetoothHapClientCallback;
import android.content.AttributionSource;
import com.android.modules.utils.SynchronousResultReceiver;
@@ -30,10 +31,6 @@ import com.android.modules.utils.SynchronousResultReceiver;
oneway interface IBluetoothHapClient {
// Public API
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
- void connect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
- @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
- void disconnect(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
- @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getConnectedDevices(in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getDevicesMatchingConnectionStates(in int[] states, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@@ -43,55 +40,46 @@ oneway interface IBluetoothHapClient {
void setConnectionPolicy(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getConnectionPolicy(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
-
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getHapGroup(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getActivePresetIndex(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
+ void getActivePresetInfo(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void selectActivePreset(in BluetoothDevice device, int presetIndex, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void selectPreset(in BluetoothDevice device, int presetIndex, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void groupSelectActivePreset(int groupId, int presetIndex, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void selectPresetForGroup(int groupId, int presetIndex, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void nextActivePreset(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void switchToNextPreset(in BluetoothDevice device, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void groupNextActivePreset(int groupId, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void switchToNextPresetForGroup(int groupId, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void previousActivePreset(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void switchToPreviousPreset(in BluetoothDevice device, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void groupPreviousActivePreset(int groupId, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void switchToPreviousPresetForGroup(int groupId, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getPresetInfo(in BluetoothDevice device, int presetIndex, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
- void getAllPresetsInfo(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ void getAllPresetInfo(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
void getFeatures(in BluetoothDevice device, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void setPresetName(in BluetoothDevice device, int presetIndex, in String name, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void setPresetName(in BluetoothDevice device, int presetIndex, in String name, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
- void groupSetPresetName(int groupId, int presetIndex, in String name, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ oneway void setPresetNameForGroup(int groupId, int presetIndex, in String name, in AttributionSource attributionSource);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
+ void registerCallback(in IBluetoothHapClientCallback callback, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
+ void unregisterCallback(in IBluetoothHapClientCallback callback, in AttributionSource attributionSource, in SynchronousResultReceiver receiver);
const int PRESET_INDEX_UNAVAILABLE = 0;
const int GROUP_ID_UNAVAILABLE = -1;
- const int STATUS_SET_NAME_NOT_ALLOWED = 1;
- const int STATUS_OPERATION_NOT_SUPPORTED = 2;
- const int STATUS_OPERATION_NOT_POSSIBLE = 3;
- const int STATUS_INVALID_PRESET_NAME_LENGTH = 4;
- const int STATUS_INVALID_PRESET_INDEX = 5;
- const int STATUS_GROUP_OPERATION_NOT_SUPPORTED = 6;
- const int STATUS_PROCEDURE_ALREADY_IN_PROGRESS = 7;
-
const int FEATURE_BIT_NUM_TYPE_MONAURAL = 0;
const int FEATURE_BIT_NUM_TYPE_BANDED = 1;
const int FEATURE_BIT_NUM_SYNCHRONIZATED_PRESETS = 2;
const int FEATURE_BIT_NUM_INDEPENDENT_PRESETS = 3;
const int FEATURE_BIT_NUM_DYNAMIC_PRESETS = 4;
const int FEATURE_BIT_NUM_WRITABLE_PRESETS = 5;
-
- const int PRESET_INFO_REASON_ALL_PRESET_INFO = 0;
- const int PRESET_INFO_REASON_PRESET_INFO_UPDATE = 1;
- const int PRESET_INFO_REASON_PRESET_DELETED = 2;
- const int PRESET_INFO_REASON_PRESET_AVAILABILITY_CHANGED = 3;
- const int PRESET_INFO_REASON_PRESET_INFO_REQUEST_RESPONSE = 4;
}
diff --git a/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl b/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl
new file mode 100644
index 0000000000..5e2d8fa30b
--- /dev/null
+++ b/system/binder/android/bluetooth/IBluetoothHapClientCallback.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.bluetooth;
+
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothHapPresetInfo;
+
+import java.util.List;
+
+/**
+ * Callback definitions for interacting with HAP Client service
+ *
+ * @hide
+ */
+oneway interface IBluetoothHapClientCallback {
+ void onActivePresetChanged(in BluetoothDevice device, in int presetIndex);
+ void onSelectActivePresetFailed(in BluetoothDevice device, in int statusCode);
+ void onSelectActivePresetForGroupFailed(in int hapGroupId, in int statusCode);
+ void onPresetInfoChanged(in BluetoothDevice device,
+ in List<BluetoothHapPresetInfo> presetInfoList,
+ in int statusCode);
+ void onHapFeaturesAvailable(in BluetoothDevice device, in int hapFeatures);
+ void onSetPresetNameFailed(in BluetoothDevice device, in int status);
+ void onSetPresetNameForGroupFailed(in int hapGroupId, in int status);
+}