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

Commit 99f4a0f4 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8617226 from bfa6e2d9 to tm-release

Change-Id: I7298d8d299c7497cb53934fcc4bdb4d0c431e40e
parents 9a5e5244 bfa6e2d9
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -620,22 +620,21 @@ public class HapClientService extends ProfileService {
     * @param presetIndex is an index of one of the available presets
     */
    public void selectPresetForGroup(int groupId, int presetIndex) {
        int status = BluetoothStatusCodes.ERROR_UNKNOWN;
        int status = BluetoothStatusCodes.SUCCESS;

        if ((presetIndex == BluetoothHapClient.PRESET_INDEX_UNAVAILABLE)
                || (groupId == BluetoothCsipSetCoordinator.GROUP_ID_INVALID)) {
            if (presetIndex == BluetoothHapClient.PRESET_INDEX_UNAVAILABLE) {
                status = BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX;
            } else {
        if (!isGroupIdValid(groupId)) {
            status = BluetoothStatusCodes.ERROR_CSIP_INVALID_GROUP_ID;
        } else if (!isPresetIndexValid(groupId, presetIndex)) {
            status = BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX;
        }

        if (status != BluetoothStatusCodes.SUCCESS) {
            if (mCallbacks != null) {
                int n = mCallbacks.beginBroadcast();
                for (int i = 0; i < n; i++) {
                    try {
                        mCallbacks.getBroadcastItem(i).onPresetSelectionForGroupFailed(groupId,
                                BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX);
                        mCallbacks.getBroadcastItem(i)
                                .onPresetSelectionForGroupFailed(groupId, status);
                    } catch (RemoteException e) {
                        continue;
                    }
@@ -899,6 +898,8 @@ public class HapClientService extends ProfileService {

    private boolean isPresetIndexValid(int groupId, int presetIndex) {
        List<BluetoothDevice> all_group_devices = getGroupDevices(groupId);
        if (all_group_devices.isEmpty()) return false;

        for (BluetoothDevice device : all_group_devices) {
            if (!isPresetIndexValid(device, presetIndex)) return false;
        }
@@ -914,7 +915,7 @@ public class HapClientService extends ProfileService {
            List<Integer> groups = csipClient.getAllGroupIds(BluetoothUuid.CAP);
            return groups.contains(groupId);
        }
        return true;
        return false;
    }

    /**
@@ -958,8 +959,7 @@ public class HapClientService extends ProfileService {

        if (!isGroupIdValid(groupId)) {
            status = BluetoothStatusCodes.ERROR_CSIP_INVALID_GROUP_ID;
        }
        if (!isPresetIndexValid(groupId, presetIndex)) {
        } else if (!isPresetIndexValid(groupId, presetIndex)) {
            status = BluetoothStatusCodes.ERROR_HAP_INVALID_PRESET_INDEX;
        }
        if (status != BluetoothStatusCodes.SUCCESS) {
+3 −1
Original line number Diff line number Diff line
@@ -466,8 +466,10 @@ public class HapClientTest {
    public void testGroupSelectActivePresetNative() {
        doReturn(new ParcelUuid[]{BluetoothUuid.HAS}).when(mAdapterService)
                .getRemoteUuids(any(BluetoothDevice.class));
        testConnectingDevice(mDevice3);

        int flags = 0x01;
        mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice), flags);
        mNativeInterface.onFeaturesUpdate(getByteAddress(mDevice3), flags);

        // Verify Native Interface call
        mService.selectPresetForGroup(0x03, 0x00);
+0 −55
Original line number Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2021 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 {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

cc_binary {
    name: "bap_uclient_test",
    system_ext_specific: true,
    enabled: false,
    srcs: ["bap_uclient_test.cpp"],

    include_dirs: [
        ".",
        "packages/modules/Bluetooth/system/include",
        "packages/modules/Bluetooth/system/types",
        "vendor/qcom/opensource/commonsys/packages/modules/Bluetooth/system/stack/l2cap",
        "vendor/qcom/opensource/commonsys/packages/modules/Bluetooth/system/utils/include",
        "vendor/qcom/opensource/commonsys/packages/modules/Bluetooth/system",
        "vendor/qcom/opensource/commonsys/bluetooth_lea/vhal/include",
        "external/libchrome",
    ],

    cflags: ["-DHAS_NO_BDROID_BUILDCFG"],

    shared_libs: [
        "libcutils",
        "libchrome",
        "libutils",
    ],

    static_libs: ["libbluetooth-types-qti"],

}
+0 −1908

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −44
Original line number Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2021 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 {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "system_bt_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["system_bt_license"],
}

cc_library_static {
    name: "libbluetooth-types-qti",
    vendor_available: true,
    enabled: false,
    defaults: ["fluoride_types_defaults"],
    cflags: [
        /* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
        "-fvisibility=default",
    ],
    host_supported: true,
    srcs: [
        "class_of_device.cc",
        "raw_address.cc",
        "bluetooth/uuid.cc",
    ],
}
Loading