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

Commit 6888987e authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8837442 from 6bb4c823 to tm-qpr1-release

Change-Id: I3ed3fe6cfd0b0555accf01e613af30e74633d43a
parents 79aa9e1f 6bb4c823
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "com_android_bluetooth.h"
#include "hardware/bt_le_audio.h"

using bluetooth::le_audio::BroadcastAudioProfile;
using bluetooth::le_audio::BroadcastId;
using bluetooth::le_audio::BroadcastState;
using bluetooth::le_audio::btle_audio_codec_config_t;
@@ -1125,7 +1124,7 @@ static void BroadcasterCleanupNative(JNIEnv* env, jobject object) {
}

static void CreateBroadcastNative(JNIEnv* env, jobject object,
                                  jbyteArray metadata, jint audio_profile,
                                  jbyteArray metadata,
                                  jbyteArray broadcast_code) {
  LOG(INFO) << __func__;
  std::shared_lock<std::shared_timed_mutex> lock(sBroadcasterInterfaceMutex);
@@ -1140,7 +1139,6 @@ static void CreateBroadcastNative(JNIEnv* env, jobject object,
  jbyte* meta = env->GetByteArrayElements(metadata, nullptr);
  sLeAudioBroadcasterInterface->CreateBroadcast(
      std::vector<uint8_t>(meta, meta + env->GetArrayLength(metadata)),
      static_cast<BroadcastAudioProfile>(audio_profile),
      broadcast_code ? std::optional<std::array<uint8_t, 16>>(code_array)
                     : std::nullopt);
  env->ReleaseByteArrayElements(metadata, meta, 0);
@@ -1200,7 +1198,7 @@ static JNINativeMethod sBroadcasterMethods[] = {
    {"initNative", "()V", (void*)BroadcasterInitNative},
    {"stopNative", "()V", (void*)BroadcasterStopNative},
    {"cleanupNative", "()V", (void*)BroadcasterCleanupNative},
    {"createBroadcastNative", "([BI[B)V", (void*)CreateBroadcastNative},
    {"createBroadcastNative", "([B[B)V", (void*)CreateBroadcastNative},
    {"updateMetadataNative", "(I[B)V", (void*)UpdateMetadataNative},
    {"startBroadcastNative", "(I)V", (void*)StartBroadcastNative},
    {"stopBroadcastNative", "(I)V", (void*)StopBroadcastNative},
+15 −0
Original line number Diff line number Diff line
@@ -494,6 +494,9 @@ public class CsipSetCoordinatorService extends ProfileService {
    public @Nullable UUID lockGroup(
            int groupId, @NonNull IBluetoothCsipSetCoordinatorLockCallback callback) {
        if (callback == null) {
            if (DBG) {
                Log.d(TAG, "lockGroup(): " + groupId + ", callback not provided ");
            }
            return null;
        }

@@ -520,12 +523,18 @@ public class CsipSetCoordinatorService extends ProfileService {
                } catch (RemoteException e) {
                    throw e.rethrowFromSystemServer();
                }
                if (DBG) {
                    Log.d(TAG, "lockGroup(): " + groupId + ", ERROR_CSIP_GROUP_LOCKED_BY_OTHER ");
                }
                return null;
            }

            mLocks.put(groupId, new Pair<>(uuid, callback));
        }

        if (DBG) {
            Log.d(TAG, "lockGroup(): locking group: " + groupId);
        }
        mCsipSetCoordinatorNativeInterface.groupLockSet(groupId, true);
        return uuid;
    }
@@ -538,6 +547,9 @@ public class CsipSetCoordinatorService extends ProfileService {
     */
    public void unlockGroup(@NonNull UUID lockUuid) {
        if (lockUuid == null) {
            if (DBG) {
                Log.d(TAG, "unlockGroup(): lockUuid is null");
            }
            return;
        }

@@ -546,6 +558,9 @@ public class CsipSetCoordinatorService extends ProfileService {
                    mLocks.entrySet()) {
                Pair<UUID, IBluetoothCsipSetCoordinatorLockCallback> uuidCbPair = entry.getValue();
                if (uuidCbPair.first.equals(lockUuid)) {
                    if (DBG) {
                        Log.d(TAG, "unlockGroup(): unlocking ... " + lockUuid);
                    }
                    mCsipSetCoordinatorNativeInterface.groupLockSet(entry.getKey(), false);
                    return;
                }
+3 −4
Original line number Diff line number Diff line
@@ -169,12 +169,11 @@ public class LeAudioBroadcasterNativeInterface {
     * Creates LeAudio Broadcast instance.
     *
     * @param metadata metadata buffer with TLVs
     * @param audioProfile broadcast audio profile
     * @param broadcastCode optional code if broadcast should be encrypted
     */
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    public void createBroadcast(byte[] metadata, int audioProfile, byte[] broadcastCode) {
        createBroadcastNative(metadata, audioProfile, broadcastCode);
    public void createBroadcast(byte[] metadata, byte[] broadcastCode) {
        createBroadcastNative(metadata, broadcastCode);
    }

    /**
@@ -241,7 +240,7 @@ public class LeAudioBroadcasterNativeInterface {
    private native void initNative();
    private native void stopNative();
    private native void cleanupNative();
    private native void createBroadcastNative(byte[] metadata, int profile, byte[] broadcastCode);
    private native void createBroadcastNative(byte[] metadata, byte[] broadcastCode);
    private native void updateMetadataNative(int broadcastId, byte[] metadata);
    private native void startBroadcastNative(int broadcastId);
    private native void stopBroadcastNative(int broadcastId);
+1 −9
Original line number Diff line number Diff line
@@ -105,12 +105,6 @@ public class LeAudioService extends ProfileService {
     */
    private static final int ACTIVE_CONTEXTS_NONE = 0;

    /*
     * Brodcast profile used by the lower layers
     */
    private static final int BROADCAST_PROFILE_SONIFICATION = 0;
    private static final int BROADCAST_PROFILE_MEDIA = 1;

    private AdapterService mAdapterService;
    private DatabaseManager mDatabaseManager;
    private HandlerThread mStateMachinesThread;
@@ -664,8 +658,6 @@ public class LeAudioService extends ProfileService {
    /**
     * Creates LeAudio Broadcast instance.
     * @param metadata metadata buffer with TLVs
     * @param audioProfile broadcast audio profile
     * @param broadcastCode optional code if broadcast should be encrypted
     */
    public void createBroadcast(BluetoothLeAudioContentMetadata metadata, byte[] broadcastCode) {
        if (mLeAudioBroadcasterNativeInterface == null) {
@@ -673,7 +665,7 @@ public class LeAudioService extends ProfileService {
            return;
        }
        mLeAudioBroadcasterNativeInterface.createBroadcast(metadata.getRawMetadata(),
                BROADCAST_PROFILE_MEDIA, broadcastCode);
                broadcastCode);
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -178,6 +178,10 @@ public class VolumeControlNativeInterface {
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    public boolean setExtAudioOutVolumeOffset(BluetoothDevice device, int externalOutputId,
                                                    int offset) {
        if (Utils.isPtsTestMode()) {
            setVolumeNative(getByteAddress(device), offset);
            return true;
        }
        return setExtAudioOutVolumeOffsetNative(getByteAddress(device), externalOutputId, offset);
    }

Loading