Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98bc7bac authored by Thomas Girardier's avatar Thomas Girardier Committed by Gerrit Code Review
Browse files

Merge changes from topic "hci_vendor_specific_api" into main

* changes:
  HCI Vendor specific hook to GD/HAL
  GD/HCI: Add fallback handler for vendor specific event
  GD/HCI: Allow return of Command Status or Complete, without preconditionning
  Framework implementation for HCI Vendor Specific Handling
parents cb111410 b50dc7c9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ java_defaults {
            "-Xep:OperatorPrecedence:ERROR",
            "-Xep:ReferenceEquality:ERROR",
            "-Xep:ReturnAtTheEndOfVoidFunction:ERROR",
            "-Xep:ReturnFromVoid:ERROR",
            "-Xep:StaticAssignmentInConstructor:ERROR",
            "-Xep:StaticGuardedByInstance:ERROR",
            "-Xep:StringCaseLocaleUsage:ERROR",
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ filegroup {
        "android/bluetooth/IBluetoothGattServerCallback.aidl",
        "android/bluetooth/IBluetoothHapClient.aidl",
        "android/bluetooth/IBluetoothHapClientCallback.aidl",
        "android/bluetooth/IBluetoothHciVendorSpecificCallback.aidl",
        "android/bluetooth/IBluetoothHeadset.aidl",
        "android/bluetooth/IBluetoothHeadsetClient.aidl",
        "android/bluetooth/IBluetoothHearingAid.aidl",
+8 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.bluetooth;
import android.app.PendingIntent;
import android.bluetooth.IBluetoothActivityEnergyInfoListener;
import android.bluetooth.IBluetoothGatt;
import android.bluetooth.IBluetoothHciVendorSpecificCallback;
import android.bluetooth.IBluetoothPreferredAudioProfilesCallback;
import android.bluetooth.IBluetoothQualityReportReadyCallback;
import android.bluetooth.IBluetoothCallback;
@@ -293,6 +294,13 @@ interface IBluetooth
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
    int unregisterBluetoothQualityReportReadyCallback(in IBluetoothQualityReportReadyCallback callback, in AttributionSource attributionSource);

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    void registerHciVendorSpecificCallback(in IBluetoothHciVendorSpecificCallback callback, in int[] eventCodes);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    void unregisterHciVendorSpecificCallback(in IBluetoothHciVendorSpecificCallback callback);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    void sendHciVendorSpecificCommand(in int ocf, in byte[] parameters, in IBluetoothHciVendorSpecificCallback callback);

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN,android.Manifest.permission.BLUETOOTH_PRIVILEGED})")
    int getOffloadedTransportDiscoveryDataScanSupported(in AttributionSource attributionSource);

+26 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 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;

/**
 * Callback definitions for HCI Vendor Specific Callback.
 * @hide
 */
oneway interface IBluetoothHciVendorSpecificCallback {
    void onCommandStatus(int ocf, in int status);
    void onCommandComplete(int ocf, in byte[] returnParameters);
    void onEvent(int code, in byte[] data);
}
+2 −0
Original line number Diff line number Diff line
@@ -162,6 +162,8 @@ int register_com_android_bluetooth_csip_set_coordinator(JNIEnv* env);

int register_com_android_bluetooth_btservice_BluetoothQualityReport(JNIEnv* env);

int register_com_android_bluetooth_btservice_BluetoothHciVendorSpecific(JNIEnv* env);

struct JNIJavaMethod {
  const char* name;
  const char* signature;
Loading